Browse Source

no message

linwenxin 7 tháng trước cách đây
mục cha
commit
7f6fd57543

+ 9 - 1
src/api/workerProfileInit.js

@@ -26,5 +26,13 @@ export function del(params) {
 }
 
 export function listImport(data) {
-	return handleImport('/member/list/wait2/import', data.formdata, data.id || '')
+  return handleImport('/member/list/wait2/import', data.formdata, data.id || '')
+}
+
+export function memberUserWatitUpdate(data) {
+  return request({
+    url: `/member/userWatit/update`,
+    method: 'post',
+    data
+  })
 }

+ 103 - 15
src/views/userManagement/workerProfileInit/index.vue

@@ -4,12 +4,26 @@
     :get-list="getList"
     :table-attributes="tableAttributes"
     :table-events="tableEvents"
-    :operationColumnWidth="50"
     :options-evens-group="optionsEvensGroup"
     :moreParameters="moreParameters"
     :column-parsing="columnParsing"
     :operation="operation()"
   >
+    <div class="cartographer_big">
+      <el-dialog title="修改师傅数据" width="100%" :modal="false" :visible.sync="formDialog" :before-close="formCancel">
+        <zj-page-container>
+          <zj-page-fill class="neibuview">
+            <zj-form-container ref="formRef" :form-data="formData" :form-attributes="{ size: 'mini' }">
+              <zj-form-module title="基本信息" label-width="100px" :form-data="formData" :form-items="formItems" />
+            </zj-form-container>
+          </zj-page-fill>
+          <div style="box-sizing: border-box; padding: 16px">
+            <el-button @click="formCancel" size="mini">取消</el-button>
+            <el-button @click="formConfirm" type="primary" size="mini">确定</el-button>
+          </div>
+        </zj-page-container>
+      </el-dialog>
+    </div>
   </template-page>
 </template>
 
@@ -19,7 +33,7 @@ import import_mixin from '@/components/template/import_mixin.js'
 import ImageUpload from '@/components/file-upload'
 import { downloadFiles } from '@/utils/util'
 import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
-import { listPageV2, pageExport, del, listImport } from '@/api/workerProfileInit'
+import { listPageV2, pageExport, del, listImport, memberUserWatitUpdate } from '@/api/workerProfileInit'
 import { commonTemplateDownload } from '@/api/common.js'
 import operation_mixin from '@/components/template/operation_mixin.js'
 export default {
@@ -39,8 +53,6 @@ export default {
       // 勾选选中行
       recordSelected: [],
       /** 表单变量 */
-      formDialogType: 0,
-      formDialogTitles: ['新增', '编辑', '详情'],
       formDialog: false,
       formData: {}
     }
@@ -71,7 +83,70 @@ export default {
     moreParameters() {
       return []
     },
-    formItems() {}
+    formItems() {
+      return [
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '名称',
+            prop: 'name',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '编号',
+            prop: 'workerNumber',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '身份证',
+            prop: 'idcard',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '手机号',
+            prop: 'mobile',
+            rules: [...required]
+          }
+        },
+        {
+          name: 'el-input',
+          md: 6,
+          attributes: {
+            placeholder: '请输入'
+          },
+          formItemAttributes: {
+            label: '银行卡号',
+            prop: 'bankAccount',
+            rules: []
+          }
+        }
+      ]
+    }
   },
   methods: {
     // 列表请求函数
@@ -98,7 +173,6 @@ export default {
     operation() {
       return this.operationBtn({
         del: {
-          btnType: 'text',
           prompt: '确定删除吗?',
           click: ({ row, index, column }) => {
             del({
@@ -112,26 +186,30 @@ export default {
               }
             })
           }
+        },
+        edit: {
+          click: ({ row, index, column }) => {
+            this.formData = { ...row }
+            this.$nextTick(() => {
+              this.openForm()
+            })
+          }
         }
       })
     },
-    addData() {
-      this.formDialogType = 0
-      this.openForm()
-    },
     openForm() {
       this.formDialog = true
     },
     formCancel() {
-      this.$refs.formRef.$refs.inlineForm.clearValidate()
+      this.$refs?.formRef?.$refs?.inlineForm?.clearValidate?.()
       this.$data.formData = this.$options.data().formData
       this.formDialog = false
     },
     formConfirm() {
       this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
         if (valid) {
-          ;[add, edit][this.formDialogType](this.formData).then(res => {
-            this.$message({ type: 'success', message: `${this.formDialogTitles[this.formDialogType]}成功!` })
+          memberUserWatitUpdate(this.formData).then(res => {
+            this.$message({ type: 'success', message: `编辑成功!` })
             this.formCancel()
             this.$refs.pageRef.refreshList()
           })
@@ -155,7 +233,17 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.tab {
-  padding: 20px 20px 0 20px;
+.neibuview {
+  box-sizing: border-box;
+  padding-left: 16px;
+
+  ::v-deep & > .zj-page-fill-scroll {
+    box-sizing: border-box;
+    padding-right: 16px;
+
+    & > div:nth-child(1) {
+      margin-top: 20px;
+    }
+  }
 }
 </style>