Browse Source

修改新增类型错误校验

yuanmingze 6 ngày trước cách đây
mục cha
commit
7eb5d46872
4 tập tin đã thay đổi với 35 bổ sung31 xóa
  1. 2 2
      .env.development
  2. BIN
      dist.zip
  3. 2 1
      src/const/crud/wmmanagement.js
  4. 31 28
      src/views/admin/wmmanagement/index.vue

+ 2 - 2
.env.development

@@ -2,8 +2,8 @@ NODE_ENV = 'development'
 VUE_APP_TYPE= 'dev'
 # VUE_APP_URL = 'http://10.144.62.235:9999'
 # VUE_APP_URL = 'https://mic.freerr.cn'
-# VUE_APP_URL = 'https://mic.cnbg.com.cn'
+VUE_APP_URL = 'https://mic.cnbg.com.cn'
 # VUE_APP_URL = 'https://cnbg.yaoyi.net'
 # VUE_APP_URL = 'http://192.168.110.25:9999'
-VUE_APP_URL = 'https://mic-t.cnbg.com.cn'
+# VUE_APP_URL = 'https://mic-t.cnbg.com.cn'
 # VUE_APP_URL = 'http://nk5xzj.natappfree.cc'

BIN
dist.zip


+ 2 - 1
src/const/crud/wmmanagement.js

