于继渤 2 жил өмнө
parent
commit
dbbbcc1d0b

+ 7 - 7
api/pages/mst/basicData.js

@@ -9,18 +9,18 @@
  *******************************************************************************/
 module.exports = {
   basicDataService: {
-      // 前缀
-      prefix: 'mdm-server/mst/dictionaryData/', 
-      updateBatchDictionaryDataDisplayNo:'update_batch_dictionary_data_display_no',//批量修改序号
-      
+    // 前缀
+    prefix: 'mdm-server/mst/dictionaryData/',
+    updateBatchDictionaryDataDisplayNo: 'update_batch_dictionary_data_display_no',//批量修改序号
+    countByCondMoneyAccount: 'count_by_cond_money_account'
   },
 
   routeUrl: {
     basicData: {
-      sort:{
-        key:'sort',url:'/package-basic-data/pages/basic-data/basic-data-sort/basic-data-sort'
+      sort: {
+        key: 'sort', url: '/package-basic-data/pages/basic-data/basic-data-sort/basic-data-sort'
       },
-      chooseStaff: { key: 'chooseStaff', url: '/package-base-select/pages/select-data/select-data',type:'staff'  }, 
+      chooseStaff: { key: 'chooseStaff', url: '/package-base-select/pages/select-data/select-data', type: 'staff' },
     }
   }
 };

+ 29 - 4
package-basic-data/pages/basic-data/basic-data.js

@@ -8,6 +8,7 @@
  *******************************************************************************/
 const Constants = require('@/utils/Constants.js');
 const util = require('@/utils/util.js')
+import Dialog from '@/dist/dialog/dialog.js';
 const mixins = require('@/mixins/index.js')
 const app = getApp()
 Page({
@@ -158,7 +159,7 @@ Page({
       }
       if (formDataName == '客户标签') {
         //设置新建编辑字段 客户来源
-        popContent =[]
+        popContent = []
       }
       popContent.push({ code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false })
     }
@@ -201,10 +202,34 @@ Page({
       service = this.data.service
       id = 'dataId'
     }
+    if (this.data.formDataName == mixins.$t('accountCategory')) { //账户类别
+      this.countByCondMoneyAccount(item.dataId,service, item, id)
+    } else {
+
+      //执行接口
+      this.handleMoreDataIsValid(service, item, id)
+    }
+
+  },
+  countByCondMoneyAccount(dataId,service, item, id) {
 
+    this.excute(this.data.service, this.data.service.countByCondMoneyAccount + '/' + dataId, {}).then(res => {
+      console.log(res,service)
+      if (res.data.code == 200) {
+        if (res.data.data > 0 && item.flgValid) {
+          //提示信息
+          Dialog.confirm({
+            message:'账户类别有资金账户不能停用',
+          }).then(() => { }).catch(() => {
+          });
 
-    //执行接口
-    this.handleMoreDataIsValid(service, item, id)
+          return
+        } else {
+          //执行接口
+          this.handleMoreDataIsValid(service, item, id)
+        }
+      }
+    })
   },
   /**
    * @desc : 分类切换
@@ -371,7 +396,7 @@ Page({
         service = this.data.service
         id = params.dataId
         params.dictCode = this.data.dictCode
-        
+
       }
     if (id) { //编辑
       return this.excute(service, service.update, params);

+ 1 - 1
package-basic-data/pages/basic-data/basic-data.wxml

@@ -30,7 +30,7 @@
 <dk-popup id="popup"  validFlag="{{true}}"  defaultFlagCol="flgDefault" defaultFlagTitle="默认" type="basic" priceTitle="" priceCol="pricePromotion" subCol="desc" title="{{formDataName}}" value="{{dataItem}}" show="{{showPop}}" routeObjName="{{routeObjNameGoTo}}" contentObj="{{popContent}}" bind:commit="editItems">
 </dk-popup>
 
-
+<van-dialog id="van-dialog" />
 <!-- 底部信息 -->
 
 <dk-save-button model:value="{{btnFormData}}" btnAutoWidthFlag="{{true}}" btnRightFlag="{{true}}" buttonList="{{buttonSaveList}}" contentList="{{contentSaveList}}" bind:open="open"></dk-save-button>