瀏覽代碼

no message

linwenxin 5 月之前
父節點
當前提交
ea9dc520ec
共有 2 個文件被更改,包括 178 次插入12 次删除
  1. 3 1
      src/components/template/editTable.js
  2. 175 11
      src/views/setting/insuranceAdministration/mailboxConfig/index.vue

+ 3 - 1
src/components/template/editTable.js

@@ -34,7 +34,8 @@ export default {
         update: function () {},
         verify: function () {},
         btnSlot: function () {}
-      }
+      },
+      qianyu = ''
     ) {
       var newList = list.map(item => {
         if (item.editRender && item.viewRender) {
@@ -125,6 +126,7 @@ export default {
         <div>
           {setShowElement(attributes?.isAdd) ? (
             <div>
+              {qianyu}
               <el-button
                 size="mini"
                 type="primary"

+ 175 - 11
src/views/setting/insuranceAdministration/mailboxConfig/index.vue

@@ -17,7 +17,10 @@
 
 <script>
 import { insureEmailConfig, insureEmailDetail } from '@/api/InsuranceManagement.js'
+import editTable from '@/components/template/editTable.js'
+import { getDataDictionary } from '@/api/dataDictionary.js'
 export default {
+  mixins: [editTable],
   data() {
     return {
       formData: {
@@ -30,7 +33,8 @@ export default {
         sendMailbox: '',
         sendName: '',
         sendPassword: '',
-        sendTime: ''
+        sendTime: '',
+        mailboxReceives: []
       },
       formRules: {
         appToken: [{ required: true, message: '请输入', trigger: 'blur' }],
@@ -41,7 +45,8 @@ export default {
         sendMailbox: [{ required: true, message: '请输入', trigger: 'blur' }],
         sendPassword: [{ required: true, message: '请输入', trigger: 'blur' }],
         sendTime: [{ required: true, message: '请输入', trigger: 'blur' }]
-      }
+      },
+      INSURE_STEAD_UNIT: []
     }
   },
   computed: {
@@ -57,13 +62,163 @@ export default {
           name: 'el-input',
           md: 24,
           attributes: {},
-          formItemAttributes: { label: '接收邮箱,(工伤险专用),多邮箱以英文逗号隔开', prop: 'receiveMailbox' }
+          formItemAttributes: { label: '接收邮箱,(雇主险专用),多邮箱以英文逗号隔开', prop: 'employerMailbox' }
         },
         {
-          name: 'el-input',
+          name: 'slot-component',
           md: 24,
-          attributes: {},
-          formItemAttributes: { label: '接收邮箱,(雇主险专用),多邮箱以英文逗号隔开', prop: 'employerMailbox' }
+          formItemAttributes: {
+            label: '',
+            'label-width': '0px',
+            prop: 'mailboxReceives',
+            rules: []
+          },
+          render: (h, { props, onInput }) => {
+            var { value } = props
+            return this.convertTableJson(
+              value,
+              [
+                {
+                  columnAttributes: {
+                    label: '人力资源公司',
+                    prop: 'dictId',
+                    propName: 'dictName',
+                    width: 300
+                  },
+                  editRender: (h, { row, column, index }) => {
+                    return (
+                      <div class="redbordererr">
+                        <el-form-item
+                          label=""
+                          label-width="0px"
+                          prop={`mailboxReceives.${index}.${column.columnAttributes.prop}`}
+                          rules={[{ required: true, message: '请填写', trigger: 'blur' }]}
+                        >
+                          <el-select
+                            filterable={true}
+                            value={row[column.columnAttributes.prop]}
+                            onInput={val => {
+                              var data = this.INSURE_STEAD_UNIT.find(item => item.value === val)
+                              row[column.columnAttributes.prop] = val
+                              row[column.columnAttributes.propName] = data?.label || ''
+                            }}
+                            placeholder="请输入内容"
+                          >
+                            {this.INSURE_STEAD_UNIT.map((item, index_) => (
+                              <el-option key={index_} label={item.label} value={item.value}></el-option>
+                            ))}
+                          </el-select>
+                        </el-form-item>
+                      </div>
+                    )
+                  },
+                  viewRender: (h, { row, column, index }) => {
+                    return (
+                      <div class="redbordererr">
+                        <el-form-item
+                          label=""
+                          label-width="0px"
+                          prop={`mailboxReceives.${index}.${column.columnAttributes.prop}`}
+                          rules={[{ required: true, message: '请填写', trigger: 'blur' }]}
+                        >
+                          <el-select
+                            filterable={true}
+                            value={row[column.columnAttributes.prop]}
+                            onInput={val => {
+                              var data = this.INSURE_STEAD_UNIT.find(item => item.value === val)
+                              row[column.columnAttributes.prop] = val
+                              row[column.columnAttributes.propName] = data?.label || ''
+                            }}
+                            placeholder="请输入内容"
+                          >
+                            {this.INSURE_STEAD_UNIT.map((item, index_) => (
+                              <el-option key={index_} label={item.label} value={item.value}></el-option>
+                            ))}
+                          </el-select>
+                        </el-form-item>
+                      </div>
+                    )
+                  }
+                },
+                {
+                  columnAttributes: {
+                    label: '接收邮箱',
+                    prop: 'receiveMailbox'
+                  },
+                  editRender: (h, { row, column, index }) => {
+                    return (
+                      <div class="redbordererr">
+                        <el-form-item
+                          label=""
+                          label-width="0px"
+                          prop={`mailboxReceives.${index}.${column.columnAttributes.prop}`}
+                          rules={[{ required: true, message: '请填写', trigger: 'blur' }]}
+                        >
+                          <el-input
+                            value={row[column.columnAttributes.prop]}
+                            onInput={val => {
+                              row[column.columnAttributes.prop] = val
+                            }}
+                            placeholder="请输入内容"
+                          ></el-input>
+                        </el-form-item>
+                      </div>
+                    )
+                  },
+                  viewRender: (h, { row, column, index }) => {
+                    return (
+                      <div class="redbordererr">
+                        <el-form-item
+                          label=""
+                          label-width="0px"
+                          prop={`mailboxReceives.${index}.${column.columnAttributes.prop}`}
+                          rules={[{ required: true, message: '请填写', trigger: 'blur' }]}
+                        >
+                          <el-input
+                            value={row[column.columnAttributes.prop]}
+                            onInput={val => {
+                              row[column.columnAttributes.prop] = val
+                            }}
+                            placeholder="请输入内容"
+                          ></el-input>
+                        </el-form-item>
+                      </div>
+                    )
+                  }
+                }
+              ],
+              {
+                isEdit: true,
+                isAdd: true,
+                isDel: true,
+                isUpdate: false,
+                isConfirm: false
+              },
+              {
+                add: () => {
+                  this.formData.mailboxReceives.push({
+                    dictId: '',
+                    dictName: '',
+                    id: '',
+                    mailboxId: '',
+                    receiveMailbox: ''
+                  })
+                  this.isEditTableIndex = this.formData.mailboxReceives.length - 1
+                },
+                delete: ({ row, column, index }, cb) => {
+                  if (this.isEditTableIndex == index) {
+                    this.isEditTableIndex = -1
+                  } else if (this.isEditTableIndex > index) {
+                    this.isEditTableIndex--
+                  }
+                  cb && cb()
+                }
+              },
+              <span style="margin-right:10px;font-weight: 700;line-height: 28px;float: none;display: inline-block;text-align: left;padding: 0 0 10px;vertical-align: middle;font-size: 14px;color: #606266;box-sizing: border-box;">
+                接收邮箱,(工伤险专用),多邮箱以英文逗号隔开
+              </span>
+            )
+          }
         },
         {
           name: 'el-time-picker',
@@ -114,11 +269,20 @@ export default {
   created() {
     // 获取详情
     insureEmailDetail().then(res => {
-      for (var key in res.data) {
-        if (key !== 'id') {
-          this.formData[key] = res.data[key] || ''
-        }
-      }
+      this.formData = { ...res.data, mailboxReceives: res?.data?.mailboxReceives || [] }
+    })
+    getDataDictionary({
+      pageNum: 1,
+      pageSize: -1,
+      params: [
+        { param: 'a.status', compare: '=', value: 'ON' },
+        { param: 'a.dict_type', compare: '=', value: 'INSURE_STEAD_UNIT' }
+      ]
+    }).then(res => {
+      this.INSURE_STEAD_UNIT = res.data.records.map(item => ({
+        value: item.dictCode,
+        label: item.dictValue
+      }))
     })
   },
   methods: {