Browse Source

销花宝PC后天-开单、采购交互优化

ouyang 13 hours ago
parent
commit
fd58dfa359

+ 7 - 3
ghs/src/components/purchase/PurchaseCommitPanel.vue

@@ -369,7 +369,8 @@ export default {
         avgKgWeight: '',
         needPrint: 2,
         fistWcPrintNum: 1,
-        cgStaffId: 0,
+        // 未选时用 null,el-select 才能显示 placeholder「请选择」(0 会被当成已选值)
+        cgStaffId: null,
         cgStaffName: '',
         isCost: 1
       }
@@ -408,12 +409,13 @@ export default {
     onStaffChange(id) {
       const staff = (this.staffList || []).find(s => s.id === id)
       this.form.cgStaffName = staff ? staff.name : ''
-      this.form.cgStaffId = id || 0
+      // 清空时回到 null,保证下拉框继续显示「请选择」
+      this.form.cgStaffId = id || null
     },
     /** 一键填当前登录员工为采购人 */
     getMySelf() {
       const staff = (this.shopInfo && this.shopInfo.staff) || {}
-      this.form.cgStaffId = staff.id || 0
+      this.form.cgStaffId = staff.id || null
       this.form.cgStaffName = staff.name || ''
     },
     focusRemark() {
@@ -457,6 +459,8 @@ export default {
       const inType = this.isLocal ? 1 : 0
       const params = {
         ...this.form,
+        // 接口约定未选采购人为 0,表单侧用 null 仅用于展示「请选择」
+        cgStaffId: this.form.cgStaffId || 0,
         ghsId: this.ghsId,
         itemInfo: JSON.stringify(itemInfo),
         modifyPrice: this.modifyPrice,

+ 12 - 0
ghs/src/views/in/change.vue

@@ -139,8 +139,10 @@ export default {
 				//uni.showLoading({mask:true})
                 this.$service.purchaseOrder.confirmPutIn({id:that.id}).then(data => {
 					//uni.hideLoading()
+					// 对齐 App pageSuccess.confirmIn:入库成功后离开改价页
                     if(data.status == 4){
                         that.$notify({ title: '成功', message: '操作成功', type: 'success'})
+                        that.goAddAfterSuccess()
                     }
 				})
 			})
@@ -178,7 +180,9 @@ export default {
 				//uni.showLoading({mask:true})
                 this.$service.purchaseOrderItem.saveCgPrice({data:JSON.stringify(newProduct),cgId:targetId}).then(data => {
 					//uni.hideLoading()
+					// 对齐 App pageSuccess.savePrice:保存成功后离开改价页
                     that.$notify({ title: '成功', message: '操作成功', type: 'success'})
+                    that.goAddAfterSuccess()
 				})
 			})
 		},
@@ -230,9 +234,17 @@ export default {
 			//uni.showLoading({mask:true})
             that.$service.product.batchChangePrice({data:JSON.stringify(newProduct),changeType:'cg',targetId:targetId,appVersion:1}).then(data => {
 				//uni.hideLoading()
+				// 对齐 App pageSuccess.commitModify:改价成功后离开改价页
                 that.$notify({ title: '成功', message: '操作成功', type: 'success'})
+                that.goAddAfterSuccess()
 			})
 		},
+		/**
+		 * 改价/入库/保存成功后跳转供货商页(对齐 App pageSuccess → result;PC 无 result,直接进 /in/add)
+		 */
+		goAddAfterSuccess() {
+			this.$router.push({ path: '/in/add', query: {} })
+		},
         goBackBefore(){
             let query = {};
             let backType = this.$route.query.backType ? this.$route.query.backType : 'add'

+ 2 - 2
ghs/src/views/order/add.vue

@@ -541,12 +541,12 @@ export default {
       this.applyCustom(this.skCustomId, this.skCustomName || '快捷开单', true)
       this.focusGoodsSearch()
     },
-    /** 开单成功:播提示音并清空当前客户购物车 */
+    /** 开单成功:播提示音、清空当前客户购物车,再跳转客户列表 */
     onOrderSuccess() {
       this.successPlay()
       // 仅清空当前客户购物车
       this.removeFromSaveDirect()
-      this.focusGoodsSearch()
+      this.$router.push({ path: '/member/list', query: {} })
     },
     /**
      * 快捷键:Esc 关改量弹窗;Ctrl+Enter 触发右侧面板提交;Ctrl+Alt+Enter 确认差价