Ver código fonte

回调单详情

chenrui 2 anos atrás
pai
commit
b84cb76e44

+ 0 - 16
src/views/numsGoodsShelves/recallManagement/basicInfoModal.vue

@@ -109,22 +109,6 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.$refs.ruleForm.resetFields()
-      } else {
-        // const _this = this
-        // this.$nextTick(() => {
-        //   _this.form.shelfName = _this.nowData.shelfName
-        //   _this.form.showPrice = _this.nowData.showPrice
-        //   const custome = _this.nowData.customerEntity
-        //   if (custome) {
-        //     _this.form.customerSn = custome.customerSn || ''
-        //     _this.$refs.custList.fetchUser(custome.customerName || '')
-        //     _this.$refs.custList.dealerName = {
-        //       key: custome.customerSn,
-        //       label: custome.customerName,
-        //       row: _this.nowData
-        //     }
-        //   }
-        // })
       }
     }
   }

+ 54 - 31
src/views/numsGoodsShelves/recallManagement/detailModal.vue

@@ -11,19 +11,20 @@
     <!-- 详情 -->
     <div v-if="itemData">
       <a-descriptions :column="3" size="default">
-        <a-descriptions-item label="调货单号">123456789</a-descriptions-item>
-        <a-descriptions-item label="创建时间">2022-11-4 10:00:02</a-descriptions-item>
-        <a-descriptions-item label="状态" :span="1">已完成</a-descriptions-item>
-        <a-descriptions-item label="退库时间">1</a-descriptions-item>
+        <a-descriptions-item label="调回单号">{{ itemData.recallBillNo }}</a-descriptions-item>
+        <a-descriptions-item label="创建时间">{{ itemData.createDate }}</a-descriptions-item>
+        <a-descriptions-item label="状态" :span="1">{{ itemData.billStateDictValue }}</a-descriptions-item>
+        <a-descriptions-item label="退库时间">{{ itemData.confirmTime }}</a-descriptions-item>
         <a-descriptions-item label="关联销售退货单">
-          <span class="recallBillNo" @click="seeRecallBill">DH221104000008,</span>
-          <span class="recallBillNo">DH221104000008</span>
-          <a-button type="primary" ghost class="recallBillBtn">生成销售退货单</a-button>
+          <span v-if="salesReturnBillList && salesReturnBillList.length>0">
+            <span v-for="con in salesReturnBillList" :key="con.id" class="recallBillNo">{{ con.salesReturnNo }}</span>
+          </span>
+          <a-button type="primary" ghost class="recallBillBtn" @click="seeRecallBill">生成销售退货单</a-button>
         </a-descriptions-item>
       </a-descriptions>
     </div>
     <!-- 表格 -->
-    <div class="table-body">
+    <div class="table-body" v-if="detailList && detailList.length>0">
       <table>
         <tr>
           <th width="10%">序号</th>
@@ -33,13 +34,13 @@
           <th width="10%">实退数量</th>
           <th width="10%">单位</th>
         </tr>
-        <tr v-for="(item,index) in 5" :key="item.productSn">
+        <tr v-for="(item,index) in detailList" :key="item.id">
           <td>{{ index + 1 }}</td>
-          <td>JA-11070N</td>
-          <td>名字名字名字名字名字名字名字名字名字名字名字名字名字名字名字名字名字名字名字名字</td>
-          <td>2</td>
-          <td>2</td>
-          <td></td>
+          <td>{{ item.productCode }}</td>
+          <td>{{ item.productName }}</td>
+          <td>{{ item.qty }}</td>
+          <td>{{ item.confirmQty }}</td>
+          <td>{{ item.product.unit }}</td>
         </tr>
       </table>
     </div>
@@ -53,25 +54,27 @@
       :closable="false"
       :footer="null"
       width="23%">
-      <div class="tipTop">
-        <div>产品总款数:<span>5</span></div>
-        <div>产品总件数:<span>5</span></div>
+      <div class="tipTop" v-if="itemData">
+        <div>产品总款数:<span>{{ itemData.totalCategory }}</span></div>
+        <div>产品总件数:<span>{{ itemData.totalQty }}</span></div>
       </div>
-      <div class="tipCon">确认生成销售退货订单吗?</div>
-      <div class="tipCon">此调货单已经存在相应的销售退货单,确定再次生成销售退货单吗?</div>
-      <div class="tipRecallBillNo">
-        <p>DH221104000008</p>
-        <p>DH221104000008</p>
+      <div class="tipCon" v-if="salesReturnBillList && salesReturnBillList.length==0">确认生成销售退货订单吗?</div>
+      <div v-else>
+        <div class="tipCon">此调货单已经存在相应的销售退货单,确定再次生成销售退货单吗?</div>
+        <div class="tipRecallBillNo">
+          <p v-for="con in salesReturnBillList" :key="con.id">{{ con.salesReturnNo }}</p>
+        </div>
       </div>
       <div class="tipFooter">
         <div class="btnLeft" @click="tipVisible = false">取消</div>
