linwenxin 8 місяців тому
батько
коміт
a7282a012d

+ 12 - 10
src/packageAttachment/pages/orderOfSales/details.vue

@@ -220,16 +220,18 @@
           </view>
         </view>
       </zj-page-fill>
-      <bt-container v-if="info && ~[2].indexOf(info.state) && !info.workerConfirmDate && info.deliveryType === 0">
-        <view class="btcon pv30 ph10">
-          <view @tap.stop="confirmationDelivery" class="confirm-btn">确认提货 </view>
-        </view>
-      </bt-container>
-      <bt-container v-else-if="info && ~[1].indexOf(info.state) && ~[0].indexOf(info.payFlag)">
-        <view class="btcon pv30 ph10">
-          <view @tap.stop="gopay" class="confirm-btn">去支付 </view>
-        </view>
-      </bt-container>
+      <view
+        class="bottom-container"
+        v-if="info && ~['PAYED'].indexOf(info.status) && !info.workerConfirmDate && info.deliveryType === 0"
+      >
+        <u-button type="primary" text="确认提货" @click="confirmationDelivery"></u-button>
+      </view>
+      <view
+        class="bottom-container"
+        v-else-if="info && ~['SUBMIT'].indexOf(info.status) && ~['NOT'].indexOf(info.payFlag)"
+      >
+        <u-button type="primary" text="去支付" @click="gopay"></u-button>
+      </view>
     </zj-page-container>
   </view>
 </template>

+ 2 - 5
src/packageAttachment/pages/returnOfNewParts/card.vue

@@ -38,7 +38,7 @@
     <view class="accessories_nfo_ac">
       <view class="accessories_nfo_title"> 网点: </view>
       <view class="accessories_nfo_info">
-        <view> {{ item.websitName }}({{ item.websitNumber }}) </view>
+        <view> {{ item.receiveWebsitName }}({{ item.receiveWebsitId }}) </view>
       </view>
     </view>
     <view class="accessories_nfo_ac">
@@ -68,12 +68,9 @@ export default {
   },
   computed: {
     info() {
-      return this.item.newRefundManageItemBeanList[0] || {}
+      return this.item?.newRefundManageItemBeanList?.[0] || {}
     }
   },
