Browse Source

选择花材

shish 4 years ago
parent
commit
c20caf1b5d
1 changed files with 14 additions and 4 deletions
  1. 14 4
      hdPad/src/pages/home/components/workInfo.vue

+ 14 - 4
hdPad/src/pages/home/components/workInfo.vue

@@ -27,8 +27,10 @@
     </view>
     <view class="work-item-detail">
 
-      <view class="flex-space right-detail-title" v-if="getMyShopInfo.stockModel && getMyShopInfo.stockModel == 1">每份用材</view>
-      <view class="flex-space right-detail-title" v-else>使用花材</view>
+      <view class="flex-space right-detail-title" v-if="getMyShopInfo.stockModel && getMyShopInfo.stockModel == 1">每份用材
+        <text v-if="orderInfo.stockLock && orderInfo.stockLock == 1 && orderInfo.status == 0" style="color:red;">(不可修改)</text></view>
+      <view class="flex-space right-detail-title" v-else>使用花材
+        <text v-if="orderInfo.stockLock && orderInfo.stockLock == 1 && orderInfo.status == 0" style="color:red;">(不可修改)</text></view>
       
       <view class="unit-use-item">
         <view class="commodity-list">
@@ -78,7 +80,7 @@
     </view>
 
     <view class="button-area">
-      <view :class="[orderInfo.status != 2 && orderInfo.stockLock==0 ? 'active' : '']" @click="lockFn(orderInfo)">锁定</view>
+      <!-- <view :class="[orderInfo.status != 2 && orderInfo.stockLock==0 ? 'active' : '']" @click="lockFn(orderInfo)">锁定</view> -->
       	<view class="active" @click="calcFn">{{calc == 'add' ? '+' : '-'}}</view>
       <!-- <view :class="[orderInfo.status != 2 && orderInfo.stockLock==0 ? 'active' : '']" @click="modifyItem(orderInfo)">修改</view> -->
       <view :class="[orderInfo.status==0 ? 'active' : '']" @tap="finishFn(orderInfo)">完成</view>
@@ -227,8 +229,16 @@ export default {
       }
     },
     confirmFinish(){
+
+      if(this.$util.isEmpty(this.selectList)){
+        this.$msg('请选择花材')
+        return false
+      }
+      const newItem = this.selectList.map(ele=>{
+        return {productId:ele.id,num:ele.currentNum,unitType:ele.unitType,unitPrice:ele.unitPrice}
+      })
       uni.showLoading({mask:true})
-      finish({id:this.orderInfo.id}).then(res=>{
+      finish({id:this.orderInfo.id,itemList:JSON.stringify(newItem)}).then(res=>{
         uni.hideLoading()
         if(res.code == 1){
           this.$msg(res.msg)