Browse Source

Merge remote-tracking branch 'origin/gzb' into wzl

gzb
wangzhonglu 1 year ago
parent
commit
4922532a19
3 changed files with 167 additions and 26 deletions
  1. 8
    2
      src/views/school/index.vue
  2. 2
    0
      src/views/service/index.vue
  3. 157
    24
      src/views/trial/index.vue

+ 8
- 2
src/views/school/index.vue View File

20
     <div>
20
     <div>
21
       <Table border :data="school.list" :columns="columns">
21
       <Table border :data="school.list" :columns="columns">
22
         <template slot-scope="{ row }" slot="schoollogo">
22
         <template slot-scope="{ row }" slot="schoollogo">
23
-          <img class="img" v-if="row.schoollogo" :src="$api.showImageUrl +row.schoollogo" v-viewer />
23
+          <img
24
+            class="img"
25
+            v-if="row.schoollogo"
26
+            :src="$api.showImageUrl + row.schoollogo"
27
+            v-viewer
28
+          />
24
         </template>
29
         </template>
25
       </Table>
30
       </Table>
26
       <div class="foot_page" v-if="school.total > 0">
31
       <div class="foot_page" v-if="school.total > 0">
243
                   class: "theme_color",
248
                   class: "theme_color",
244
                   on: {
249
                   on: {
245
                     click: () => {
250
                     click: () => {
251
+                      this.$refs["reForm"].resetFields();
246
                       this.revise_data = {
252
                       this.revise_data = {
247
                         show: true,
253
                         show: true,
248
                         data: params.row
254
                         data: params.row
350
             return v;
356
             return v;
351
           });
357
           });
352
           this.school.total = res.obj.total;
358
           this.school.total = res.obj.total;
353
-          console.log(res.obj)
354
         } else {
359
         } else {
355
           this.$Message.error(res.msg);
360
           this.$Message.error(res.msg);
356
         }
361
         }
357
       });
362
       });
358
     },
363
     },
359
     add() {
364
     add() {
365
+      this.$refs["AddForm"].resetFields();
360
       this.add_form.show = true;
366
       this.add_form.show = true;
361
       this.add_form.slorder = this.school.total + 1;
367
       this.add_form.slorder = this.school.total + 1;
362
     },
368
     },

+ 2
- 0
src/views/service/index.vue View File

243
                   class: "theme_color",
243
                   class: "theme_color",
244
                   on: {
244
                   on: {
245
                     click: () => {
245
                     click: () => {
246
+                      this.$refs["reForm"].resetFields();
246
                       this.revise_data = {
247
                       this.revise_data = {
247
                         show: true,
248
                         show: true,
248
                         data: params.row
249
                         data: params.row
356
       });
357
       });
357
     },
358
     },
358
     add() {
359
     add() {
360
+      this.$refs["AddForm"].resetFields();
359
       this.add_form.show = true;
361
       this.add_form.show = true;
360
       this.add_form.scorder = this.service.total + 1;
362
       this.add_form.scorder = this.service.total + 1;
361
     },
363
     },

+ 157
- 24
src/views/trial/index.vue View File

15
           v-model="form_search.account"
15
           v-model="form_search.account"
16
         />
16
         />
17
       </div>
17
       </div>
18
-      <Button @click="add" type="primary"> 添加 </Button>
18
+      <Button @click="add" type="primary">
19
+        {{ form_search.ltype == 1 ? "添加" : "修改" }}
20
+      </Button>
19
     </div>
21
     </div>
20
     <div>
22
     <div>
21
-      <Table border :data="userinfo.list" :columns="columns"> </Table>
23
+      <Table
24
+        v-if="form_search.ltype == 1"
25
+        border
26
+        :data="userinfo.list"
27
+        :columns="columns"
28
+      >
29
+      </Table>
30
+      <Table v-else border :data="userinfo.list" :columns="columns1"> </Table>
22
       <div class="foot_page" v-if="userinfo.total > 0">
31
       <div class="foot_page" v-if="userinfo.total > 0">
23
         <Page
32
         <Page
24
           :total="userinfo.total"
33
           :total="userinfo.total"
56
             placeholder="请输入电话"
65
             placeholder="请输入电话"
57
           />
66
           />
58
         </FormItem>
67
         </FormItem>
59
-        <FormItem label="邮箱">
68
+        <FormItem label="邮箱" prop="mailbox">
60
           <Input
69
           <Input
