| 
					
				 | 
			
			
				@@ -8,17 +8,12 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </view> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <view class="item" v-for="(item, index) in partsList" :key="index"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <view class="row"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <view class="label"><text>*</text>配件{{index+1}}名称</view> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <u--input 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              placeholder="请输入名称" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              border="none" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              inputAlign="right" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-              v-model="item.name" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            ></u--input> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <view class="label"><text>*</text>配件{{ index + 1 }}名称</view> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <u--input placeholder="请输入名称" border="none" inputAlign="right" v-model="item.name"></u--input> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <view class="del" v-if="partsList.length > 1" @tap="delParts(index)">删除</view> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           </view> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           <view class="row"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            <view class="label"><text>*</text>配件{{index+1}}数量</view> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            <view class="label"><text>*</text>配件{{ index + 1 }}数量</view> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             <u-number-box v-model="item.num"></u-number-box> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           </view> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         </view> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -26,7 +21,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       <view class="remark-container"> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         <view class="title">备注</view> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        <u--textarea v-model="remark" placeholder="请输入内容" border="none" ></u--textarea> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        <u--textarea v-model="remark" placeholder="请输入内容" border="none"></u--textarea> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       </view> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     </view> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -40,49 +35,52 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </template> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    data() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        id: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        partsList: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        remark: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    onLoad({id}) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.id = id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      // this.getDetail(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      this.addParts(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+export default { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  data() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    return { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      id: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      partsList: [], 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      remark: '' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    methods: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      addParts() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if(this.partsList.length > 0 && this.partsList.some(o => !o.name)) return this.$toast('请填写配件名称'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  onLoad({ id }) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.id = id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // this.getDetail(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    this.addParts() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.partsList.push({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          name: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          num: 1, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  methods: { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    addParts() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (this.partsList.length > 0 && this.partsList.some(o => !o.name)) return this.$toast('请填写配件名称') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      delParts(index) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.$modal({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          content: '确认删除吗?' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }).then(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          this.partsList.splice(index, 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }).catch(() => {}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.partsList.push({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        name: '', 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        num: 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      toList() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.$navToPage({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          url: `/packageMaterial/pages/partsApply/list` 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    delParts(index) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.$modal({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        content: '确认删除吗?' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .then(() => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.partsList.splice(index, 1) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .catch(() => {}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    toList() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.$navToPage({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        url: `/packageMaterial/pages/partsApply/list` 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      submitData() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        if(this.partsList.length > 0 && this.partsList.some(o => !o.name)) return this.$toast('请填写配件名称'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    submitData() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      if (this.partsList.length > 0 && this.partsList.some(o => !o.name)) return this.$toast('请填写配件名称') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        this.$api.postJson('/material/parts/apply/add', { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+      this.$api 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .postJson('/material/parts/apply/add', { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           orderBaseId: this.id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           items: this.partsList.map(item => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -90,18 +88,22 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               qty: item.num 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           }), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          remark: this.remark, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        }).then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          this.$successToast('提交成功'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          this.crossPage.$emit('refreshWorkorderList', {tab: ''}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          this.crossPage.$emit('refreshWorkorderDetail', ''); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          this.$navToPage({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            url: `/packageMaterial/pages/partsApply/list` 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-          }, 'redirectTo') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          remark: this.remark 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-      }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        .then(res => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.$successToast('提交成功') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.crossPage.$emit('refreshWorkorderList', { tab: '' }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.crossPage.$emit('refreshWorkorderDetail', '') 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          this.$navToPage( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+              url: `/packageMaterial/pages/partsApply/list` 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            'redirectTo' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+          ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 </script> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 <style lang="scss" scoped> 
			 |