lilei 2 anni fa
parent
commit
917dec7fbb

+ 1 - 1
public/version.json

@@ -1,5 +1,5 @@
 {
   "message": "发现有新版本发布,确定更新系统?",
   "vendorJsVersion": "",
-  "version": 1676355500388
+  "version": 1676368148332
 }

+ 12 - 15
src/views/allocationManagement/warehouseAllocation/detail.vue

@@ -53,12 +53,8 @@
           bordered>
           <!-- 产品类别 -->
           <template slot="productType" slot-scope="text, record">
-            <a-tooltip placement="top">
-              <template slot="title">
-                <span>{{ record.productTypeName }}</span>
-              </template>
-              {{ record.productTypeName3 }}
-            </a-tooltip>
+            <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+            <span v-else>--</span>
           </template>
           <!-- 成本小计 -->
           <template slot="totalCost" slot-scope="text, record">
@@ -102,6 +98,7 @@ export default {
             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].allocationCost = data.list[i].totalAllocationCost / data.list[i].allocationQty
             }
             this.disabled = false
           }
@@ -116,18 +113,18 @@ export default {
       const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '18%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '类别', scopedSlots: { customRender: 'productType' }, width: '14%', align: 'center' },
-        { title: '数量', dataIndex: 'allocationQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'productUnit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        // { title: '成本小计(¥)', dataIndex: 'totalAllocationCost', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '调出仓位', dataIndex: 'outWarehouseLocationName', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调入仓位', dataIndex: 'putWarehouseLocationName', width: '11%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '数量', dataIndex: 'allocationQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'productUnit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调出仓位', dataIndex: 'outWarehouseLocationName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调入仓位', dataIndex: 'putWarehouseLocationName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(7, 0, { title: '成本小计(¥)', dataIndex: 'totalAllocationCost', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+        arr.splice(5, 0, { title: '成本价', dataIndex: 'allocationCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+        arr.splice(8, 0, { title: '成本小计', dataIndex: 'totalAllocationCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
       return arr
     }

+ 46 - 30
src/views/allocationManagement/warehouseAllocation/edit.vue

@@ -251,22 +251,6 @@ export default {
       productType: [],
       warehousePutLocData: [], //  调入仓位  下拉数据
       warehouseOutLocData: [], //  调出仓位  下拉数据
-      // 表头
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '17%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'brandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分类', scopedSlots: { customRender: 'productType' }, width: '9%', align: 'center' },
-        { title: '调出仓位', dataIndex: 'warehouseLocationName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调入仓位', scopedSlots: { customRender: 'putWarehouseLocationSn' }, width: '8%', align: 'center' },
-        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '7%', align: 'center' },
-        { title: '可用库存数', dataIndex: 'currentQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        // { title: '冻结库存数', dataIndex: 'freezeQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '单位', dataIndex: 'unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -283,20 +267,6 @@ export default {
           return data
         })
       },
-      // 表头
-      chooseColumns: [
-        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'productName', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌', dataIndex: 'brandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分类', scopedSlots: { customRender: 'productType' }, width: '9%', align: 'center' },
-        { title: '调出仓位', dataIndex: 'outWarehouseLocationName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '调入仓位', scopedSlots: { customRender: 'putWarehouseLocationSn' }, width: '8%', align: 'center' },
-        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '8%', align: 'center' },
-        { title: '单位', dataIndex: 'productUnit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
-      ],
       // 加载数据方法 必须为 Promise 对象
       chooseLoadData: parameter => {
         this.chooseDisabled = true
@@ -309,6 +279,7 @@ export default {
             data.list[i].no = no + i + 1
             data.list[i].outQty = data.list[i].allocationQty
             data.list[i].outQtyBackups = data.list[i].allocationQty
+            data.list[i].allocationCost = data.list[i].totalAllocationCost / data.list[i].allocationQty
           }
           this.chooseDisabled = false
           return data
@@ -318,6 +289,51 @@ export default {
       productTotal: null //  合计
     }
   },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '17%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'brandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分类', scopedSlots: { customRender: 'productType' }, width: '9%', align: 'center' },
+        { title: '调出仓位', dataIndex: 'warehouseLocationName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调入仓位', scopedSlots: { customRender: 'putWarehouseLocationSn' }, width: '8%', align: 'center' },
+        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '7%', align: 'center' },
+        { title: '可用库存数', dataIndex: 'currentQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        // { title: '冻结库存数', dataIndex: 'freezeQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '单位', dataIndex: 'unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(6, 0, { title: '成本价', dataIndex: 'putCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+      }
+      return arr
+    },
+    chooseColumns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'brandName', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分类', scopedSlots: { customRender: 'productType' }, width: '9%', align: 'center' },
+        { title: '调出仓位', dataIndex: 'outWarehouseLocationName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '调入仓位', scopedSlots: { customRender: 'putWarehouseLocationSn' }, width: '8%', align: 'center' },
+        { title: '调出数量', scopedSlots: { customRender: 'outQty' }, width: '8%', align: 'center' },
+        { title: '单位', dataIndex: 'productUnit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
+      ]
+      if (this.$hasPermissions('M_ShowAllCost')) {
+        arr.splice(6, 0, { title: '成本价', dataIndex: 'allocationCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+        arr.splice(11, 0, { title: '成本小计', dataIndex: 'totalAllocationCost', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
+      }
+      return arr
+    }
+  },
   methods: {
     //  重置
     resetSearchForm () {