#
whycq
2023-11-04 3334d4402759187b2b2b48a94733b33e13d0012a
pages/business/saleManage/modiSaleManage.vue
@@ -79,6 +79,9 @@
            orderProductTypeIds: [],
            orderProductTypeList: [],
            baseFormData: {
               id: '',
               memoExperience: '',
               status: 0,
               citysData: [],
               cstmrType: '',
               company: '',
@@ -149,8 +152,11 @@
               text: '外销',
               value: 2
            }],
            id: 0,
            citysData: [],
            citysDataTemp: ''
            citysDataTemp: '',
            memoExperience: '',
            status: 0
         }
      },
      onReady() {
@@ -161,6 +167,30 @@
         // 获取省市区
         this.citysData = test.citysData
         this.getDetail()
      },
      onLoad: function(option) {
         let _this = this
         const eventChannel = this.getOpenerEventChannel();
         eventChannel.emit('acceptDataFromOpenedPage', {data: 'data from test page'});
         eventChannel.emit('someEvent', {data: 'data from test page for someEvent'});
         // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
         eventChannel.on('saleManage', function(data) {
            data = data.data
            console.log(data);
            _this.cstmrList = [{value: data.cstmrId$,id: data.cstmrId}]
            _this.companyList = [{name: data.company$,id: data.company}]
            _this.directorList = [{value: data.director$,id: data.director}]
            _this.orderProductTypeList = [{value: data.orderProductTypeId$,id: data.orderProductTypeId}]
            data.cstmrId =  data.cstmrId$
            data.company =  data.company$
            data.director =  data.director$
            data.orderProductTypeId =  data.orderProductTypeId$
            _this.citysDataTemp = data.pcd
            _this.id = data.id
            _this.memoExperience = data.memoExperience
            _this.status = data.status
            _this.baseFormData = data
         })
      },
      methods: {
         async getDetail() {
@@ -253,8 +283,6 @@
               }
            }
            for (element of that.directorList) {
               console.log(that.directorList);
               console.log(that.baseFormData.director);
               if (element.value == that.baseFormData.director) {
                  that.baseFormData.director = element.id
               }
@@ -276,8 +304,11 @@
                  res.remarks = ''
               }
               res.pcd = this.citysDataTemp
               res.id = this.id
               res.memoExperience = this.memoExperience
               res.status = this.status
               uni.request({
                  url: that.baseUrl + '/order/add/auth',
                  url: that.baseUrl + '/order/update/auth',
                  header: {
                     'token': uni.getStorageSync('token'),
                     'content-type': 'application/x-www-form-urlencoded',
@@ -287,7 +318,9 @@
                  success(result) {
                     var res = result.data
                     if (res.code === 200) {
                        uni.navigateBack()
                        uni.navigateBack({
                           delta: 2
                        })
                     } else if (res.code === 403) {
                        uni.showToast({
                           title: res.msg,