chenrui před 1 rokem
rodič
revize
60b7c285b0

+ 1 - 1
src/api/purchase.js

@@ -186,7 +186,7 @@ export const traceCodeQueryList = (params) => {
   return axios({
     url: '/traceCode/queryList',
     data: params,
-    method: 'get',
+    method: 'post',
     headers: {
       'module': encodeURIComponent('查看唯一码')
     }

+ 23 - 8
src/views/purchasingManagement/purchaseReceipt/detailModal.vue

@@ -43,10 +43,25 @@
         bordered>
         <!-- 操作 -->
         <template slot="action" slot-scope="text, record">
+          <a-tooltip placement="bottom" v-if="record.traceCodeQty*1!=record.productQty*1">
+            <template slot="title">
+              <span>唯一码数量与采购数量不一致</span>
+            </template>
+            <a-button
+              size="small"
+              type="link"
+              v-if="$hasPermissions('B_purchaseReturnEdit')"
+              @click="handleCheck(record)"
+              class="button-info"
+              id="detail-edit-btn">
+              查看
+              <a-icon type="exclamation" style="color:#f30;" />
+            </a-button>
+          </a-tooltip>
           <a-button
             size="small"
             type="link"
-            v-if="$hasPermissions('B_purchaseReturnEdit')"
+            v-if="$hasPermissions('B_purchaseReturnEdit')&&record.traceCodeQty*1===record.productQty*1"
             @click="handleCheck(record)"
             class="button-info"
             id="detail-edit-btn">查看</a-button>
@@ -122,13 +137,13 @@ export default {
         { title: '产品名称', dataIndex: 'productName', width: '40%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'unit', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '采购数量', dataIndex: 'productQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '采购单价', dataIndex: 'productCost1', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        { title: '采购金额', dataIndex: 'productCost', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        { title: '唯一码', dataIndex: 'action', width: '10%', align: 'center', scopedSlots: { customRender: 'action' } }
+        { title: '采购单价', dataIndex: 'productTotalCost', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '采购金额', dataIndex: 'productCost', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') }
+        // { title: '唯一码', dataIndex: 'action', width: '10%', align: 'center', scopedSlots: { customRender: 'action' } }
       ]
-      // if (this.basicInfoData && this.basicInfoData.state && this.basicInfoData.state === 'FINISH') {
-      //   arr.push({ title: '唯一码', dataIndex: 'action', width: '10%', align: 'center', scopedSlots: { customRender: 'action' } })
-      // }
+      if (this.basicInfoData && this.basicInfoData.state && this.basicInfoData.state === 'FINISH') {
+        arr.push({ title: '唯一码', dataIndex: 'action', width: '10%', align: 'center', scopedSlots: { customRender: 'action' } })
+      }
       // if (this.$hasPermissions('B_sparePartsDetail_costPrice')) { //  成本价权限
       //   arr.splice(5, 0, { title: '入库单价', dataIndex: 'productCost', width: '10%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       //   arr.splice(6, 0, { title: '小计', dataIndex: 'subtotal', width: '12%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
@@ -138,7 +153,7 @@ export default {
   },
   methods: {
     handleCheck (row) {
-      this.itemUniqueCodeData = { purchaseNo: row.sparePartsNo, productSn: row.productSn }
+      this.itemUniqueCodeData = { purchaseNo: row.sparePartsNo, productCode: row.productCode, productSn: row.productSn }
       this.openUniqueCodeModal = true
     },
     closeUniqueCodeModal () {

+ 1 - 1
src/views/purchasingManagement/purchaseReceipt/list.vue

@@ -263,7 +263,7 @@ export default {
         { title: '客户名称', dataIndex: 'lockBizDealerName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '业务状态', dataIndex: 'stateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '供应商状态', dataIndex: 'thirdpartyBizStateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '备注', dataIndex: 'remark', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '备注', dataIndex: 'bizRemark', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
       // if (this.$hasPermissions('M_purchaseReturnList_costPrice')) { //  售价权限

+ 18 - 12
src/views/purchasingManagement/purchaseReceipt/uniqueCodeModal.vue

@@ -8,7 +8,7 @@
     @cancel="isShow=false"
     :width="960">
     <solt>
-      <div class="unique-code-tit">查看唯一码(产品编码:Y1602GN,唯一码数量:11)</div>
+      <div class="unique-code-tit">查看唯一码(产品编码:{{ itemData&&itemData.productCode }},唯一码数量:{{ uniqueList&&uniqueList.length?uniqueList.length:0 }})</div>
     </solt>
     <a-card size="small" :bordered="false" class="unique-code-con">
       <!-- 列表 -->
@@ -21,6 +21,7 @@
         :data="loadData"
         :scroll="{ y: 360 }"
         :showPagination="false"
+        :defaultLoadData="false"
         bordered>
       </s-table>
     </a-card>
@@ -32,7 +33,9 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+// 组件
 import { STable } from '@/components'
+// 接口
 import { traceCodeQueryList } from '@/api/purchase'
 export default {
   name: 'BulkWarehousingOrderDetailModal',
@@ -53,29 +56,28 @@ export default {
   data () {
     return {
       isShow: this.openModal, //  是否打开弹框
+      uniqueList: [], // 唯一码数据
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
-        return traceCodeQueryList(Object.assign(parameter, this.itemData)).then(res => {
+        const newData = JSON.parse(JSON.stringify(this.itemData))
+        delete newData.productCode
+        return traceCodeQueryList(Object.assign(parameter, newData)).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
             const no = 0
-            for (var i = 0; i < data.list.length; i++) {
-              data.list[i].no = no + i + 1
+            for (var i = 0; i < data.length; i++) {
+              data[i].no = no + i + 1
             }
+            this.uniqueList = data
           }
           return data
         })
-      }
-    }
-  },
-  computed: {
-    columns () {
-      const arr = [
+      },
+      columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '唯一码', dataIndex: 'productCode', width: '15%', align: 'left', customRender: function (text) { return text || '--' } }
+        { title: '唯一码', dataIndex: 'bizCode', width: '15%', align: 'left', customRender: function (text) { return text || '--' } }
       ]
-      return arr
     }
   },
   watch: {
@@ -87,6 +89,10 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+      } else {
+        this.$nextTick(() => {
+          this.$refs.table.refresh()
+        })
       }
     }
   }