소스 검색

Merge branch 'develop_szhj' of http://git.chelingzhu.com/jianguan-web/qpls-md-html into develop_szhj

chenrui 3 년 전
부모
커밋
d0e45611ee
2개의 변경된 파일49개의 추가작업 그리고 60개의 파일을 삭제
  1. 9 11
      src/views/numsGoodsShelves/recallManagement/list.vue
  2. 40 49
      src/views/numsGoodsShelves/recallManagement/recallModal.vue

+ 9 - 11
src/views/numsGoodsShelves/recallManagement/list.vue

@@ -76,7 +76,7 @@
             size="small"
             type="link"
             class="button-primary"
-            @click.stop="handleEdit(record)"
+            @click.stop="handleRecall(record)"
             id="shelfMonitoringList-warehousing-btn">退库</a-button>
           <a-button
             size="small"
@@ -88,11 +88,11 @@
         <a-table
           size="small"
           class="inner-table"
-          slot="expandedRowRender"
           slot-scope="record"
-          :rowKey="(record) => record.id"
+          slot="expandedRowRender"
+          :rowKey="(rec) => rec.id"
           :columns="innerColumns"
-          :data-source="innerData"
+          :data-source="record.innerData"
           :pagination="false"
         >
         </a-table>
@@ -153,19 +153,18 @@ export default {
         { title: '实退数量', dataIndex: 'confirmQty', width: '15%', align: 'center' },
         { title: '单位', dataIndex: 'unit', width: '15%', align: 'center' }
       ],
-      innerData: [],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         return shelfRecallList(Object.assign(parameter, this.queryParam)).then(res => {
-          console.log(res, '========')
           let data
           if (res.status == 200) {
             data = res.data
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
+              data.list[i].innerData = []
             }
             this.disabled = false
           }
@@ -199,7 +198,6 @@ export default {
     // 点击行或图标触发接口
     expand (expanded, record) {
       if (expanded) {
-        console.log(expanded, 'expanded', record)
         this.getinnerData(record) // 获取表格内部数据
       }
     },
@@ -208,13 +206,13 @@ export default {
       this.spinning = true
       shelfRecallDetailList({ shelfSn: record.shelfSn }).then(res => {
         if (res.status == 200) {
-          this.innerData = res.data.data
+          record.innerData = res.data.data
           const no = 0
           for (var i = 0; i < this.innerData.length; i++) {
-            this.innerData[i].no = no + i + 1
+            record.innerData[i].no = no + i + 1
           }
         } else {
-          this.innerData = []
+          record.innerData = []
         }
         this.spinning = false
       })
@@ -235,7 +233,7 @@ export default {
       this.showModal = true
     },
     // 退库
-    handleEdit (row) {
+    handleRecall (row) {
       this.showModal = true
       this.currentData = row
     },

+ 40 - 49
src/views/numsGoodsShelves/recallManagement/recallModal.vue

@@ -14,31 +14,30 @@
         <a-descriptions-item label="调回单号">{{ currentData.recallBillNo||'--' }}</a-descriptions-item>
         <a-descriptions-item label="创建时间">{{ currentData.createDate||'--' }}</a-descriptions-item>
       </a-descriptions>
-      <s-table
+      <a-table
         class="sTable fixPagination"
         ref="table"
         size="small"
         :rowKey="(record) => record.id"
         :columns="columns"
-        :data="loadData"
+        :data-source="list"
         :scroll="{ y:500 }"
-        :showPagination="false"
-        :defaultLoadData="true"
+        :pagination="false"
         bordered>
         <template slot="thNum" slot-scope="text, record">
           <a-input-number
             id="inputNumber"
-            v-model="record.thNum"
+            v-model="record.confirmQty"
             :precision="0"
             :min="0"
             :max="record.dhNum"
             placeholder="请输入"
           />
         </template>
-      </s-table>
+      </a-table>
       <div class="btn-cont">
         <a-button type="primary" id="recallManagement-confirm-modal-save" @click="handleSave">确认退库</a-button>
-        <a-button id="recallManagement-confirm-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
+        <a-button id="recallManagement-confirm-modal-back" @click="cancel" style="margin-left: 15px;">取消</a-button>
       </div>
     </a-spin>
   </a-modal>
@@ -47,6 +46,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable } from '@/components'
+import { warehouseCascadeList, shelfRecallDetailList } from '@/api/shelfRecall.js'
 export default {
   components: { STable },
   mixins: [commonMixin],
@@ -74,41 +74,13 @@ export default {
       rules: [],
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '产品编码', dataIndex: 'createDate', width: '15%', align: 'center' },
-        { title: '产品名称', dataIndex: 'name', width: '30%', align: 'left' },
-        { title: '调回数量', dataIndex: 'dhNum', width: '10%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center' },
+        { title: '产品名称', dataIndex: 'productName', width: '30%', align: 'left' },
+        { title: '调回数量', dataIndex: 'qty', width: '10%', align: 'center' },
         { title: '实际退库数量', width: '10%', align: 'center', scopedSlots: { customRender: 'thNum' } },
         { title: '单位', dataIndex: 'danwei', width: '10%', align: 'center' }
       ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        // this.disabled = true
-        // this.spinning = true
-        return new Promise(function (resolve, reject) {
-          const data = {
-            list: [{ id: 1, createDate: '2020-08-09', name: '监管产品测试001', dhNum: '2', danwei: '个', thNum: '' }]
-          }
-          for (var i = 0; i < data.list.length; i++) {
-            data.list[i].no = i + 1
-          }
-          // this.spinning = false
-          // this.disabled = false
-          resolve(data)
-        })
-        // return employeeList(Object.assign(parameter, this.queryParam)).then(res => {
-        //   let data
-        //   if (res.status == 200) {
-        //     data = res.data
-        //     const no = (data.pageNo - 1) * data.pageSize
-        //     for (var i = 0; i < data.list.length; i++) {
-        //       data.list[i].no = no + i + 1
-        //     }
-        //     this.disabled = false
-        //   }
-        //   this.spinning = false
-        //   return data
-        // })
-      }
+      list: []
     }
   },
   computed: {
@@ -127,17 +99,33 @@ export default {
         centered: true,
         onOk () {
           _this.$emit('close')
-          // _this.spinning = true
-          // storeCallOutOut({ storeCallOutSn: row.storeCallOutSn }).then(res => {
-          //   if (res.status == 200) {
-          //     _this.$message.success(res.message)
-          //     _this.$refs.table.refresh()
-          //     _this.spinning = false
-          //   } else {
-          //     _this.spinning = false
-          //   }
-          // })
+          _this.spinning = true
+          warehouseCascadeList({ recallBillSn: _this.currentData.recallBillSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.spinning = false
+              _this.$emit('refresh')
+              _this.cancel()
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    getData () {
+      this.spinning = true
+      shelfRecallDetailList({ recallBillSn: this.currentData.recallBillSn }).then(res => {
+        if (res.status == 200) {
+          this.list = res.data.data
+          const no = 0
+          for (var i = 0; i < this.list.length; i++) {
+            this.list[i].no = no + i + 1
+          }
+        } else {
+          this.list = []
         }
+        this.spinning = false
       })
     },
     // 取消
@@ -148,6 +136,9 @@ export default {
   watch: {
     isOpenModal (nVal, oVal) {
       this.opened = nVal
+      if (nVal) {
+        this.getData()
+      }
     }
   }
 }