-  mounted() {
-    console.log(this.item)
-  },
   methods: {
     toUrl() {
       this.$navToPage({

+ 38 - 14
src/packageMaterial/pages/newSale/index.vue

@@ -36,13 +36,18 @@
         </view>
         <view class="item">
           <view class="label"><text>*</text>是否质量问题</view>
-          <u--input
-            :maxlength="11"
-            placeholder="请输入"
-            border="none"
-            inputAlign="right"
-            v-model="userMobile"
-          ></u--input>
+          <radio-group
+            @change="
+              d => {
+                item.repairFlag = d.detail.value
+              }
+            "
+          >
+            <label style="margin-right: 20upx">
+              <radio value="INNER" :checked="item.repairFlag === 'INNER'" />保内
+            </label>
+            <label> <radio value="OUTSIDE" :checked="item.repairFlag === 'OUTSIDE'" />保外 </label>
+          </radio-group>
         </view>
         <view class="item">
           <view class="label"><text>*</text>旧配件编号</view>
@@ -51,7 +56,7 @@
             placeholder="请输入"
             border="none"
             inputAlign="right"
-            v-model="orderNo"
+            v-model="item.oldPartsNumber"
           ></u--input>
         </view>
         <view class="item">
@@ -61,13 +66,13 @@
             placeholder="请输入"
             border="none"
             inputAlign="right"
-            v-model="orderNo"
+            v-model="item.oldPartsName"
           ></u--input>
         </view>
         <view class="item" @tap="toChooseProduct(index)">
           <view class="label"><text>*</text>新配件名称</view>
           <view class="picker">
-            <text class="value" v-if="item">{{ item.name }}</text>
+            <text class="value" v-if="item">{{ item.goodsName }}</text>
             <text class="placeholder" v-else>选择产品</text>
             <text class="iconfont icon-jinru"></text>
           </view>
@@ -75,11 +80,12 @@
         <view class="item">
           <view class="label"><text>*</text>新配件编号</view>
           <u--input
+            :disabled="true"
             :readonly="hasOid"
             placeholder="请输入"
             border="none"
             inputAlign="right"
-            v-model="orderNo"
+            v-model="item.goodsCode"
           ></u--input>
         </view>
       </view>
@@ -216,15 +222,33 @@ import zjDialogPicker from "@/components/zj-dialog/zj-dialog-picker.vue";
 
   onShow() {
     var data = this.$getStorage('materialSaleData')
-    if (data.dijiIndex !== undefined && this.rpMaterialOrderItemList[data.dijiIndex]) {
-      console.log(data)
+    if (data.dijiIndex !== undefined && this.rpMaterialOrderItemList[Number(data.dijiIndex)]) {
+      this.rpMaterialOrderItemList.splice(Number(data.dijiIndex), 1, {
+        ...this.rpMaterialOrderItemList[Number(data.dijiIndex)],
+        "goodsAmount": data.goodsAmount,
+        "goodsCode": data.goodsCode,
+        "goodsId": data.goodsId,
+        "goodsName": data.goodsName,
+        "unit": data.goodsUnit,
+        "num": data.num,
+      })
     }
     this.$removeStorage('materialSaleData')
   },
 
   methods: {
     addpeijian() {
-      this.rpMaterialOrderItemList.push({})
+      this.rpMaterialOrderItemList.push({
+        "goodsAmount": "",
+        "goodsCode": "",
+        "goodsId": "",
+        "goodsName": "",
+        "unit": "",
+        "num": "",
+        "oldPartsName": "",
+        "oldPartsNumber": "",
+        "repairFlag": "",
+      })
     },
 
     delpeijian(index) {

+ 30 - 91
src/packageMaterial/pages/newSale/order.vue

@@ -6,7 +6,8 @@
       <view class="product-container card">
         <view class="it" v-for="(item, index) in goodsList" :key="index">
           <view class="name"
-            >{{ item.goodsName }}<text>×{{ item.num }}{{ item.goodsUnit }}</text></view
+            >({{ { INNER: '保内', OUTSIDE: '保外' }[item.repairFlag] }}){{ item.goodsName
+            }}<text>×{{ item.num }}{{ item.goodsUnit }}</text></view
           >
           <view class="price">¥{{ (item.goodsAmount * item.num) | priceFilter }}</view>
         </view>
@@ -16,18 +17,20 @@
         </view>
       </view>
 
-      <block v-if="type == 'P' && serviceList.length > 0">
+      <block v-if="type == 'P'">
         <view class="common-title">服务费用</view>
         <view class="form-container card">
-          <view class="item" v-for="(item, index) in serviceList" :key="index">
-            <view class="label"
-              >{{ item.goodsName }}<text>×{{ item.num }}</text></view
-            >
-            <u--input placeholder="请输入单价" border="none" inputAlign="right" v-model="item.goodsAmount"></u--input>
+          <view class="item">
+            <view class="label">其他费用</view>
+            <u--input placeholder="请输入单价" inputAlign="right" v-model="otherPrice"></u--input>
+          </view>
+          <view class="item">
+            <view class="label">服务费用</view>
+            <u--input placeholder="请输入单价" inputAlign="right" v-model="servicePrice"></u--input>
           </view>
           <view class="total">
             <view class="text">合计:</view>
-            <view class="price">¥{{ totalServicePrice | priceFilter }}</view>
+            <view class="price">¥{{ (Number(otherPrice) + Number(servicePrice)) | priceFilter }}</view>
           </view>
         </view>
       </block>
@@ -42,10 +45,7 @@
       <view class="bottom-container">
         <view class="left">
           <view class="text">共{{ totalNum }}件,合计:</view>
-          <view class="price" v-if="type == 'P' && serviceList.length > 0"
-            >¥{{ (totalPrice + totalServicePrice) | priceFilter }}</view
-          >
-          <view class="price" v-else>¥{{ totalPrice | priceFilter }}</view>
+          <view class="price">¥{{ totalPrice | priceFilter }}</view>
         </view>
         <view class="btn">
           <u-button
@@ -77,7 +77,6 @@ export default {
       type: 'M',
       userMobile: '',
       orderNo: '',
-      // salesType: 'OUT',
       salesType: null,
       brandId: null,
       brandName: null,
@@ -89,30 +88,23 @@ export default {
       wbIsAllFee: null, // 维保工单是否包含全部费用
       wbPayType: null, // 维保工单费用支付方式
       goodsList: [],
-      serviceList: [],
-
       remark: '',
+      otherPrice: "",
+      servicePrice: ""
     }
   },
 
   computed: {
     totalNum() {
-      // let val = 0;
-      // this.goodsList.forEach(item => {
-      //   val = val + item.num;
-      // })
-      return this.goodsList.length;
-    },
-    totalPrice() {
       let val = 0;
       this.goodsList.forEach(item => {
-        val = val + (item.num * (item.goodsAmount * 100) / 100);
+        val = val + item.num;
       })
-      return  val;
+      return val
     },
-    totalServicePrice() {
+    totalPrice() {
       let val = 0;
-      this.serviceList.forEach(item => {
+      this.goodsList.forEach(item => {
         val = val + (item.num * (item.goodsAmount * 100) / 100);
       })
       return  val;
@@ -120,14 +112,11 @@ export default {
   },
 
   onLoad() {
-    let data = this.$getStorage('materialSaleData');
+    let data = this.$getStorage('materialSaleDataZhiFu');
     if(data) {
       this.type = data.type;
       this.userMobile = data.userMobile;
       this.orderNo = data.orderNo;
-      // this.salesType = data.salesType;
-      // this.brandId = data.brandId;
-      // this.brandName = data.brandName;
       this.categoryId = data.categoryId;
       this.categoryName = data.categoryName;
       this.websitId = data.websitId;
@@ -135,60 +124,17 @@ export default {
       this.wbId = data.wbId;
       this.wbIsAllFee = data.wbIsAllFee;
       this.wbPayType = data.wbPayType;
-      if(this.type == 'P') {
-        this.goodsList = data.goodsList.filter(o => o.normType == 'M');
-        this.serviceList = data.goodsList.filter(o => o.normType == 'S');
-        this.serviceList.forEach(o => {
-          o.goodsAmount = '';
-        })
-      }else {
-        this.goodsList = data.goodsList;
-      }
+      this.goodsList = data.goodsList;
     }
-    this.$removeStorage('materialSaleData');
+  },
 
+  onHide: function () {
+    this.$removeStorage('materialSaleData');
   },
 
   methods: {
-    confirmPartsDialog(e) {
-      this.parts = this.partsList[e[0]];
-      this.isShowPartsDialog = false;
-    },
-
     submitData(type) {
-      let serviceList = JSON.parse(JSON.stringify(this.serviceList));
-      if(this.type == 'P') {
-        for(let i = 0; i < serviceList.length; i++) {
-          if(!serviceList[i].goodsAmount && serviceList[i].goodsAmount !== 0) {
-            return this.$toast('请输入服务费用价格');
-          }
-        }
-        serviceList.forEach(item => {
-          item.normAmount = Number(item.goodsAmount);
-        })
-      }
-      let goodsList = [
-        ...JSON.parse(JSON.stringify(this.goodsList)),
-        ...serviceList
-      ];
-
-      let url = '', params = {};
-      if(type == 1) {
-        if(this.wbId) {
-          url = '/engin/material/buy';
-          params.rpMaterialOrderItemList = goodsList;
-        }else {
-          url = '/pay/buy';
-          params.workerOrderItems = goodsList;
-        }
-      }
-      else {
-        url = '/engin/material/apply';
-        params.rpMaterialOrderItemList = goodsList;
-      }
-
-      this.$api.postJson(url, {
-        // brand: this.brandName,
+      this.$api.postJson('/pay/buy', {
         settlementType: this.salesType,
         goodsType: this.type,
         remark: this.remark,
@@ -198,20 +144,13 @@ export default {
         categoryName: this.categoryName || '',
         websitId: this.websitId,
         websitName: this.websitName,
-        ...params,
+        workerOrderItems: this.goodsList,
+        otherPrice: this.otherPrice,
+        servicePrice:this.servicePrice
       }).then(res => {
-        if(type == 1) {
-          this.$navToPage({
-            url: `/packageMaterial/pages/newSale/pay?handleOrderId=${res.data}&wbId=${this.wbId}`
-          })
-        } else {
-          this.$successToast();
-          setTimeout(() => {
-            this.$navToPage({
-              url: `/packageHome/pages/maintenance/applyList`
-            }, 'reLaunch')
-          }, 500)
-        }
+        this.$navToPage({
+          url: `/packageMaterial/pages/newSale/pay?handleOrderId=${res.data}&wbId=${this.wbId}`
+        }, "redirectTo")
       })
     },
   },

+ 2 - 1
src/packageMaterial/pages/newSale/orderDetail.vue

@@ -17,7 +17,8 @@
           <view class="product">
             <view class="it" v-for="(item, index) in detail.workerOrderItems" :key="index">
               <view class="name"
-                >{{ item.goodsName }}<text>×{{ item.num }}{{ item.unit }}</text></view
+                >({{ { INNER: '保内', OUTSIDE: '保外' }[item.repairFlag] }}){{ item.goodsName
+                }}<text>×{{ item.num }}{{ item.unit }}</text></view
               >
               <view class="price">¥{{ item.totalAmount | priceFilter }}</view>
             </view>

+ 0 - 1
src/packageMaterial/pages/newSale/pay.vue

@@ -30,7 +30,6 @@
           <view class="row"><text>备注:</text>{{ detail.remark }}</view>
           <view class="row"><text>操作人:</text>{{ detail.workerName }}</view>
         </view>
-
         <!-- <view class="pay-container card mt30">
           <view class="top">请选择客户支付方式</view>
           <view class="item" @tap="payType = 1">