于继渤 2 years ago
parent
commit
f88de050fc

+ 7 - 6
package-base-select/pages/select-product-attribute-suppliers/select-product-attribute-suppliers.js

@@ -20,8 +20,6 @@ Page({
     }, {
       title: mixins.$t("serviceProvider") // 服务供应商
     }],
-
-
   },
   /**
      * @desc : 切换  全部 采购供应商  服务供应商
@@ -89,7 +87,13 @@ Page({
    * @author : 于继渤
    */
   toSuppliers() {
-
+    wx.navigateTo({
+      url: app.globalData.routeUrl.supplier.add.url,
+      success: function (res) {
+        // 通过eventChannel向被打开页面传送数据 TODO 测试例子url是写死的,实际中,需要从route中读取
+        res.eventChannel.emit('params', {})
+      }
+    })
   },
   /**
    * @desc : 将数据带回上一页
@@ -106,8 +110,6 @@ Page({
         chooseNames.push(res.supName)
       }
     })
-    console.log(chooseIds,chooseNames)
-
     const eventChannel = this.getOpenerEventChannel();
     eventChannel.emit('bindData', { data: { id: chooseIds, name: chooseNames } })
     wx.navigateBack({
@@ -118,7 +120,6 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-
   },
 
 

+ 13 - 27
package-basic-data/pages/product-attribute/product-attribute.js

@@ -40,22 +40,20 @@ Page({
       [
         { code: 'brandCode', type: 'str', title: mixins.$t('brandCode'), required: false, readonly: true, },
         { code: 'brandName', type: 'str', title: mixins.$t('brandName'), required: true },
-        { code: 'supplierIds', name: 'supplierName', title: 'supplier', type: 'choose', required: true, dropType: 'supplier', required: true,urlKey: 'selectProductTypes',  },
+        { code: 'supplierIds', name: 'supplierNames', title: 'supplier', type: 'choose', required: true, dropType: 'supplier', required: true, },
         { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
       ],
-
-
     sideKey: 0,
 
-    statusItem: {
-      text: '全部',
-      value: -1
-    },
-    statusList: [
-      { checked: false, text: '有效', value: 1 },
-      { checked: false, text: '无效', value: 0 },
-      { checked: true, text: '全部', value: -1 },
-    ], //状态
+    // statusItem: {
+    //   text: '全部',
+    //   value: -1
+    // },
+    // statusList: [
+    //   { checked: false, text: '有效', value: 1 },
+    //   { checked: false, text: '无效', value: 0 },
+    //   { checked: true, text: '全部', value: -1 },
+    // ], //状态
 
   },
 
@@ -65,7 +63,6 @@ Page({
      * @date   : 2024/1/26 11:46
      */
   changeSwipe(e) {
-    console.log('changeSwipe', e)
     let item = e.detail.item
     //停用启用
     let param = {
@@ -104,7 +101,6 @@ Page({
       service = this.data.unitService
       id = 'unitId'
     }
-
     //执行接口
     this.handleMoreDataIsValid(service, item, id)
   },
@@ -119,9 +115,8 @@ Page({
     this.setData({
       formData: JSON.stringify(data)
     })
-    
     //执行保存编辑操作
-    //this.save({})
+    this.save({})
   },
 
   /**
@@ -130,7 +125,6 @@ Page({
    * @date   : 2024/1/26 11:46
    */
   onSwipeBind(e) {
-    console.log('onSwipeBind_1111',e.detail.currentTarget.dataset.item)
     let item = e.detail.currentTarget.dataset.item
     this.handleMoreDataIsValid(this.data.goodsCategoryService, item, 'catId')
   },
@@ -166,24 +160,19 @@ Page({
 
   },
 
-
-
   /**
    * @desc : 分类切换
    * @author : 于继渤
    * @date : 2022/5/26 20:16
    */
   changeSidebar(e) {
-    console.log(e.detail)
     let detail = e.detail
     this.setData({
       formDataName: this.data.sidebarList[detail].name
     })
-
     this.searchData()
   },
 
-
   /**
    * @desc : 列表对象点击
    * @author : 于继渤
@@ -229,7 +218,6 @@ Page({
     * @author : 于继渤
     */
   handleSearchData(tableData) {
-    console.log('this.data.formDataName', this.data.formDataName, tableData)
     if (this.data.formDataName == mixins.$t('goodsCategory')) {
       this.setData({
         tableData: util.convertToChildren(tableData, 'parentId', 'catId', null)
@@ -251,7 +239,6 @@ Page({
       params.pageSize = 100000
       params.currentPage = 1
     }
-
     return params
   },
 
@@ -281,16 +268,15 @@ Page({
     let formDataName = this.data.formDataName
     let popContent = this.data.popContent
     let routeObjNameGoTo = this.data.routeObjNameGoTo
-    console.log('formDataName', formDataName)
     if (formDataName == mixins.$t('goodsBrand')) {//商品品牌
       popContent =
         [
           { code: 'brandCode', type: 'str', title: mixins.$t('brandCode'), required: false, readonly: true, },
           { code: 'brandName', type: 'str', title: mixins.$t('brandName'), required: true },
-          { code: 'supplierIds', name: 'supplierName', title: 'supplier', type: 'choose', required: true, dropType: 'supplier', required: true,urlKey: 'selectProductAttributeSuppliers', },
+          { code: 'supplierIds', name: 'supplierNames', title: 'supplier', type: 'choose', required: true, dropType: 'supplier', required: true, urlKey: 'selectProductAttributeSuppliers', },
           { code: 'remarks', type: 'str', title: mixins.$t('remarks'), required: false }
         ]
-        routeObjNameGoTo = 'goodsBrand'
+      routeObjNameGoTo = 'goodsBrand'
     }
     if (formDataName == mixins.$t('goodsCategory')) { //商品种类
       popContent =