61
             v-model="add_form.mailbox"
70
             v-model="add_form.mailbox"
62
             maxlength="64"
71
             maxlength="64"
77
         <Button @click="toSaveAdd()" type="primary">保存</Button>
86
         <Button @click="toSaveAdd()" type="primary">保存</Button>
78
       </div>
87
       </div>
79
     </Modal>
88
     </Modal>
89
+    <!--    修改-->
90
+    <Modal
91
+      v-model="revise_form.show"
92
+      class="modal1"
93
+      :mask-closable="false"
94
+      title="修改负责人"
95
+    >
96
+      <Form
97
+        :label-width="90"
98
+        label-position="right"
99
+        ref="reForm"
100
+        :rules="addFormRules"
101
+        :model="revise_form"
102
+      >
103
+        <FormItem label="联系人" prop="account">
104
+          <Input
105
+            v-model="revise_form.account"
106
+            maxlength="32"
107
+            placeholder="请输入联系人"
108
+          />
109
+        </FormItem>
110
+        <FormItem label="电话" prop="phone">
111
+          <Input
112
+            v-model="revise_form.phone"
113
+            maxlength="16"
114
+            placeholder="请输入电话"
115
+          />
116
+        </FormItem>
117
+      </Form>
118
+      <div slot="footer" style="text-align: right">
119
+        <Button @click="revise_form.show = false">取消</Button>
120
+        <Button @click="toSavere()" type="primary">保存</Button>
121
+      </div>
122
+    </Modal>
80
     <!-- 等待窗 -->
123
     <!-- 等待窗 -->
81
     <Spin fix v-if="showLoading" style="background-color: transparent">
124
     <Spin fix v-if="showLoading" style="background-color: transparent">
82
       <Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
125
       <Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
87
 
130
 
88
 <script>
131
 <script>
89
 import axios from "axios";
132
 import axios from "axios";
90
-import {
91
-  sl_list,
92
-  sl_save,
93
-  sl_update,
94
-  sl_del,
95
-  fc_list,
96
-  fc_add
97
-} from "@/api/index";
133
+import { fcu_add, fc_list, fc_add, fcu_get_user } from "@/api/index";
98
 import { dateFormat } from "@/utils/index";
134
 import { dateFormat } from "@/utils/index";
99
 export default {
135
 export default {
100
   data() {
136
   data() {
102
     const phoneCheck = async (rule, value, callback) => {
138
     const phoneCheck = async (rule, value, callback) => {
103
       var filter = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
139
       var filter = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
104
       if (!value) {
140
       if (!value) {
105
-        return;
141
+        return callback(new Error("手机号码不能为空"));
106
       }
142
       }
107
       let blnTest = filter.test(value);
143
       let blnTest = filter.test(value);
108
       if (!blnTest) {
144
       if (!blnTest) {
109
         return callback(new Error("手机号码格式不正确"));
145
         return callback(new Error("手机号码格式不正确"));
110
       }
146
       }
111
     };
147
     };
148
+    // 邮箱验证
149
+    const mailboxCheck = async (rule, value, callback) => {
150
+      var filter =
151
+        /^[A-Za-z0-9\u4e00-\u9fa5]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
152
+      if (!value) {
153
+        return;
154
+      }
155
+      let blnTest = filter.test(value);
156
+      if (!blnTest) {
157
+        return callback(new Error("邮箱格式不正确"));
158
+      }
159
+    };
112
     return {
160
     return {
113
       userInfo: {},
161
       userInfo: {},
114
       showLoading: false,
162
       showLoading: false,
167
           align: "center"
215
           align: "center"
168
         }
216
         }
169
       ], //列表表格
217
       ], //列表表格
218
+      columns1: [
219
+        {
220
+          title: "序号",
221
+          align: "center",
222
+          key: "slorder",
223
+          width: 70,
224
+          render: (h, params) => {
225
+            return h(
226
+              "span",
227
+              params.index +
228
+                (this.form_search.page - 1) * this.form_search.size +
229
+                1
230
+            );
231
+          }
232
+        },
233
+        {
234
+          title: "联系人",
235
+          key: "account",
236
+          align: "center"
237
+        },
238
+        {
239
+          title: "联系电话",
240
+          key: "phone",
241
+          align: "center"
242
+        },
243
+        {
244
+          title: "提交时间",
245
+          key: "backtime",
246
+          align: "center"
247
+        }
248
+      ], //列表表格
170
       add_form: {
249
       add_form: {
171
-        show: true,
250
+        show: false,
172
         account: "",
251
         account: "",
173
         phone: "",
252
         phone: "",
174
         mailbox: "",
253
         mailbox: "",
175
         comm: ""
254
         comm: ""
176
       },
255
       },
256
+      revise_form: {
257
+        show: false,
258
+        account: "",
259
+        phone: ""
260
+      },
177
       addFormRules: {
261
       addFormRules: {
178
         account: [
262
         account: [
179
           {
263
           {
182
             trigger: "blur"
266
             trigger: "blur"
183
           }
267
           }
184
         ],
268
         ],
185
-        phone: [{ validator: phoneCheck, trigger: "blur" }]
269
+        phone: [{ validator: phoneCheck, required: true, trigger: "blur" }],
270
+        mailbox: [{ validator: mailboxCheck, trigger: "blur" }]
186
       }
271
       }
187
     };
272
     };
