Parcourir la source

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

lucw il y a 6 mois
Parent
commit
f881d7992e

+ 15 - 0
src/api/system/file/index.js

@@ -182,6 +182,21 @@ export async function importBatch(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+/**
+ * 导入文件 批量
+ * @param file 文件
+ */
+export async function importBatchNew(data) {
+  const formData = new FormData();
+  data.multiPartFiles.forEach((item, index) => {
+    formData.append(`multiPartFiles`, item);
+  });
+  const res = await request.post(data.apiUrl, formData);
+  if (res.data.code === '0') {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 
 // 通用上传接口
 export async function commUpload(data) {

+ 5 - 3
src/components/upload/import-dialogNew.vue

@@ -49,7 +49,7 @@
 </template>
 
 <script>
-  import { importBatch } from '@/api/system/file/index.js';
+  import { importBatch,importBatchNew } from '@/api/system/file/index.js';
   // import { download1 } from '@/utils/file';
   import { downLoadTemplateNew } from '@/api/system/file/index.js';
   export default {
@@ -104,9 +104,11 @@
         }
         this.module = this.$props.defModule;
         this.uploading = true;
-        await importBatch({
+        let api=this.apiUrl?importBatchNew: importBatch
+        await api({
           module: this.module,
-          multiPartFiles: this.attaments
+          multiPartFiles: this.attaments,
+          apiUrl:this.apiUrl
         }).finally(() => {
           this.uploading = false;
         });

+ 174 - 166
src/views/enterpriseModel/dept/components/staffSelection.vue

@@ -136,153 +136,188 @@
   </div>
 </template>
 <script>
-import { listOrganizations, getUserPage } from '@/api/system/organization';
-export default {
-  data() {
-    return {
-      form: {
-        groupId: null
+  import { listOrganizations, getUserPage } from '@/api/system/organization';
+  export default {
+    data() {
+      return {
+        form: {
+          groupId: null
+        },
+        treeList: [],
+        staffList: [],
+        selectStafflist: [], //已选员工
+        defaultProps: {
+          children: 'children',
+          label: 'name',
+          value: 'code'
+        },
+        pageNum: 1, //设备当前页数
+        size: 10,
+        isMore: false,
+        dialogVisible: false
+      };
+    },
+    created() {},
+    methods: {
+      open(selectedList) {
+        this.dialogVisible = true;
+        // this.selectStafflist = selectedList;
+        this.selectStafflist = selectedList.map((item) => {
+          item.name = item.name ? item.name : item.recipientName;
+          item.id = item.id ? item.id : item.recipientId;
+
+          return item;
+        });
+
+        console.log(this.selectStafflist, 'this.selectStafflist');
+        this.getInfo();
       },
-      treeList: [],
-      staffList: [],
-      selectStafflist: [], //已选员工
-      defaultProps: {
-        children: 'children',
-        label: 'name',
-        value: 'code'
+      //初始数据
+      async getInfo() {
+        let list = await listOrganizations();
+        this.treeList = this.$util.toTreeData({
+          data: list,
+          idField: 'id',
+          parentIdField: 'parentId'
+        });
+        //this.treeList = res.data;
       },
-      pageNum: 1, //设备当前页数
-      size: 10,
-      isMore: false,
-      dialogVisible: false
-    };
-  },
-  created() {},
-  methods: {
-    open(selectedList) {
-      this.dialogVisible = true;
-      this.selectStafflist = selectedList;
-      this.getInfo();
-    },
-    //初始数据
-    async getInfo() {
-      let list = await listOrganizations();
-      this.treeList = this.$util.toTreeData({
-        data: list,
-        idField: 'id',
-        parentIdField: 'parentId'
-      });
-      //this.treeList = res.data;
-    },
-    //选择分类
-    handleNodeClick(data) {
-      this.staffList = [];
+      //选择分类
+      handleNodeClick(data) {
+        this.staffList = [];
 
-      this.form.groupId = data.id;
-      let params = {
-        pageNum: 1,
-        size: this.size,
-        groupId: this.form.groupId
-      };
-      this.getStaffList(params);
-    },
-    //获取员工列表
-    async getStaffList(params) {
-      let res = await getUserPage(params);
-      let list = res.list;
-      if (list.length < res.count) {
-        this.isMore = true;
-      } else {
-        this.isMore = false;
-      }
-      list.forEach((el) => {
-        let _index = this.selectStafflist.findIndex((n) => n.id == el.id);
-        if (_index !== -1) {
-          el.disabled = true;
+        this.form.groupId = data.id;
+        let params = {
+          pageNum: 1,
+          size: this.size,
+          groupId: this.form.groupId
+        };
+        this.getStaffList(params);
+      },
+      //获取员工列表
+      async getStaffList(params) {
+        let res = await getUserPage(params);
+        let list = res.list;
+        if (list.length < res.count) {
+          this.isMore = true;
         } else {
-          el.disabled = false;
-        }
-      });
-      this.staffList = [...this.staffList, ...list];
-      // this.pageNum = res.pageNum;
-    },
-    //查询更多员工
-    async getMore() {
-      this.pageNum = this.pageNum + 1;
-      let params = {
-        pageNum: this.pageNum,
-        size: this.size,
-        groupId: this.form.groupId
-      };
-      this.getStaffList(params);
-    },
-    //选择员工
-    choiceAsset(info) {
-      let data = JSON.parse(JSON.stringify(info));
-      this.selectStafflist.push(data);
-      info.disabled = true;
-    },
-    //删除已选员工
-    deleteSelectStaff(info, index) {
-      this.staffList.forEach((el) => {
-        if (el.id == info.id) {
-          el.disabled = false;
+          this.isMore = false;
         }
-      });
-      this.selectStafflist.splice(index, 1);
-    },
-    //保存
-    sumbit() {
-      this.selectStafflist = this.selectStafflist || [];
-      this.$emit('confirm', JSON.parse(JSON.stringify(this.selectStafflist)));
-      this.handleClose();
-    },
-    handleClose() {
-      this.staffList = [];
-      this.selectStafflist = [];
-      this.dialogVisible = false;
+        list.forEach((el) => {
+          let _index = this.selectStafflist.findIndex((n) => n.id == el.id);
+          if (_index !== -1) {
+            el.disabled = true;
+          } else {
+            el.disabled = false;
+          }
+        });
+        this.staffList = [...this.staffList, ...list];
+        // this.pageNum = res.pageNum;
+      },
+      //查询更多员工
+      async getMore() {
+        this.pageNum = this.pageNum + 1;
+        let params = {
+          pageNum: this.pageNum,
+          size: this.size,
+          groupId: this.form.groupId
+        };
+        this.getStaffList(params);
+      },
+      //选择员工
+      choiceAsset(info) {
+        let data = JSON.parse(JSON.stringify(info));
+        this.selectStafflist.push(data);
+        info.disabled = true;
+      },
+      //删除已选员工
+      deleteSelectStaff(info, index) {
+        this.staffList.forEach((el) => {
+          if (el.id == info.id) {
+            el.disabled = false;
+          }
+        });
+        this.selectStafflist.splice(index, 1);
+      },
+      //保存
+      sumbit() {
+        this.selectStafflist = this.selectStafflist || [];
+        this.$emit('confirm', JSON.parse(JSON.stringify(this.selectStafflist)));
+        this.handleClose();
+      },
+      handleClose() {
+        this.staffList = [];
+        this.selectStafflist = [];
+        this.dialogVisible = false;
+      }
     }
-  }
-};
+  };
 </script>
 
 <style lang="scss" scoped>
-.container {
-  padding: 10px 0;
-}
-.zw-container {
-  height: 500px;
-  overflow-y: auto;
-}
-.zw-header-title {
-  display: inline-block;
-  margin-right: 10px;
-  font-weight: 600;
-}
-.details-title {
-  line-height: 32px;
-  height: 32px;
-}
-.zw-page-list-p {
-  font-size: 14px;
-  margin-bottom: 18px;
-  display: flex;
-  justify-content: space-between;
-  // align-items: center;
-  .zw-page-list-right {
-    display: flex;
+  .container {
+    padding: 10px 0;
+  }
+  .zw-container {
+    height: 500px;
+    overflow-y: auto;
+  }
+  .zw-header-title {
+    display: inline-block;
+    margin-right: 10px;
+    font-weight: 600;
   }
-}
-.zw-page {
-  background: #fff;
-  //padding: 20px 0;
-  height: 600px;
-  .zw-page-left {
-    padding: 0 10px;
+  .details-title {
+    line-height: 32px;
+    height: 32px;
+  }
+  .zw-page-list-p {
+    font-size: 14px;
+    margin-bottom: 18px;
+    display: flex;
+    justify-content: space-between;
+    // align-items: center;
+    .zw-page-list-right {
+      display: flex;
+    }
   }
-  .zw-page-main {
-    padding: 0 10px;
-    .zw-page-main-list {
+  .zw-page {
+    background: #fff;
+    //padding: 20px 0;
+    height: 600px;
+    .zw-page-left {
+      padding: 0 10px;
+    }
+    .zw-page-main {
+      padding: 0 10px;
+      .zw-page-main-list {
+        span {
+          margin-right: 10px;
+        }
+        .zw-page-span-num {
+          font-size: 12px;
+          color: #157a2c;
+        }
+        .zw-page-p-operation {
+          text-align: right;
+          // width: 200px;
+        }
+        .zw-page-operation-num {
+          width: 100px;
+          margin: 0 10px;
+        }
+      }
+      .zw-page-list-more {
+        text-align: center;
+      }
+    }
+    .zw-page-right {
+      .zw-card-header {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        height: 32px;
+      }
       span {
         margin-right: 10px;
       }
@@ -290,37 +325,10 @@ export default {
         font-size: 12px;
         color: #157a2c;
       }
-      .zw-page-p-operation {
-        text-align: right;
-        // width: 200px;
-      }
-      .zw-page-operation-num {
-        width: 100px;
-        margin: 0 10px;
-      }
-    }
-    .zw-page-list-more {
-      text-align: center;
     }
   }
-  .zw-page-right {
-    .zw-card-header {
-      display: flex;
-      justify-content: space-between;
-      align-items: center;
-      height: 32px;
-    }
-    span {
-      margin-right: 10px;
-    }
-    .zw-page-span-num {
-      font-size: 12px;
-      color: #157a2c;
-    }
+  .notes {
+    font-size: 12px;
+    color: #909090;
   }
-}
-.notes {
-  font-size: 12px;
-  color: #909090;
-}
 </style>

+ 0 - 1
src/views/factoryModel/jobManagement/index.vue

@@ -291,7 +291,6 @@
           });
       },
       importProfession() {
-        debugger;
         this.$refs.importDialogRef.open();
       },
       exportJobs() {},

+ 7 - 5
src/views/factoryModel/station/components/edit.vue

@@ -590,13 +590,15 @@
       chooseAsset() {
         this.$refs.productRefs.open(this.form.extInfo, '选择设备', '4');
       },
-      userListFn(e) {
+      userListFn(e, init) {
         console.log(e);
         let that = this;
         listUserByIds([e]).then((res) => {
           that.userList = res;
         });
-        that.form.extInfo.userIds = [];
+        if (!init) {
+          that.form.extInfo.userIds = [];
+        }
       },
 
       // 选择可执行工序
@@ -618,8 +620,8 @@
 
       determineChoose(title, row) {
         const equipmentLabel = row.equipmentLabelJson[0];
-        this.form.extInfo.criticalEquipment = equipmentLabel.GJSB;
-        this.form.extInfo.keyEquipment = equipmentLabel.GZSB;
+        this.form.extInfo.criticalEquipment = equipmentLabel?.GJSB;
+        this.form.extInfo.keyEquipment = equipmentLabel?.GZSB;
 
         if (title == '选择设备') {
           this.form.extInfo.assetCode = row.code;
@@ -904,7 +906,7 @@
             this.form?.extInfo?.teamId &&
             typeof this.form?.extInfo?.teamId === 'string'
           ) {
-            this.userListFn(this.form.extInfo.teamId);
+            this.userListFn(this.form.extInfo.teamId, 'init');
           }
           if (res.taskList?.length) {
             this.form.taskNames = res.taskList.map((i) => i.name);

+ 23 - 0
src/views/factoryModel/station/index.vue

@@ -28,6 +28,16 @@
           >
             添加
           </el-button>
+          <el-button
+            size="small"
+            type="primary"
+            icon="el-icon-download"
+            class="ele-btn-icon"
+            @click="importProfession"
+            v-if="$hasPermission('main:factoryworkstation:saveOrUpdate')"
+          >
+            导入
+          </el-button>
         </template>
         <!-- <template v-slot:workshop="{ row }">
         {{ showWorkshop(row) }}
@@ -77,6 +87,13 @@
       </ele-pro-table>
     </el-card>
     <edit ref="edit" @done="done"></edit>
+    <importDialog
+      ref="importDialogRef"
+      :apiUrl="'/main/factoryworkstation/importBatch'"
+      :fileUrl="'/main/factoryworkstation/downLoadTemplate'"
+      fileName="工位导入模板"
+      @success="done"
+    />
   </div>
 </template>
 <script>
@@ -89,10 +106,13 @@
     getFactoryarea
   } from '@/api/factoryModel';
   import { listOrganizations } from '@/api/system/organization';
+  import importDialog from '@/components/upload/import-dialogNew.vue';
+
   export default {
     mixins: [tabMixins],
     components: {
       search,
+      importDialog,
       edit
     },
     data() {
@@ -247,6 +267,9 @@
           this.dict.factory = res.list;
         });
       },
+      importProfession() {
+        this.$refs.importDialogRef.open();
+      },
       remove(row) {
         deleteFactoryworkstation(row.id)
           .then((message) => {

+ 7 - 1
src/views/material/product/detail.vue

@@ -450,6 +450,11 @@
               </el-radio-group>
             </el-form-item>
           </el-col>
+          <el-col :span="8">
+            <el-form-item label="物联产品Key">
+              <el-input v-model="form.iotProductKey" />
+            </el-form-item>
+          </el-col>
         </el-row>
       </el-form>
     </el-card>
@@ -681,6 +686,7 @@
         isUpdate: 0,
         form: {
           categoryLevelGroupName: '',
+          iotProductKey: '',
           componentAttribute: [],
           categoryLevelName: '',
           isConsumable: 0,
@@ -1045,7 +1051,7 @@
               'netWeight',
               parseFloat((volume * 7.85) / 1000).toFixed(4)
             );
-          }else{
+          } else {
             this.$set(this.form, 'netWeight', 0);
           }
 

+ 141 - 117
src/views/notifyManage/templateManage/components/addOrEditDialog.vue

@@ -12,7 +12,7 @@
       <el-form-item label="模板编码:" prop="code">
         <el-input
           clearable
-          :disabled="dialogType=='view'"
+          :disabled="dialogType == 'view'"
           v-model="formData.code"
           placeholder="请输入"
         />
@@ -20,7 +20,7 @@
       <el-form-item label="模板名称:" prop="name">
         <el-input
           clearable
-          :disabled="dialogType=='view'"
+          :disabled="dialogType == 'view'"
           v-model="formData.name"
           placeholder="请输入"
         />
@@ -28,14 +28,14 @@
       <el-form-item label="默认发送人:" prop="nickname">
         <el-input
           clearable
-          :disabled="dialogType=='view'"
+          :disabled="dialogType == 'view'"
           v-model.number="formData.nickname"
           placeholder="请输入排序"
         />
       </el-form-item>
       <el-form-item label="接收人类型:" prop="recipientType">
         <el-select
-          :disabled="dialogType=='view'"
+          :disabled="dialogType == 'view'"
           v-model="formData.recipientType"
           placeholder="请选择接收人类型"
           @change="handleRecipientTypeChange"
@@ -48,12 +48,19 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item v-if="formData.recipientType != 0" label="接收人:" prop="recipient">
-        <role-select v-if="formData.recipientType == 2" v-model="formData.recipient" />
+      <el-form-item
+        v-if="formData.recipientType != 0"
+        label="接收人:"
+        prop="recipient"
+      >
+        <role-select
+          v-if="formData.recipientType == 2"
+          v-model="formData.recipient"
+        />
         <el-input
           v-if="formData.recipientType == 1"
           clearable
-          :disabled="dialogType=='view'"
+          :disabled="dialogType == 'view'"
           v-model="formData.recipientName"
           placeholder="请选择"
           @click.native="handleRecipientClick"
@@ -63,30 +70,40 @@
         <el-input
           clearable
           type="textarea"
-          :disabled="dialogType=='view'"
+          :disabled="dialogType == 'view'"
           v-model="formData.content"
           placeholder="请输入"
         />
       </el-form-item>
       <el-form-item label="状态:" prop="status">
-        <el-radio :disabled="dialogType=='view'" v-model="formData.status" :label="1">启用</el-radio>
-        <el-radio :disabled="dialogType=='view'" v-model="formData.status" :label="0">禁用</el-radio>
+        <el-radio
+          :disabled="dialogType == 'view'"
+          v-model="formData.status"
+          :label="1"
+          >启用</el-radio
+        >
+        <el-radio
+          :disabled="dialogType == 'view'"
+          v-model="formData.status"
+          :label="0"
+          >禁用</el-radio
+        >
       </el-form-item>
 
       <el-form-item label="备注:" prop="remark">
         <el-input
           clearable
           type="textarea"
-          :disabled="dialogType=='view'"
+          :disabled="dialogType == 'view'"
           v-model="formData.remark"
           placeholder="请输入"
         />
       </el-form-item>
-
-
     </el-form>
     <template v-slot:footer>
-      <el-button type="primary" :loading="loading" @click="save">确认</el-button>
+      <el-button type="primary" :loading="loading" @click="save"
+        >确认</el-button
+      >
       <el-button @click="closeDialog">返回</el-button>
     </template>
     <staffSelection
@@ -97,61 +114,62 @@
 </template>
 
 <script>
-import dictMixins from '@/mixins/dictMixins';
-import {notifyTemplateGetByIdAPI, notifyTemplateSaveAPI, notifyTemplateUpdateAPI} from "@/api/notifyManage";
-import RoleSelect from '@/views/system/user/components/role-select.vue';
-import staffSelection from '@/views/enterpriseModel/dept/components/staffSelection.vue';
-export default {
-  name: 'addOrEditDialog',
-  props: {
-    addOrEditDialogFlag: [Boolean],
-  },
-  components: {
-    RoleSelect,
-    staffSelection
-  },
-  mixins: [dictMixins],
-  data() {
-
-    return {
-      recipientTypeOptions: [
-        {
-          value: 0,
-          label: '业务自定义'
-        },
-        {
-          value: 1,
-          label: '指定人'
-        },
-        {
-          value: 2,
-          label: '指定角色'
+  import dictMixins from '@/mixins/dictMixins';
+  import {
+    notifyTemplateGetByIdAPI,
+    notifyTemplateSaveAPI,
+    notifyTemplateUpdateAPI
+  } from '@/api/notifyManage';
+  import RoleSelect from '@/views/system/user/components/role-select.vue';
+  import staffSelection from '@/views/enterpriseModel/dept/components/staffSelection.vue';
+  export default {
+    name: 'addOrEditDialog',
+    props: {
+      addOrEditDialogFlag: [Boolean]
+    },
+    components: {
+      RoleSelect,
+      staffSelection
+    },
+    mixins: [dictMixins],
+    data() {
+      return {
+        recipientTypeOptions: [
+          {
+            value: 0,
+            label: '业务自定义'
+          },
+          {
+            value: 1,
+            label: '指定人'
+          },
+          {
+            value: 2,
+            label: '指定角色'
+          }
+        ],
+        users: [],
+        // 表单数据
+        formData: {
+          code: '',
+          name: '',
+          nickname: '',
+          content: '',
+          status: 1,
+          remark: '',
+          recipientType: 0,
+          recipient: [],
+          recipientName: ''
         },
-      ],
-      users: [],
-      // 表单数据
-      formData: {
-        code: '',
-        name: '',
-        nickname: '',
-        content: '',
-        status: 1,
-        remark: '',
-        recipientType: 0,
-        recipient: [],
-        recipientName: ''
-      },
-      title: null,
-
+        title: null,
 
-      
-      dialogType: '',
-      // 提交状态
-      loading: false,
-    };
-  },
-  computed: {
-    // 表单验证规则
+        dialogType: '',
+        // 提交状态
+        loading: false
+      };
+    },
+    computed: {
+      // 表单验证规则
       rules() {
         return {
           name: [
@@ -202,68 +220,74 @@ export default {
               message: '请选择接收人',
               trigger: 'change'
             }
-          ],
-        }
+          ]
+        };
       }
-  },
-  created() {
-  },
-  methods: {
-    handleRecipientTypeChange() {
-      this.formData.recipient = [];
-      this.formData.recipientName = '';
     },
-    handleRecipientClick() {
-      this.$refs.staffSelection.open(
+    created() {},
+    methods: {
+      handleRecipientTypeChange() {
+        this.formData.recipient = [];
+        this.formData.recipientName = '';
+      },
+      handleRecipientClick() {
+        console.log(this.formData.recipient, 'this.formData.recipient');
+        this.$refs.staffSelection.open(
           JSON.parse(JSON.stringify(this.formData.recipient))
         );
-    },
-    
-    confirmStaffSelection(data) {
-      console.log(data);
-        this.formData.recipient = data.map(item => {
+      },
+
+      confirmStaffSelection(data) {
+        console.log(data);
+        this.formData.recipient = data.map((item) => {
           return {
             ...item,
             recipientId: item.id,
             recipientName: item.name,
             type: this.formData.recipientType
-          }
+          };
         });
-        this.formData.recipientName = data.map(item => item.name).join(',');
+        this.formData.recipientName = data.map((item) => item.name).join(',');
       },
-    init(type, row = {}) {
-      this.title = type == 'add' ? '新增' : '修改'
-      this.dialogType = type
-      if (type !== 'add') {
-        this.getNotifyTemplateInfo(row)
-      }
-    },
-    async getNotifyTemplateInfo(row) {
-      this.formData = await notifyTemplateGetByIdAPI(row.id)
-    },
-    /* 保存编辑 */
-    save() {
-      this.$refs.formRef.validate(async (valid) => {
-        if (!valid) return this.$message.warning('有必填项未填写,请检查');
-        this.loading = true;
-
-        const params = {...this.formData};
-        const API = this.dialogType == 'add' ? notifyTemplateSaveAPI : notifyTemplateUpdateAPI
-        try {
-          await API(params)
-          this.$message.success('操作成功')
-          this.$emit('done')
-          this.closeDialog()
-        } catch (e) {
-          this.loading = false;
+      init(type, row = {}) {
+        this.title = type == 'add' ? '新增' : '修改';
+        this.dialogType = type;
+        if (type !== 'add') {
+          this.getNotifyTemplateInfo(row);
         }
+      },
+      async getNotifyTemplateInfo(row) {
+        this.formData = await notifyTemplateGetByIdAPI(row.id);
 
-      });
-    },
-    /* 关闭弹窗 */
-    closeDialog() {
-      this.$emit('update:addOrEditDialogFlag', false)
+        this.formData.recipientName = this.formData.recipient
+          .map((item) => item.recipientName)
+          .join(',');
+      },
+      /* 保存编辑 */
+      save() {
+        this.$refs.formRef.validate(async (valid) => {
+          if (!valid) return this.$message.warning('有必填项未填写,请检查');
+          this.loading = true;
+
+          const params = { ...this.formData };
+          const API =
+            this.dialogType == 'add'
+              ? notifyTemplateSaveAPI
+              : notifyTemplateUpdateAPI;
+          try {
+            await API(params);
+            this.$message.success('操作成功');
+            this.$emit('done');
+            this.closeDialog();
+          } catch (e) {
+            this.loading = false;
+          }
+        });
+      },
+      /* 关闭弹窗 */
+      closeDialog() {
+        this.$emit('update:addOrEditDialogFlag', false);
+      }
     }
-  },
-};
+  };
 </script>

+ 174 - 138
src/views/notifyManage/templateManage/index.vue

@@ -2,8 +2,13 @@
   <div class="ele-body">
     <el-card shadow="never">
       <!-- 条件区 -->
-      <search @search="reload"/>
-      <ele-pro-table ref="table" :columns="columns" :datasource="datasource" :pageSize="this.$store.state.tablePageSize">
+      <search @search="reload" />
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        :pageSize="this.$store.state.tablePageSize"
+      >
         <template v-slot:toolbar>
           <el-button
             size="small"
@@ -11,177 +16,208 @@
             icon="el-icon-plus"
             class="ele-btn-icon"
             v-if="$hasPermission('sys:notifytemplate:save')"
-
-            @click="handleAddOrEdit('add','')">
+            @click="handleAddOrEdit('add', '')"
+          >
             新建
           </el-button>
         </template>
+
+        <template v-slot:recipientType="{ row }">
+          <el-tag size="mini" v-if="row.recipientType == 0">业务自定义</el-tag>
+          <el-tag size="mini" v-if="row.recipientType == 1">指定人</el-tag>
+          <el-tag size="mini" v-if="row.recipientType == 2">指定角色</el-tag>
+        </template>
+
+        <template v-slot:recipient="{ row }">
+          <span v-for="it of row.recipient">
+            <el-tag size="mini">{{ it.recipientName }}</el-tag>
+          </span>
+        </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
-
           <el-link
             type="primary"
             :underline="false"
             icon="el-icon-edit"
             v-if="$hasPermission('sys:notifytemplate:update')"
-
-            @click="handleAddOrEdit('update',row)">
+            @click="handleAddOrEdit('update', row)"
+          >
             编辑
           </el-link>
           <el-popconfirm
             class="ele-action"
             title="确定要删除此数据吗?"
             v-if="$hasPermission('sys:notifytemplate:delete')"
-            @confirm="deleteCategory(row)">
+            @confirm="deleteCategory(row)"
+          >
             <template v-slot:reference>
-              <el-link type="danger" :underline="false" icon="el-icon-delete">删除</el-link>
+              <el-link type="danger" :underline="false" icon="el-icon-delete"
+                >删除</el-link
+              >
             </template>
           </el-popconfirm>
         </template>
-        <template v-slot:status="{row}">
+        <template v-slot:status="{ row }">
           <el-tag v-if="row.status" type="success">{{ '启用' }}</el-tag>
           <el-tag v-else type="danger">{{ '禁用' }}</el-tag>
-
         </template>
       </ele-pro-table>
     </el-card>
     <!--新增、修改-->
-    <add-or-edit-dialog v-if="addOrEditDialogFlag" :addOrEditDialogFlag.sync="addOrEditDialogFlag"
-                        ref="addOrEditDialogRef" @done="reload"></add-or-edit-dialog>
+    <add-or-edit-dialog
+      v-if="addOrEditDialogFlag"
+      :addOrEditDialogFlag.sync="addOrEditDialogFlag"
+      ref="addOrEditDialogRef"
+      @done="reload"
+    ></add-or-edit-dialog>
   </div>
 </template>
 <script>
+  import search from './index-search.vue';
+  import {
+    notifyTemplateDeleteAPI,
+    notifyTemplatePageAPI
+  } from '@/api/notifyManage';
+  import addOrEditDialog from '@/views/notifyManage/templateManage/components/addOrEditDialog.vue';
 
-import search from './index-search.vue';
-import {notifyTemplateDeleteAPI, notifyTemplatePageAPI} from "@/api/notifyManage";
-import addOrEditDialog from "@/views/notifyManage/templateManage/components/addOrEditDialog.vue";
-
-export default {
-  components: {addOrEditDialog, search},
-  data() {
-    return {
-      addOrEditDialogFlag: false,
-      columns: [
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          prop: 'code',
-          label: '模板编码',
-          minWidth: '120',
-          align: "center",
-        },
-        {
-          prop: 'name',
-          label: '模板名称',
-          minWidth: '120',
-          align: "center",
-        },
-
+  export default {
+    components: { addOrEditDialog, search },
+    data() {
+      return {
+        addOrEditDialogFlag: false,
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '模板编码',
+            minWidth: '120',
+            align: 'center'
+          },
+          {
+            prop: 'name',
+            label: '模板名称',
+            minWidth: '120',
+            align: 'center'
+          },
 
-        {
-          prop: 'content',
-          label: '模板内容',
-          minWidth: '150',
-        },
-        {
-          prop: 'nickname',
-          label: '默认发送人',
-          width: '100',
-          align: "center",
-        },
-        {
-          prop: 'status',
-          label: '状态',
-          width: '80',
-          align: "center",
-          slot:"status",
-          // formatter: (_row, _column, cellValue) => {
-          //   return _row.status ? '启用' : '禁用';
-          // }
-        },
-        {
-          prop: 'remark',
-          label: '备注',
-          minWidth: '120',
-          align: "center",
-        },
-        {
-          prop: 'createTime',
-          label: '创建时间',
-          width: '170',
-          align: "center",
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 150,
-          align: 'center',
-          slot: 'action',
-          fixed: 'right'
-        }
-      ],
-      searchForm: {},
-      tableData: [],
-      size: 10,
-      page: 1,
-      total: 0
-    };
-  },
-  methods: {
-    //新增或修改模板
-    handleAddOrEdit(type, row) {
-      this.addOrEditDialogFlag = true
-      this.$nextTick(() => {
-        this.$refs.addOrEditDialogRef.init(type, row)
-      })
+          {
+            prop: 'content',
+            label: '模板内容',
+            minWidth: '150'
+          },
+          {
+            prop: 'nickname',
+            label: '默认发送人',
+            width: '100',
+            align: 'center'
+          },
+          {
+            prop: 'recipientType',
+            slot: 'recipientType',
+            label: '接收人类型',
+            width: '100',
+            align: 'center'
+          },
+          {
+            prop: 'recipient',
+            slot: 'recipient',
+            label: '接收人',
+            width: '120',
+            align: 'center'
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            width: '80',
+            align: 'center',
+            slot: 'status'
+            // formatter: (_row, _column, cellValue) => {
+            //   return _row.status ? '启用' : '禁用';
+            // }
+          },
+          {
+            prop: 'remark',
+            label: '备注',
+            minWidth: '120',
+            align: 'center'
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            width: '170',
+            align: 'center'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 150,
+            align: 'center',
+            slot: 'action',
+            fixed: 'right'
+          }
+        ],
+        searchForm: {},
+        tableData: [],
+        size: 10,
+        page: 1,
+        total: 0
+      };
     },
-    reload(params) {
-      console.log(params,'=======');
-      this.$refs.table.reload({pageNum: 1, where: params});
-    },
-    async deleteCategory({id}) {
-      await notifyTemplateDeleteAPI([id]);
-      this.$refs.table.reload();
-    },
-    datasource({page, where, limit,...row}) {
-      console.log(page, where, limit,row);
-      return notifyTemplatePageAPI({
-        ...where,
-        pageNum: page,
-        size: limit
-      });
-    },
-    reset() {
-    },
-  }
-};
+    methods: {
+      //新增或修改模板
+      handleAddOrEdit(type, row) {
+        this.addOrEditDialogFlag = true;
+        this.$nextTick(() => {
+          this.$refs.addOrEditDialogRef.init(type, row);
+        });
+      },
+      reload(params) {
+        console.log(params, '=======');
+        this.$refs.table.reload({ pageNum: 1, where: params });
+      },
+      async deleteCategory({ id }) {
+        await notifyTemplateDeleteAPI([id]);
+        this.$refs.table.reload();
+      },
+      datasource({ page, where, limit, ...row }) {
+        console.log(page, where, limit, row);
+        return notifyTemplatePageAPI({
+          ...where,
+          pageNum: page,
+          size: limit
+        });
+      },
+      reset() {}
+    }
+  };
 </script>
 <style lang="scss" scoped>
-.app-container {
-  background: #f0f3f3;
-  min-height: calc(100vh - 84px);
-}
+  .app-container {
+    background: #f0f3f3;
+    min-height: calc(100vh - 84px);
+  }
 
-.zw-page-table {
-  background: #ffffff;
-  padding-top: 20px;
-}
+  .zw-page-table {
+    background: #ffffff;
+    padding-top: 20px;
+  }
 
-.pagination-wrap {
-  display: flex;
-  justify-content: flex-end;
-  padding: 10px 0;
-}
+  .pagination-wrap {
+    display: flex;
+    justify-content: flex-end;
+    padding: 10px 0;
+  }
 
-.table {
-  width: 100%;
-  margin-top: 10px;
-}
+  .table {
+    width: 100%;
+    margin-top: 10px;
+  }
 </style>