| 
					
				 | 
			
			
				@@ -37,10 +37,17 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <crop-select v-model="form.corpId" corpType="KH" :disabled="detailData.status == 1" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               @getCorpData="getCorpData"></crop-select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          <template slot="storageId"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <el-select v-model="form.storageId" placeholder="请选择" size="small" filterable @change="storageChange" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              :disabled="detailData.status == 1 || data.length > 0"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <el-option v-for="item in storageoptions" :key="item.id" :label="item.cname" :value="item.id"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              </el-option> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </el-select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </avue-form> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </trade-card> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <trade-card title="商品信息" v-loading="loadingBtn"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <avue-form ref="form" class="trading-form" v-model="form" :option="option2"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <avue-form class="trading-form" v-model="form" :option="option2"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <template slot="thisUsedProfit"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <el-input-number v-model="form.thisUsedProfit" :disabled="detailData.status == 1" @change="amountChange" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               placeholder="请输入" size="small" :controls="false" style="width:100%;"></el-input-number> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -123,10 +130,11 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { optionList } from "./js/optionList"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import { getDetails, submit, getCorpDetails, remove, getAllgoods, save, fixSave, revoke, collectPayment } from "@/api/basicData/salesOrder"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { getDetails, submit, getCorpDetails, remove, getAllgoods, save, fixSave, revoke, collectPayment, getStoragelist } from "@/api/basicData/salesOrder"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import feeInfo from "./components/feeInfo.vue"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import reportDialog from "@/components/report-dialog/main"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { multiply, sum, subtract } from "@/util/calculate"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { fdatasync } from "fs"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   name: "index", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   data() { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -198,12 +206,24 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             span: 8, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            label: "仓库", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            prop: "storageId", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            rules: [ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                required: true, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                message: "", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                trigger: "blur" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            span: 8, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             label: "备注", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             prop: "orderRemark", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             placeholder: "打印时显示", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             type: "textarea", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             minRows: 3, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            span: 24, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            span: 16, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         ] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -376,7 +396,8 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       optionList: {}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       goodsoptions: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       settlementList: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      orderFilesList: [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      orderFilesList: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      storageoptions: [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   props: { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -416,6 +437,10 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.getWorkDicts("unit").then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.findObject(this.optionList.column, "unit").dicData = res.data.data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      getStoragelist().then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.storageoptions = res.data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.findObject(this.optionList.column, "storageId").dicData = res.data; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.$refs.crud.init(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     cellStyle() { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -481,23 +506,34 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     getCorpData(row) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if (row) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.form.corpsName = row.cname 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.form.corpTel=row.tel 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.form.corpTel = row.tel 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         getCorpDetails({ id: row.id }).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           this.findObject(this.option.column, "arrivalAddress").dicData = res.data.data.corpsAddrList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.form.corpsName = null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.form.corpTel=null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.form.corpTel = null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.findObject(this.option.column, "arrivalAddress").dicData = [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    storageChange(row) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // console.log(row) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     getAddress(row) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       getCorpDetails({ id: row.corpId }).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.findObject(this.option.column, "arrivalAddress").dicData = res.data.data.corpsAddrList; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     addRow() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.data.push({ $cellEdit: true }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.$refs["form"].validate((valid, done) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        done(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (valid) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.data.push({ $cellEdit: true, storageId: this.form.storageId }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          return false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     rowCell(row, index) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       if (row.$cellEdit == true) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -697,16 +733,6 @@ export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       this.$emit("goBack"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  watch: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // data: function (rows) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //   let val = 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //   rows.forEach(e => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //     val = sum(val, e.amount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //     this.form.purchaseAmount = val 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //     this.form.orderAmount = subtract(this.form.purchaseAmount, this.form.thisUsedProfit) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    //   }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |