Просмотр исходного кода

修复基础资料排序异常的问题

liuyao 1 год назад
Родитель
Сommit
5179fb754e

+ 7 - 6
package-basic-data/pages/basic-data/basic-data-sort/basic-data-sort.js

@@ -23,6 +23,7 @@ Page({
     tableData: [],
     flgDefaultItem:[],
     tableDataTemp: [],
+    backFlag:true,
     buttonSaveList: [{ code: 'add', title:  mixins.$t('save'), width: '120rpx',}],
   },
   /**
@@ -80,9 +81,9 @@ Page({
      * @date : 2024/1/23 9:16
      */
   getData(params) {
-    if (this.data.formType == mixins.$t('warehouseSys')) { //仓库档案
+    if (this.data.formType === mixins.$t('warehouseSys')) { //仓库档案
       return this.excute(this.data.warehouseService, this.data.warehouseService.selectByCond, params);
-    } else if (this.data.formType == mixins.$t('saleChannelSys')) { //销售渠道
+    } else if (this.data.formType === mixins.$t('saleChannelSys')) { //销售渠道
       return this.excute(this.data.saleChannelService, this.data.saleChannelService.selectByCond, params);
     } else {
       //基础数据接口
@@ -104,9 +105,9 @@ Page({
     let tableDataIds = []
     let displayNo = 0 //序号
     tableData.forEach(res => {
-      if (this.data.formType == mixins.$t('warehouse')) { //仓库档案
+      if (this.data.formType === mixins.$t('warehouseSys')) { //仓库档案
         tableDataIds.push({ id: res.whId, displayNo: displayNo += 1 })
-      } else if (this.data.formType == mixins.$t('saleChannel')) { //销售渠道
+      } else if (this.data.formType === mixins.$t('saleChannelSys')) { //销售渠道
         tableDataIds.push({ id: res.channelId, displayNo: displayNo += 1 })
       } else { //基础资料
         tableDataIds.push({ id: res.dataId, displayNo: displayNo += 1 })
@@ -122,9 +123,9 @@ Page({
      * @date : 2024/1/23 9:16
      */
   saveData() {
-    if (this.data.formType == mixins.$t('warehouse')) { //仓库档案
+    if (this.data.formType === mixins.$t('warehouseSys')) { //仓库档案
       return this.excute(this.data.warehouseService, this.data.warehouseService.updateBatchWarehouseDisplayNo, this.data.params);
-    } else if (this.data.formType == mixins.$t('saleChannel')) { //销售渠道
+    } else if (this.data.formType === mixins.$t('saleChannelSys')) { //销售渠道
       return this.excute(this.data.saleChannelService, this.data.saleChannelService.updateBatchSaleChannelDisplayNo, this.data.params);
     } else {
       //基础数据接口

+ 10 - 2
package-basic-data/pages/basic-data/basic-data.js

@@ -457,13 +457,21 @@ Page({
   * @date : 2024/1/23 9:16
   */
   toSort() {
-    let this_ = this
+    let _this = this
     wx.navigateTo({
       url: this.data.route.sort.url,
+      events: {
+        // 保存成功后刷新页面
+        refresh: function (data) {
+          // 刷新一览界面
+          _this.searchData();
+        }
+      },
       success: function (res) {
+        console.log('data', _this.data);
         // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
         res.eventChannel.emit('params', {
-          formType: this_.data.dictCode,
+          formType: _this.data.dictCode,
           formMode: 'index'
         })
       }