188
   },
273
   },
193
   methods: {
278
   methods: {
194
     seach() {
279
     seach() {
195
       this.form_search.page = 1;
280
       this.form_search.page = 1;
196
-      this.init();
281
+      //ltype 1申请试用/2申请试用负责人
282
+      if (this.form_search.ltype == 1) {
283
+        this.init();
284
+      } else {
285
+        this.getuser();
286
+      }
287
+    },
288
+    getuser() {
289
+      fcu_get_user().then((res) => {
290
+        if (res.code == 0) {
291
+          this.userinfo.list = [res.obj];
292
+          this.userinfo.list[0].backtime = dateFormat(
293
+            this.userinfo.list[0].createtime
294
+          );
295
+          this.userinfo.list[0].account = this.userinfo.list[0].username;
296
+          this.userinfo.total = Object.keys(res.obj).length;
297
+        } else {
298
+          this.$Message.error(res.msg);
299
+        }
300
+      });
197
     },
301
     },
198
     init() {
302
     init() {
199
       fc_list(this.form_search).then((res) => {
303
       fc_list(this.form_search).then((res) => {
203
             return v;
307
             return v;
204
           });
308
           });
205
           this.userinfo.total = res.obj.total;
309
           this.userinfo.total = res.obj.total;
206
-          console.log(res.obj);
207
         } else {
310
         } else {
208
           this.$Message.error(res.msg);
311
           this.$Message.error(res.msg);
209
         }
312
         }
210
       });
313
       });
211
     },
314
     },
212
     add() {
315
     add() {
213
-      this.add_form = {
214
-        show: true,
215
-        account: "",
216
-        phone: "",
217
-        mailbox: "",
218
-        comm: ""
219
-      };
220
-      console.log(this.add_form);
316
+      if (this.form_search.ltype == 1) {
317
+        this.$refs["AddForm"].resetFields();
318
+        this.add_form = {
319
+          show: true,
320
+          account: "",
321
+          phone: "",
322
+          mailbox: "",
323
+          comm: ""
324
+        };
325
+      } else {
326
+        this.$refs["reForm"].resetFields();
327
+        var data = JSON.parse(JSON.stringify(this.userinfo.list[0]));
328
+        this.revise_form = {
329
+          show: true,
330
+          account: data.account,
331
+          phone: data.phone
332
+        };
333
+      }
334
+    },
335
+    //修改负责人
336
+    toSavere() {
337
+      this.$refs["reForm"].validate((valid) => {
338
+        if (valid) {
339
+          fcu_add({
340
+            username: this.revise_form.account,
341
+            phone: this.revise_form.phone
342
+          }).then((res) => {
343
+            if (res.code == 0) {
344
+              this.revise_form.show = false;
345
+              this.$Message.success(res.msg);
346
+              this.getuser();
347
+            } else {
348
+              this.$Message.error(res.msg);
349
+            }
350
+          });
351
+        }
352
+      });
221
     },
353
     },
222
     //确定添加
354
     //确定添加
223
     toSaveAdd() {
355
     toSaveAdd() {
231
           }).then((res) => {
363
           }).then((res) => {
232
             if (res.code == 0) {
364
             if (res.code == 0) {
233
               this.add_form.show = false;
365
               this.add_form.show = false;
366
+              this.$Message.success(res.msg);
234
               this.init();
367
               this.init();
235
             } else {
368
             } else {
236
               this.$Message.error(res.msg);
369
               this.$Message.error(res.msg);

Loading…
Cancel
Save