-        <div class="btnLeft">确定</div>
+        <div class="btnLeft" @click="setReturnBill">确定</div>
       </div>
     </a-modal>
   </a-modal>
 </template>
 
 <script>
+import { generateSaleReturnBill } from '@/api/shelfRecall.js'
 export default {
   name: 'DetailModal',
   props: {
@@ -89,7 +92,9 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
-      tipVisible: false
+      tipVisible: false,
+      salesReturnBillList: [],
+      detailList: []
     }
   },
   watch: {
@@ -101,17 +106,32 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+      } else {
+        if (this.itemData) {
+          this.salesReturnBillList = this.itemData.salesReturnBillList
+          this.detailList = this.itemData.detailList
+        }
       }
-      // else {
-      //   this.getDetailList()
-      // }
     }
   },
   methods: {
     seeRecallBill () {
       this.tipVisible = true
+    },
+    // 生成销售退货单
+    setReturnBill () {
+      this.spinning = true
+      generateSaleReturnBill({ recallBillSn: this.itemData.recallBillSn }).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          this.tipVisible = false
+          this.$emit('close')
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+      })
     }
-
   }
 }
 </script>
@@ -139,7 +159,10 @@ export default {
     }
     .recallBillNo{
       color:#39f;
-     font-weight: 600;
+      font-weight: 600;
+    }
+    .recallBillNo:not(:last-child)::after{
+      content:',';
     }
     .recallBillBtn{
       border-color:#39f;
@@ -167,7 +190,7 @@ export default {
       color:#333;
       margin:0 auto;
       span{
-        color:#f30f3;
+        color:#f30f30;
         font-weight: bold;
       }
     }
@@ -177,7 +200,7 @@ export default {
         text-align: center;
     }
     .tipRecallBillNo{
-        padding:20px;
+        padding:0 20px;
         p{
           padding-bottom: 15px;
           border-bottom: 1px solid #e0e0e0;

+ 13 - 5
src/views/numsGoodsShelves/recallManagement/list.vue

@@ -126,7 +126,7 @@ import { toThousands } from '@/libs/tools.js'
 import shelfList from '@/views/common/shelfList'
 import basicInfoModal from './basicInfoModal.vue'
 import detailModal from './detailModal'
-import { shelfRecallList, shelfRecallDetailList, shelfRecallCancel, shelfRecallStateCount, shelfRecallDelete } from '@/api/shelfRecall.js'
+import { shelfRecallList, shelfRecallDetailList, shelfRecallCancel, shelfRecallStateCount, shelfRecallDelete, shelfRecallDetail } from '@/api/shelfRecall.js'
 export default {
   components: { STable, recallModal, rangeDate, shelfList, basicInfoModal, detailModal },
   mixins: [commonMixin],
@@ -339,10 +339,18 @@ export default {
       })
       this.getSumByType()
     },
-    // 详情
-    handleDetail (con) {
-      this.detailContent = con
-      this.showDetail = true
+    // 查看详情
+    handleDetail (row) {
+      this.spinning = true
+      shelfRecallDetail({ recallSn: row.recallBillSn }).then(res => {
+        if (res.status == 200) {
+          this.detailContent = res.data
+          this.showDetail = true
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+      })
     },
     handleInfoOk (e) {
       this.$refs.table.refresh()

+ 16 - 9
src/views/numsGoodsShelves/recallStockManagement/editStock.vue

@@ -39,12 +39,12 @@
               style="width: 100%;" />
           </template>
           <template slot="putCost" slot-scope="text, record">
-            <a-input
-              size="small"
+            <a-input-number
+              v-model="record.putCost"
+              :precision="2"
+              :min="0"
               placeholder="请输入入库单价"
-              style="width: 100%;"
-              v-model="record.putCost" >
-            </a-input>
+              @blur="handleEdit(record.putCost,record)"></a-input-number>
           </template>
         </s-table>
         <div style="text-align: center;margin-top: 20px;">
@@ -151,14 +151,21 @@ export default {
         }
       })
     },
-    changeWarehouseCascade (val, opt) {
-      console.log(val, opt)
-      updateSelective({ id: opt.id, warehouseSn: val[0], warehouseLocationSn: val[1] }).then(res => {
+    // 更新列表数据
+    updateSelectData (ajaxData) {
+      updateSelective(ajaxData).then(res => {
         if (res.status == 200) {
           this.$refs.table.refresh()
           this.getStockInfo()
         }
       })
+    },
+    // 修改入库单价
+    handleEdit (costPrice, opt) {
+      this.updateSelectData({ id: opt.id, cost: costPrice })
+    },
+    changeWarehouseCascade (val, opt) {
+      this.updateSelectData({ id: opt.id, warehouseSn: val[0], warehouseLocationSn: val[1] })
       // let loadData
       // if (type == 'dealerProduct') { //  全部产品
       //   loadData = this.loadDataSource[ind]
@@ -257,6 +264,6 @@ export default {
         padding: 10px !important;
       }
     }
-
   }
+
 </style>