Explorar el Código

参加外部质量评价活动计划修改

shenqilong hace 11 meses
padre
commit
acede8de88
Se han modificado 1 ficheros con 28 adiciones y 31 borrados
  1. 28 31
      src/views/component/sjzlpjjhx/sjzlpjjhx.vue

+ 28 - 31
src/views/component/sjzlpjjhx/sjzlpjjhx.vue

@@ -71,7 +71,7 @@
                         >
                             <template slot-scope="{row}">
                                 <el-select
-                                    v-if="!isRead&&!row.yidengji"
+                                    v-if="!isRead&&!(row.shiFouYiDengJi==='1')"
                                     v-model="row.yanZhengLeiXing"
                                     placeholder="请选择"
                                     name="yanZhengLeiXing"
@@ -106,7 +106,7 @@
                         >
                             <template slot-scope="{row}">
                                 <el-input
-                                    v-if="!isRead&&!row.yidengji"
+                                    v-if="!isRead&&!(row.shiFouYiDengJi==='1')"
                                     v-model="row.huoDongMing"
                                     size="mini"
 
@@ -123,7 +123,7 @@
                             <template slot-scope="{row}">
 
                                 <ibps-link-data
-                                    v-if="!isRead&&!row.yidengji"
+                                    v-if="!isRead&&!(row.shiFouYiDengJi==='1')"
                                     v-model="row.tiGongZhe"
 
                                     size="mini"
@@ -147,7 +147,7 @@
                             <template slot-scope="{row}">
 
                                 <ibps-link-data
-                                    v-if="!isRead&&!row.yidengji"
+                                    v-if="!isRead&&!(row.shiFouYiDengJi==='1')"
                                     v-model="row.biDuiFang"
 
                                     size="mini"
@@ -171,7 +171,7 @@
                         >
                             <template slot-scope="{row}">
                                 <el-input
-                                    v-if="!isRead&&!row.yidengji"
+                                    v-if="!isRead&&!(row.shiFouYiDengJi==='1')"
                                     v-model="row.xuHao"
                                     size="mini"
                                     placeholder="请输入"
@@ -185,7 +185,7 @@
                         >
                             <template slot-scope="{row}">
                                 <el-input
-                                    v-if="!isRead&&!row.yidengji"
+                                    v-if="!isRead&&!(row.shiFouYiDengJi==='1')"
                                     v-model="row.jianYanXiangMu"
                                     size="mini"
 
@@ -200,7 +200,7 @@
                         >
                             <template slot-scope="{row}">
                                 <el-input
-                                    v-if="!isRead&&!row.yidengji"
+                                    v-if="!isRead&&!(row.shiFouYiDengJi==='1')"
                                     v-model="row.jiHuaShiJian"
                                     size="mini"
 
@@ -217,7 +217,7 @@
                                 <ibps-user-selector
 
                                     v-model="row.canYuRenYuan"
-                                    :disabled="isRead"
+                                    :disabled="!(!isRead&&!(row.shiFouYiDengJi==='1'))"
                                     readonly-text="text"
                                     type="user"
                                     :multiple="true"
@@ -236,7 +236,7 @@
                             </template>
                             <template slot-scope="{row}">
                                 <el-input
-                                    v-if="!isRead&&!row.yidengji"
+                                    v-if="!isRead&&!(row.shiFouYiDengJi==='1')"
                                     v-model="row.zuHe"
                                     size="mini"
 
@@ -320,7 +320,6 @@ export default {
             handler (value, old) {
                 if (value) {
                     this.sjzlpjjhxData = value
-                    this.getData()
                 }
             }
         },
@@ -335,21 +334,6 @@ export default {
         this.isRead = this.readonly || this.params.nodeId === 'Activity_1lhe4zd' || this.params.nodeId === 'Activity_0rkcq41'
     },
     methods: {
-        getData () {
-            const sql = `select * FROM t_sjzkwjsdjxqb`
-            this.$common.request('sql', sql).then(res => {
-                const { data = [] } = res.variables || {}
-                const yidengjilist = data.map(item => {
-                    return item.ji_hua_zi_biao_id
-                })
-                console.log(yidengjilist)
-
-                for (const item of this.sjzlpjjhxData) {
-                    item.yidengji = yidengjilist.includes(item.id)
-                }
-                console.log(this.sjzlpjjhxData)
-            })
-        },
 
         handleSelectionChange (val) {
             this.multipleSelection = val
@@ -358,7 +342,7 @@ export default {
         handleActionEvent (type) {
             switch (type) {
                 case 'add':
-                    console.info('新增')
+                    // console.info('新增')
                     this.sjzlpjjhxData.push({
                         id: '',
                         parentId: '',
@@ -370,29 +354,36 @@ export default {
                         jianYanXiangMu: '',
                         jiHuaShiJian: '',
                         canYuRenYuan: '',
-                        zuHe: ''
+                        zuHe: '',
+                        shiFouYiDengJi: '0'
                     })
 
                     break
                 case 'edit':
-                    console.info('修改')
+                    // console.info('修改')
                     break
                 case 'remove':
-                    console.info('删除')
+                    // console.info('删除')
                     this.$confirm('确定删除当前选中数据?', '提示', {
                         confirmButtonText: '确定',
                         cancelButtonText: '取消',
                         type: 'warning'
                     }).then(() => {
                         if (this.multipleSelection.length > 0) {
-                            this.sjzlpjjhxData = this.sjzlpjjhxData.filter(row => !this.multipleSelection.includes(row))
+                            // console.log(this.multipleSelection.find(item => item.shiFouYiDengJi === '1'))
+
+                            if (this.multipleSelection.find(item => item.shiFouYiDengJi === '1')) {
+                                this.$message.warning('选择数据有已有登记记录的数据,请重新选择')
+                            } else {
+                                this.sjzlpjjhxData = this.sjzlpjjhxData.filter(row => !this.multipleSelection.includes(row))
+                            }
                         } else {
                             this.$message.warning('请选择数据')
                         }
                     })
                     break
                 case 'importData':
-                    console.info('导入')
+                    // console.info('导入')
                     this.showImportTable = true
                     break
                 case 'exportData':
@@ -400,6 +391,12 @@ export default {
                     break
                 case 'copy':
                     if (this.multipleSelection.length > 0) {
+                        // console.log(this.multipleSelection)
+                        for (const item of this.multipleSelection) {
+                            if (item.id) {
+                                item.id = ''
+                            }
+                        }
                         this.sjzlpjjhxData = this.sjzlpjjhxData.concat(cloneDeep(this.multipleSelection))
                     } else {
                         this.$message.warning('请选择数据')