| 
					
				 | 
			
			
				@@ -95,6 +95,14 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               :show-tooltip-when-overflow="true" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               label="产品名称"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             </el-table-column> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <el-table-column 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              prop="productSpecifications" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              header-align="center" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              align="center" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              min-width="120" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              :show-tooltip-when-overflow="true" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              label="规格"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </el-table-column> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <el-table-column 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               prop="cnt" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               header-align="center" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -142,7 +150,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               min-width="130" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               label="税率"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               <template slot-scope="scope"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                <el-input type="number" v-model="scope.row.rateVal" :disabled="display"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                <el-input type="number" v-model="scope.row.rate" :disabled="display"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                   <template slot="append">%</template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 </el-input> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               </template> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -152,9 +160,27 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               header-align="center" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               align="center" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               width="120" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              :show-overflow-tooltip="true" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              :show-tooltip-when-overflow="true" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               label="备注"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             </el-table-column> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <el-table-column 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              prop="relatedProduct" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              header-align="center" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              align="center" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              width="120" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              :show-tooltip-when-overflow="true" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              label="产品关联"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </el-table-column> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <el-table-column 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              fixed="right" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              header-align="center" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              align="center" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              width="80" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              label="操作"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              <template slot-scope="scope"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                <el-button style="color: red" type="text" size="small" @click="deleteProductHandle(scope.row.recordId)">删除</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            </el-table-column> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           </el-table> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <el-row style="text-align: center; margin-top: 10px;"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <el-button v-show="!display" type="primary" icon="el-icon-plus" @click="addProduct"></el-button> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -166,22 +192,23 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <el-button v-if="!display" type="primary" @click="dataFormSubmit()">确定</el-button> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </span> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     <!-- </el-dialog> --> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    <template-chose v-if="productListVisible" ref="productList" @addItems="addProductItems" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    <add-or-update v-if="productListVisible"  ref="productList" @addItem="addItem" /> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   </div> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  import templateChose from '../product/template-chose' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  // import templateChose from '../product/template-chose' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   import { getOrderDetail } from '@/api/sale' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   import UserComponent from '../common/user-component' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  import {toNumber, toPercent} from '@/utils/common' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import {toNumber} from '@/utils/common' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   import UploadComponent from '../common/upload-component' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   import { dealStepData, dealStepLogs } from '@/api/util' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   import CusComponent from '../common/cus-component' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  import AddOrUpdate from '../product/template-add-or-update' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     name: 'order-add-or-update', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    components: {CusComponent, UploadComponent, UserComponent, templateChose}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    components: {CusComponent, UploadComponent, UserComponent, AddOrUpdate}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     computed: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       orgId: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         get () { return this.$store.state.user.orgId } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -242,16 +269,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           // 订单产品明细 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (data.data.saleROrderProductList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               data.data.saleROrderProductList.forEach((item) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                this.productDetails.push({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                  id: item.id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                  productId: item.productId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                  productName: item.productName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                  notes: item.notes, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                  cnt: item.cnt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                  price: item.price, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                  productNumber: item.productNumber, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                  rateVal: toPercent(item.rate) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                this.addItem(item) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -260,43 +278,19 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       uploadSuccess (fileList) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.fileList = fileList 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      // 添加组合产品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 添加订单产品明细 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       addProduct () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.productListVisible = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.$nextTick(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          this.$refs.productList.init() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.$refs.productList.init(2) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      addProductItem (item) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      addItem (item) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!item.recordId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          item.recordId = Math.round(Math.random() * 1000000) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.productDetails.push({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          productId: item.productId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          productName: item.productName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          notes: item.notes, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          cnt: 1, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          price: 0, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          rate: 0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      addProductItems (items) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.productDetails = [] 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        items.forEach((item) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          this.addProductItem(item) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      addMaterial () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.materialListVisible = true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.$nextTick(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          this.$refs.materialList.init() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      addMaterialItem (item) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.materialList.push({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          materialId: item.materialId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          materialName: item.materialName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          specifications: item.specifications, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          cnt: item.cnt, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          unitName: item.unitName, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          notes: item.notes 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          ...item 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       validateField (type) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -330,7 +324,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             this.$http({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              url: this.$http.adornUrl(`/biz-service/order/save`), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              url: !this.id ? this.$http.adornUrl(`/biz-service/order/save`) : this.$http.adornUrl(`/biz-service/order/update`), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               method: 'post', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               data: this.$http.adornData({...this.dataForm, orgId: this.orgId}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             }).then(({data}) => { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -354,6 +348,10 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       // 业务员选择变化 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       salesmanChanged (val) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         this.dataForm.salesmanId = val 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      // 删除产品项 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      deleteProductHandle (recordId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        this.productDetails.splice(this.productDetails.findIndex((item) => item.recordId === recordId)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   } 
			 |