Browse Source

销售订单提交时同步保存信息

pengyh 1 year ago
parent
commit
591f33f72f

+ 50 - 23
src/views/auxiliaryFittings/salesManagement/components/attachmentSalesOrderDetail.vue

@@ -176,7 +176,7 @@
 								</el-form-item>
 							</el-col>
 							<el-col :span="24">
-								<el-form-item label="项目地址" prop="province" :required="true">
+								<el-form-item label="项目地址" :required="true">
 									<el-row>
 										<el-col :span="5" style="margin-right: 12px;">
 											<el-input type="text" v-model="formData.project.province" disabled placeholder="请选择省"></el-input>
@@ -594,30 +594,57 @@
 				if(index <= 1){this.isEdit == 0}else{this.isEdit -= 1}
 				this.dataList.splice(index,1)
 			},
+			confirmSubmit(){
+				if(this.formData1.price && !/^[1-9]\d*(\.\d+)?$|^0\.[1-9]\d*$/.test(this.formData1.price)){
+					return this.$message.warning('请输入大于0的数字!')
+				}
+				this.$confirm(`请确定是否提交订单, 是否继续?`, '提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning'
+				}).then(() => {
+					submit({
+						salesId: this.formData.salesId,
+						price: this.formData1.price,
+						urlPrc: this.formData1.fileUrl.length> 0 ?this.formData1.fileUrl[0].url: '',
+						remark: this.formData1.remark
+					}).then(res => {
+						if(res.code == 200){
+							this.$message.success('提交成功!')
+							if(this.formData.payType == 'WECHAT'){
+								this.wxPay()
+							}else{
+								this.goBack()
+							}
+						}
+					})
+				});
+			},
 			submit(){
-				this.$refs.formData1.validate((valid, invalidFields, errLabels) => {
+				const that = this
+				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
 					if (valid) {
-						this.$confirm(`请确定是否提交订单, 是否继续?`, '提示', {
-							confirmButtonText: '确定',
-							cancelButtonText: '取消',
-							type: 'warning'
-						}).then(() => {
-							submit({
-								salesId: this.formData.salesId,
-								price: this.formData1.price,
-								urlPrc: this.formData1.fileUrl.length> 0 ?this.formData1.fileUrl[0].url: '',
-								remark: this.formData1.remark
-							}).then(res => {
-								if(res.code == 200){
-									this.$message.success('提交成功!')
-									if(this.formData.payType == 'WECHAT'){
-										this.wxPay()
-									}else{
-										this.goBack()
-									}
-								}
-							})
-						});
+						edit({
+							salesId: this.formData.salesId,
+							goodsType: 'P',
+							source: this.formData.source,
+							payType: this.formData.payType,
+							remark: this.formData.remark,
+							websitId: this.formData.websitId,
+							websitName: this.formData.websitName,
+							workerName: this.formData.workerName,
+							workerId: this.formData.workerId,
+							identity: this.formData.identity,
+							workerMobile: this.formData.workerMobile,
+							buyPeople: this.formData.buyPeople,
+							items: this.dataList,
+							orderEnginBaseId: this.formData.orderEnginBaseId,
+							salesType: this.formData.salesType
+						}).then(res => {
+							if(res.code == 200){
+								this.confirmSubmit()
+							}
+						})
 					}
 				})
 			},

+ 52 - 22
src/views/auxiliaryFittings/salesManagement/components/auxiliarySalesOrderDetail.vue

@@ -669,30 +669,60 @@
 				if(index <= 1){this.isEdit == 0}else{this.isEdit -= 1}
 				this.dataList.splice(index,1)
 			},
+			confirmSubmit(){
+				if(this.formData1.price && !/^[1-9]\d*(\.\d+)?$|^0\.[1-9]\d*$/.test(this.formData1.price)){
+					return this.$message.warning('请输入大于0的数字!')
+				}
+				this.$confirm(`请确定是否提交订单, 是否继续?`, '提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning'
+				}).then(() => {
+					submit({
+						salesId: this.formData.salesId,
+						price: this.formData1.price,
+						urlPrc: this.formData1.fileUrl.length> 0 ?this.formData1.fileUrl[0].url: '',
+						remark: this.formData1.remark
+					}).then(res => {
+						if(res.code == 200){
+							this.$message.success('提交成功!')
+							if(this.formData.payType == 'WECHAT'){
+								this.wxPay()
+							}else{
+								this.goBack()
+							}
+						}
+					})
+				});
+			},
 			submit(){
-				this.$refs.formData1.validate((valid, invalidFields, errLabels) => {
+				const that = this
+				this.$refs.formData.validate((valid, invalidFields, errLabels) => {
 					if (valid) {
-						this.$confirm(`请确定是否提交订单, 是否继续?`, '提示', {
-							confirmButtonText: '确定',
-							cancelButtonText: '取消',
-							type: 'warning'
-						}).then(() => {
-							submit({
-								salesId: this.formData.salesId,
-								price: this.formData1.price,
-								urlPrc: this.formData1.fileUrl.length> 0 ?this.formData1.fileUrl[0].url: '',
-								remark: this.formData1.remark
-							}).then(res => {
-								if(res.code == 200){
-									this.$message.success('提交成功!')
-									if(this.formData.payType == 'WECHAT'){
-										this.wxPay()
-									}else{
-										this.goBack()
-									}
-								}
-							})
-						});
+						edit({
+							salesId: this.formData.salesId,
+							goodsType: 'M',
+							source: this.formData.source,
+							payType: this.formData.payType,
+							remark: this.formData.remark,
+							websitId: this.formData.websitId,
+							websitName: this.formData.websitName,
+							workerName: this.formData.workerName,
+							workerId: this.formData.workerId,
+							identity: this.formData.identity,
+							workerMobile: this.formData.workerMobile,
+							buyPeople: this.formData.buyPeople,
+							items: this.dataList,
+							orderEnginBaseId: this.formData.orderEnginBaseId,
+							salesType: this.formData.salesType
+						}).then(res => {
+							if(res.code == 200){
+								this.$nextTick(() => {
+									that.confirmSubmit()
+								})
+								
+							}
+						})
 					}
 				})
 			},

+ 1 - 1
src/views/workOrder/orderHome/index.vue

@@ -118,7 +118,7 @@
 					this.$router.push({
 						name: 'workOrderPool',
 						params: {
-							pageName: type,
+							pageName: '-',
 							pageType: 'orderStatus',
 							pageCode: type,
 						},