ソースを参照

Merge remote-tracking branch 'origin/mergeBranch' into mergeBranch

qymljy 3 年 前
コミット
35f245d2ba

+ 1 - 1
src/HDrpManagement/contractManage/components/productList/addProduct.vue

@@ -177,7 +177,7 @@ export default {
     addBtn () {
       console.log("执行")
       this.drawer = true
-      // this.getQuotationList()
+      this.getQuotationList()
     },
     debounce (fn, wait) {
       let that = this

+ 1 - 1
src/HDrpManagement/orderManage/details/index.vue

@@ -56,7 +56,7 @@
         <product-list @select="select" @onSuccess="queryMainData()" :data="mainData" ref="prod">
           <div slot="operation">
             <!-- <importFile class="inline-16" :bindData="{ownertable:'sa_order',ownerid:$route.query.id,usetype:'default'}" :errorUrl="errorUrl" @onSuccess="bindImportOrder"></importFile> -->
-            <!-- <changeOrderMx v-if="mainData.status === '审核'" class="inline-16" :data="selection" @onSuccess="$refs['prod'].listData()"></changeOrderMx> -->
+            <changeOrderMx v-if="mainData.status === '审核'" :tableData="selection" class="inline-16" :data="mainData" @onSuccess="$refs['prod'].listData()"></changeOrderMx>
             <el-button :disabled="mainData.status !== '审核' || selection.length === 0"  size="small" type="primary" style="margin-bottom:12px" @click="adddispatch">一键发货</el-button>
           </div>
         </product-list>

+ 86 - 21
src/HDrpManagement/orderManage/details/tabs/changeOrderMx.vue

@@ -1,19 +1,65 @@
 <template>
   <div>
-    <el-button type="primary" size="small" :disabled="data.length !== 1" @click="onShow">明细变更</el-button>
-    <el-dialog title="明细变更" append-to-body :visible.sync="dialogVisible" width="400px">
-      <el-form :model="form" size="small">
-        <el-form-item label="产品" :label-width="formLabelWidth">
-          <el-input v-model="form.itemno" disabled autocomplete="off"></el-input>
-        </el-form-item>
-        <el-form-item label="产品" :label-width="formLabelWidth">
-          <el-input v-model="form.itemname" disabled autocomplete="off"></el-input>
-        </el-form-item>
-        <el-form-item label="数量变更" :label-width="formLabelWidth">
-          <el-input v-model="form.qty" autocomplete="off"></el-input>
-        </el-form-item>
+    <el-button type="primary" size="small" :disabled="tableData.length === 0" @click="onShow">明细变更</el-button>
+    <el-dialog title="明细变更" append-to-body :visible.sync="dialogVisible" width="900px">
+      <el-table
+        class="normal-margin"
+        :data="listData"
+        style="width: 100%"
+        border
+        size="small">
+        <el-table-column
+          prop="itemname"
+          label="产品名称"
+          width="180">
+        </el-table-column>
+        <el-table-column
+          prop="itemno"
+          label="产品编号"
+          width="180">
+        </el-table-column>
+        <el-table-column
+          prop="erpitemno"
+          label="erp编号"
+          width="180">
+        </el-table-column>
+        <el-table-column
+            prop="model"
+          label="型号"
+          width="150">
+          <template slot-scope="scope">
+            <p><span>{{scope.row.model}}</span></p>
+          </template>
+        </el-table-column>
+        <el-table-column
+            prop="spec"
+            label="规格"
+            width="150">
+          <template slot-scope="scope">
+            <p><span>{{scope.row.spec}}</span></p>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="undeliqty"
+          label="未发数量"
+          width="180">
+          <template slot-scope="scope">
+            <span>{{scope.row.undeliqty}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="newvalue"
+          label="变更数量"
+          width="180"
+          fixed="right">
+          <template slot-scope="scope">
+            <el-input size="mini" @input="onInput(scope.row,scope.$index)"  v-model="scope.row.newvalue"></el-input>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-form :model="form" label-position="top" size="small">
         <el-form-item label="变更备注" :label-width="formLabelWidth">
-          <el-input v-model="form.remarks" autocomplete="off"></el-input>
+          <el-input v-model="form.remarks" type="textarea" :autosize="{minRows:5}" placeholder="输入变更备注" autocomplete="off"></el-input>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -27,10 +73,11 @@
 
 <script>
 export default {
-  props:['data'],
+  props:['data','tableData'],
   data () {
     return {
       formLabelWidth:'80px',
+      listData:[],
       dialogVisible:false,
       form:{
         qty:''
@@ -39,20 +86,38 @@ export default {
   },
   methods:{
     onShow () {
-      this.form = Object.assign({},this.form,this.data[0])
+      this.listData = this.tableData.map(e=>{
+        e.newvalue = 0
+        return e
+      })
+      console.log(this.listData)
       this.dialogVisible = true
-      console.log(this.form)
+      
+    },
+    onInput(row,index) {
+      if (row.newvalue > row.undeliqty) {
+        this.$message({
+          message:"变更数量不能大于未发数量",
+          type:"error"
+        })
+        row.newvalue = row.undeliqty
+      } 
+      this.$set(this.listData,index,row)
     },
     async submit () {
       const res = await this.$api.requested({
         "id": 20221110145302,
         "content": {
-          "sa_orderitemsid":this.form.sa_orderitemsid,
-          "sa_orderid":this.form.sa_orderid,//订单ID
-          "itemid":this.form.itemid,//商品ID
+          "sa_orderid":this.data.sa_orderid,//订单ID
           "type":"数量",//调整类型,目前只支持数量
-          "newvalue":this.form.qty,//调整后值
-          "remarks":this.form.remarks
+          "remarks":this.data.remarks,
+          "itemifnos":this.listData.map(e=>{
+            return {
+              sa_orderitemsid:e.sa_orderitemsid,
+              itemid:e.itemid,
+              newvalue:e.newvalue
+            }
+          })
         }
       })
       this.tool.showMessage(res,()=>{

+ 1 - 1
src/HDrpManagement/orderManage/modules/edit.vue

@@ -13,7 +13,7 @@
         <p><span style="font-size:14px">订单合计:</span><span style="color:red;font-size:16px;"><b>¥&nbsp;{{tool.formatAmount(data.defaultamount,2)}}</b></span></p>
       </div>
         <div class="flex-align-center">
-        <p style="font-size: 13px !important;color: #8888;font-weight: normal">{{data.amount > freefreightamount?'当前订单免运费':`订单满${tool.formatAmount(freefreightamount,2)}元免运费,当前还差${tool.formatAmount(freefreightamount - data.amount,2)}元`}}</p>
+        <p v-if="freefreightamount" style="font-size: 13px !important;color: #8888;font-weight: normal">{{data.amount > freefreightamount?'当前订单免运费':`订单满${tool.formatAmount(freefreightamount,2)}元免运费,当前还差${tool.formatAmount(freefreightamount - data.amount,2)}元`}}</p>
       </div>
     </div>
     <div class="drawer__panel">

+ 1 - 1
src/SDrpManagement/agentOrder/modules/edit.vue

@@ -18,7 +18,7 @@
 <!--        <p ><span style="font-size:14px">订单合计:</span><span style="color:red;font-size:16px;"><b>¥&nbsp;{{tool.formatAmount(data.amount,2)}}</b></span></p>-->
         <!-- <label style="font-size:14px;margin-left:10px" for="">备注:</label>
         <input class="order__note__input" v-model="defaultData.remarks" type="text" placeholder="请输入订单备注"> -->
-        <p style="font-size: 13px !important;color: #8888;font-weight: normal">{{data.amount > freefreightamount?'当前订单免运费':`订单满${tool.formatAmount(freefreightamount,2)}元免运费,当前还差${tool.formatAmount(freefreightamount - data.amount,2)}元`}}</p>
+        <p v-if="freefreightamount" style="font-size: 13px !important;color: #8888;font-weight: normal">{{data.amount > freefreightamount?'当前订单免运费':`订单满${tool.formatAmount(freefreightamount,2)}元免运费,当前还差${tool.formatAmount(freefreightamount - data.amount,2)}元`}}</p>
       </div>
     </div>
     <div class="drawer__panel">

+ 1 - 1
src/SDrpManagement/salerOrder/modules/edit.vue

@@ -12,7 +12,7 @@
         <p><span style="font-size:14px">订单合计:</span><span style="color:red;font-size:16px;"><b>¥&nbsp;{{tool.formatAmount(data.defaultamount,2)}}</b></span></p>
       </div>
       <div class="flex-align-center">
-        <p style="font-size: 13px !important;color: #8888;font-weight: normal">{{data.amount > freefreightamount?'当前订单免运费':`订单满${tool.formatAmount(freefreightamount,2)}元免运费,当前还差${tool.formatAmount(freefreightamount - data.amount,2)}元`}}</p>
+        <p v-if="freefreightamount" style="font-size: 13px !important;color: #8888;font-weight: normal">{{data.amount > freefreightamount?'当前订单免运费':`订单满${tool.formatAmount(freefreightamount,2)}元免运费,当前还差${tool.formatAmount(freefreightamount - data.amount,2)}元`}}</p>
       </div>
     </div>
     <div class="drawer__panel">

+ 1 - 1
src/SDrpManagement/shopCart/modules/total.vue

@@ -7,7 +7,7 @@
       <div class="prcieInfo">
         <p>共&nbsp;{{data.length}}&nbsp;件商品&emsp;总价 : <span class="price">¥&nbsp;{{tool.formatAmount(total,2)}}</span></p>
         <!-- <p class="text-grey">订单满{{freefreightamount}}元,免运费</p> -->
-        <p>{{total > freefreightamount ?'当前订单免运费':`订单满${freefreightamount}元免运费,当前还差${+freefreightamount - +total}元`}}</p>
+        <p v-if="freefreightamount">{{total > freefreightamount ?'当前订单免运费':`订单满${freefreightamount}元免运费,当前还差${+freefreightamount - +total}元`}}</p>
       </div>
       <div class="submitBtn" @click="confirmOrder">生成订单</div>
     </div>