@@ -416,7 +416,8 @@ export const teamTableOption = {
     },
     {
       label: '省份简称',
-      prop: 'provAbbr'
+      prop: 'provAbbr',
+      hide: true
     },
     {
       type: 'select',

+ 31 - 28
src/views/admin/wmmanagement/index.vue

@@ -58,16 +58,16 @@
 </template>
 
 <script>
-import {fetchList, getObj, addObj, putObj, delObj, getListDrugEntOrAgent} from '@/api/wmmanagement';
-import {tableOption, teamTableOption} from '@/const/crud/wmmanagement';
-import {mapGetters} from 'vuex';
-import {getObjDept, fetchTreeAddUser, getDeptBuildNameById, settleConfig} from '@/api/admin/dept';
-import {getSubList, saveSettleConfig, updateSubLimitAmount} from '@/api/admin/deptSub';
-import {saves} from '@/api/wmdadrugent';
-import {getDictType} from '@/api/common';
+import { fetchList, getObj, addObj, putObj, delObj, getListDrugEntOrAgent } from '@/api/wmmanagement';
+import { tableOption, teamTableOption } from '@/const/crud/wmmanagement';
+import { mapGetters } from 'vuex';
+import { getObjDept, fetchTreeAddUser, getDeptBuildNameById, settleConfig } from '@/api/admin/dept';
+import { getSubList, saveSettleConfig, updateSubLimitAmount } from '@/api/admin/deptSub';
+import { saves } from '@/api/wmdadrugent';
+import { getDictType } from '@/api/common';
 import store from '@/store';
-import {filterCodes, extractPaths} from '@/util/treeUtils.js';
-import {getAreaTreeApi} from '@/api/areaTree';
+import { filterCodes, extractPaths } from '@/util/treeUtils.js';
+import { getAreaTreeApi } from '@/api/areaTree';
 
 export default {
   name: 'wmmanagement',
@@ -125,11 +125,11 @@ export default {
     }
   },
   watch: {
-    'form.qylx': function(val, oldVal) {
+    'form.qylx': function (val, oldVal) {
       if (this.agentType === 'AE') {
         if ('' != val) {
           var obj = tableOption;
-          let index = tableOption.column.findIndex(item => item['label'] === '服务上级组织');
+          let index = tableOption.column.findIndex((item) => item['label'] === '服务上级组织');
           obj.column[index].addDisplay = false;
           if (val == 0) {
             obj.column[index].addDisplay = true;
@@ -142,7 +142,7 @@ export default {
       } else {
         if ('' != val) {
           var obj = teamTableOption;
-          let index = teamTableOption.column.findIndex(item => item['label'] === '服务上级组织');
+          let index = teamTableOption.column.findIndex((item) => item['label'] === '服务上级组织');
           obj.column[index].addDisplay = false;
           if (val == 0) {
             obj.column[index].addDisplay = true;
@@ -202,6 +202,8 @@ export default {
         this.tableOption = teamTableOption;
         this.$forceUpdate();
       }
+      console.log('row', row);
+
       this.$refs.crud.rowEdit(row, index);
     },
 
@@ -217,9 +219,9 @@ export default {
           this.searchForm
         )
       )
-        .then(response => {
+        .then((response) => {
           let answer = response.data.data.records;
-          answer.forEach(item => {
+          answer.forEach((item) => {
             if (item.deptPermissions && item.deptPermissions.length > 1) {
               item.deptPermissions = item.deptPermissions.sort((a, b) => a - b);
             }
@@ -235,26 +237,27 @@ export default {
           this.tableLoading = false;
         });
     },
-    rowDel: function(row, index) {
+    rowDel: function (row, index) {
       this.$confirm('是否确认删除ID为' + row.id, '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       })
-        .then(function() {
+        .then(function () {
           return delObj(row.id);
         })
-        .then(data => {
+        .then((data) => {
           this.$message.success('删除成功');
           this.getList(this.page);
         });
     },
-    handleUpdate: function(row, index, done, loading) {
+    handleUpdate: function (row, index, done, loading) {
       const flattenedArray = this.form.areaCodesData.flat();
       const areaCodes = Array.from(new Set(flattenedArray));
       row.areaCodes = areaCodes;
       row.updateUser = 0;
-      if (undefined != row.sbjnzm && row.sbjnzm.length > 0) {
+
+      if (undefined != row.sbjnzm && row.sbjnzm.length > 0 && Array.isArray(row.sbjnzm)) {
         row.sbjnzm = row.sbjnzm.join(',');
       } else {
         row.sbjnzm = null;
@@ -267,7 +270,7 @@ export default {
       let params = Object.assign({}, row);
       params.provAbbr = params.provAbbrList.join(',');
       putObj(params)
-        .then(data => {
+        .then((data) => {
           this.$message.success('修改成功');
           done();
           this.getList(this.page);
@@ -276,7 +279,7 @@ export default {
           loading();
         });
     },
-    handleSave: function(row, done, loading) {
+    handleSave: function (row, done, loading) {
       const flattenedArray = this.form.areaCodesData.flat();
       const areaCodes = Array.from(new Set(flattenedArray));
       row.areaCodes = areaCodes;
@@ -294,7 +297,7 @@ export default {
       let params = Object.assign({}, row);
       params.provAbbr = params.provAbbrList.join(',');
       addObj(params)
-        .then(data => {
+        .then((data) => {
           this.$message.success('添加成功');
           done();
           this.getList(this.page);
@@ -330,16 +333,16 @@ export default {
     getObjDept1() {
       let deptId = this.userInfo.deptId;
       getObjDept(deptId)
-        .then(data => {
+        .then((data) => {
           var deptInfo = data.data.data;
           this.entLevel = deptInfo.level;
         })
         .catch(() => {});
     },
-    updateTy: function(row, index, done, loading) {
+    updateTy: function (row, index, done, loading) {
       row.enableFlag = '1';
       putObj(row)
-        .then(data => {
+        .then((data) => {
           this.$message.success('停用成功');
           done();
           this.getList(this.page);
@@ -348,10 +351,10 @@ export default {
           loading();
         });
     },
-    updateQy: function(row, index, done, loading) {
+    updateQy: function (row, index, done, loading) {
       row.enableFlag = '0';
       putObj(row)
-        .then(data => {
+        .then((data) => {
           this.$message.success('启用成功');
           done();
           this.getList(this.page);
@@ -364,7 +367,7 @@ export default {
       this.$nextTick(() => {
         const rowData = this.$refs.crud.$refs.dialogForm.value;
         // 查询'服务上级组织'列表
-        getListDrugEntOrAgent({deptLevel: rowData.deptLevel}).then(res => {
+        getListDrugEntOrAgent({ deptLevel: rowData.deptLevel }).then((res) => {
           this.extDrugEntOptions = res.data.data;
         });