Browse Source

修改bug

chenrui 1 year ago
parent
commit
913c4fa276
1 changed files with 31 additions and 15 deletions
  1. 31 15
      src/views/inventoryManagement/inventoryImport/detailList.vue

+ 31 - 15
src/views/inventoryManagement/inventoryImport/detailList.vue

@@ -12,22 +12,31 @@
         :wrapperCol="wrapperCol"
         @keyup.enter.native="handleSearch" >
         <a-row :gutter="15">
-          <a-col :md="6" :sm="24">
+          <a-col :md="typeInfo != 'STOCK_IMPORT'?5:6" :sm="24">
             <a-form-model-item label="产品编码">
               <a-input v-model.trim="queryParam.productEntity.code" allowClear placeholder="请输入产品编码"/>
             </a-form-model-item>
           </a-col>
-          <a-col :md="6" :sm="24">
+          <a-col :md="typeInfo != 'STOCK_IMPORT'?5:6" :sm="24">
             <a-form-model-item label="产品名称">
               <a-input v-model.trim="queryParam.productEntity.name" allowClear placeholder="请输入产品名称"/>
             </a-form-model-item>
           </a-col>
-          <a-col :md="6" :sm="24">
+          <a-col :md="typeInfo != 'STOCK_IMPORT'?5:6" :sm="24">
             <a-form-item label="仓库名称">
               <a-input id="warehouseList-name" v-model.trim="queryParam.productEntity.warehouseName" allowClear placeholder="请输入仓库名称"/>
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+          <a-col :md="typeInfo != 'STOCK_IMPORT'?5:6" :sm="24" v-if="typeInfo != 'STOCK_IMPORT'">
+            <a-form-model-item label="供应商">
+              <supplier
+                v-model="supplierSn"
+                placeholder="请选择供应商"
+                @change="supplierChange"
+              ></supplier>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="typeInfo != 'STOCK_IMPORT'?4:6" :sm="24" style="margin-bottom: 10px;">
             <a-button type="primary" @click="handleSearch" :disabled="disabled" id="salesDetailReportList-refresh">查询</a-button>
             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesDetailReportList-reset">重置</a-button>
           </a-col>
@@ -64,11 +73,10 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { downloadExcel } from '@/libs/JGPrint.js'
 import ProductType from '../../common/productType.js'
 import ProductBrand from '../../common/productBrand.js'
 import supplier from '@/views/common/supplier'
-import { reportStockImportDetailList, reportStockImportDetailCount, reportStockImportDetailExport } from '@/api/reportData'
+import { reportStockImportDetailList, reportStockImportDetailCount } from '@/api/reportData'
 export default {
   components: { STable, VSelect, rangeDate, ProductType, ProductBrand, supplier },
   mixins: [commonMixin],
@@ -97,7 +105,8 @@ export default {
           name: '', //  产品名称
           warehouseName: ''// 仓库名称
         },
-        stockImportNo: ''
+        stockImportNo: '',
+        supplierName: ''
       },
       countInfo: 0,
       disabled: false, //  查询、重置按钮是否可操作
@@ -136,26 +145,31 @@ export default {
       const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '供应商', dataIndex: 'supplierName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '产品编码', dataIndex: 'productCode', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '单位', dataIndex: 'unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓库', dataIndex: 'warehouseName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '仓位', dataIndex: 'warehouseLocationName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量', dataIndex: 'putQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '成本', dataIndex: 'cost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售价', dataIndex: 'terminalPrice', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
-        { title: '批发价', dataIndex: 'wholesalePrice', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } },
-        { title: '车主价', dataIndex: 'carOwnersPrice', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } }
+        { title: '数量', dataIndex: 'putQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        // { title: '成本', dataIndex: 'cost', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
+      if (this.typeInfo != 'STOCK_IMPORT') { // 散件导入
+        arr.splice(1, 0, { title: '供应商', dataIndex: 'supplierName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true })
+        arr.splice(10, 0, { title: '售价', dataIndex: 'terminalPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+        arr.splice(11, 0, { title: '批发价', dataIndex: 'wholesalePrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+        arr.splice(12, 0, { title: '车主价', dataIndex: 'carOwnersPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+      }
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(8, 0, { title: '成本价', dataIndex: 'cost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(9, 0, { title: '总成本', dataIndex: 'totalCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(8, 0, { title: '成本价', dataIndex: 'cost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+        arr.splice(9, 0, { title: '总成本', dataIndex: 'totalCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       }
       return arr
     }
   },
   methods: {
+    supplierChange (val, row) {
+      this.queryParam.supplierName = row ? row.supplierName : ''
+    },
     // 合计
     getCount (params) {
       reportStockImportDetailCount(params).then(res => {
@@ -172,11 +186,13 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.supplierSn = undefined
       this.queryParam.stockImportNo = this.detailSn
       this.queryParam.importType = this.typeInfo
       this.queryParam.productEntity.code = ''
       this.queryParam.productEntity.name = ''
       this.queryParam.productEntity.warehouseName = ''
+      this.queryParam.supplierName = ''
       this.handleSearch()
     },
     pageInit () {