Browse Source

修改bug

chenrui 1 year ago
parent
commit
9a65ceaed8

+ 22 - 6
src/views/purchasingManagement/purchaseOrder/detail.vue

@@ -107,6 +107,12 @@
               :data="loadData"
               :scroll="{ x: 1060 }"
               bordered>
+              <!-- 产品编码 -->
+              <template slot="code" slot-scope="text, record">
+                <span>{{ record.dealerProductEntity.code }}</span>
+                <a-badge v-if="record.promotionFlag && record.promotionFlag=='GIFT'" count="促" :number-style="{ backgroundColor: '#52c41a', zoom:'86%',marginLeft:'8px' }"></a-badge>
+                <a-badge v-if="record.promotionFlag && record.promotionFlag=='DISCOUNT'" count="特" :number-style="{ backgroundColor: '#faad14', zoom:'86%',marginLeft:'8px' }"></a-badge>
+              </template>
               <!-- 采购数量 -->
               <template slot="origqty" slot-scope="text, record">
                 <div>{{ text }}</div>
@@ -116,6 +122,16 @@
               <template slot="outOfStockNum" slot-scope="text, record">
                 <span>{{ record.outOfStockNum }}</span>
               </template>
+              <!-- 采购单价 -->
+              <template slot="unitPrice" slot-scope="text, record">
+                <span v-if="record.promotionFlag && (record.promotionFlag=='GIFT' || record.promotionFlag=='DISCOUNT')">{{ record.discountedPrice? toThousands(record.discountedPrice): '--' }}{{ record.origPrice ? '(' + toThousands(record.origPrice) + ')' : '' }}</span>
+                <span v-else>{{ toThousands(record.discountedPrice) }}</span>
+              </template>
+              <!-- 采购金额 -->
+              <template slot="amount" slot-scope="text, record">
+                <span v-if="record.promotionFlag && (record.promotionFlag=='GIFT' || record.promotionFlag=='DISCOUNT')">{{ record.discountedAmount?toThousands(record.discountedAmount) : '--' }}{{ record.origPrice ? '(' + toThousands(record.origPrice) + ')' : '' }}</span>
+                <span v-else>{{ toThousands(record.discountedAmount) }}</span>
+              </template>
             </s-table>
           </a-collapse-panel>
         </a-collapse>
@@ -185,10 +201,10 @@ export default {
   },
   computed: {
     columns () {
-      let _this=this
+      const _this = this
       const arr = [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'dealerProductEntity.code', width: '16%', align: 'center', scopedSlots: { customRender: 'code' } },
         { title: '产品名称', dataIndex: 'dealerProductEntity.name', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '单位', dataIndex: 'dealerProductEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
@@ -197,12 +213,12 @@ export default {
         { title: '采购数量', dataIndex: 'qty', width: '7%', align: 'center', scopedSlots: { customRender: 'origqty' } },
         // { title: '审核订单金额', dataIndex: 'pushedAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核订单数量', dataIndex: 'pushedQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已取消数量', dataIndex: 'cancelQty', width: '7%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '已取消数量', dataIndex: 'cancelQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(5, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text,2) : '--') } })
-        arr.splice(6, 0, { title: '采购金额', dataIndex: 'discountedAmount', width: '7%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text,2) : '--') } })
-        arr.splice(8, 0, { title: '审核订单金额', dataIndex: 'pushedAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text,2) : '--') } })
+        arr.splice(5, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '7%', align: 'right', scopedSlots: { customRender: 'unitPrice' } })
+        arr.splice(6, 0, { title: '采购金额', dataIndex: 'discountedAmount', width: '7%', align: 'right', scopedSlots: { customRender: 'amount' } })
+        arr.splice(8, 0, { title: '审核订单金额', dataIndex: 'pushedAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
       return arr
     }

+ 19 - 3
src/views/purchasingManagement/purchaseOrderNew/detail.vue

@@ -78,6 +78,12 @@
           :data="loadData"
           :defaultLoadData="false"
           bordered>
+          <!-- 产品编码 -->
+          <template slot="code" slot-scope="text, record">
+            <span>{{ record.dealerProductEntity.code }}</span>
+            <a-badge v-if="record.promotionFlag && record.promotionFlag=='GIFT'" count="促" :number-style="{ backgroundColor: '#52c41a', zoom:'86%',marginLeft:'8px' }"></a-badge>
+            <a-badge v-if="record.promotionFlag && record.promotionFlag=='DISCOUNT'" count="特" :number-style="{ backgroundColor: '#faad14', zoom:'86%',marginLeft:'8px' }"></a-badge>
+          </template>
           <!-- 采购数量 -->
           <template slot="origqty" slot-scope="text, record">
             <div>{{ text }}</div>
@@ -87,6 +93,16 @@
           <template slot="outOfStockNum" slot-scope="text, record">
             <span>{{ record.outOfStockNum }}</span>
           </template>
+          <!-- 采购单价 -->
+          <template slot="unitPrice" slot-scope="text, record">
+            <span v-if="record.promotionFlag && (record.promotionFlag=='GIFT' || record.promotionFlag=='DISCOUNT')">{{ record.discountedPrice? toThousands(record.discountedPrice): '--' }}{{ record.origPrice ? '(' + toThousands(record.origPrice) + ')' : '' }}</span>
+            <span v-else>{{ toThousands(record.discountedPrice) }}</span>
+          </template>
+          <!-- 采购金额 -->
+          <template slot="amount" slot-scope="text, record">
+            <span v-if="record.promotionFlag && (record.promotionFlag=='GIFT' || record.promotionFlag=='DISCOUNT')">{{ record.discountedAmount?toThousands(record.discountedAmount) : '--' }}{{ record.origPrice ? '(' + toThousands(record.origPrice) + ')' : '' }}</span>
+            <span v-else>{{ toThousands(record.discountedAmount) }}</span>
+          </template>
         </s-table>
       </a-card>
     </a-spin>
@@ -150,11 +166,11 @@ export default {
         { title: '采购数量', dataIndex: 'qty', width: '7%', align: 'center', scopedSlots: { customRender: 'origqty' } },
         // { title: '审核订单金额', dataIndex: 'pushedAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '审核订单数量', dataIndex: 'pushedQty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已取消数量', dataIndex: 'cancelQty', width: '7%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '已取消数量', dataIndex: 'cancelQty', width: '7%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(5, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '11%', align: 'right', customRender: function (text, record) { return ((text || text == 0) ? _this.toThousands(text, 2) + (record.origPrice ? '(' + _this.toThousands(record.origPrice) + ')' : '') : '--') } })
-        arr.splice(6, 0, { title: '采购金额', dataIndex: 'discountedAmount', width: '11%', align: 'right', customRender: function (text, record) { return ((text || text == 0) ? _this.toThousands(text, 2) + (record.totalOrigAmount ? '(' + _this.toThousands(record.totalOrigAmount) + ')' : '') : '--') } })
+        arr.splice(5, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '11%', align: 'right', scopedSlots: { customRender: 'unitPrice' } })
+        arr.splice(6, 0, { title: '采购金额', dataIndex: 'discountedAmount', width: '11%', align: 'right', scopedSlots: { customRender: 'amount' } })
         arr.splice(8, 0, { title: '审核订单金额', dataIndex: 'pushedAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
       return arr

+ 12 - 2
src/views/purchasingManagement/signWarehousing/edit.vue

@@ -79,6 +79,16 @@
               :allowClear="false"
               style="width: 100%;" />
           </template>
+          <!-- 采购单价 -->
+          <template slot="unitPrice" slot-scope="text, record">
+            <span v-if="record.promotionFlag && (record.promotionFlag=='GIFT' || record.promotionFlag=='DISCOUNT')">{{ record.discountedPrice? toThousands(record.discountedPrice): '--' }}{{ record.origPrice ? '(' + toThousands(record.origPrice) + ')' : '' }}</span>
+            <span v-else>{{ toThousands(record.discountedPrice) }}</span>
+          </template>
+          <!-- 本次发货金额 -->
+          <template slot="amount" slot-scope="text, record">
+            <span v-if="record.promotionFlag && (record.promotionFlag=='GIFT' || record.promotionFlag=='DISCOUNT')">{{ record.discountedAmount?toThousands(record.discountedAmount) : '--' }}{{ record.totalOrigAmount ? '(' + toThousands(record.totalOrigAmount) + ')' : '' }}</span>
+            <span v-else>{{ toThousands(record.discountedAmount) }}</span>
+          </template>
         </s-table>
         <div style="text-align: center;">
           <a-button
@@ -176,8 +186,8 @@ export default {
         { title: '仓库仓位', scopedSlots: { customRender: 'warehousePosition' }, width: '14%', align: 'center' }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(4, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '6%', align: 'right', customRender: function (text, record) { return ((text || text == 0) ? _this.toThousands(text, 2) + (record.origPrice ? '(' + _this.toThousands(record.origPrice) + ')' : '') : '--') } })
-        arr.splice(8, 0, { title: '本次发货金额', dataIndex: 'discountedAmount', width: '8%', align: 'right', customRender: function (text, record) { return ((text || text == 0) ? _this.toThousands(text, 2) + (record.totalOrigAmount ? '(' + _this.toThousands(record.totalOrigAmount) + ')' : '') : '--') } })
+        arr.splice(4, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '6%', align: 'right', scopedSlots: { customRender: 'unitPrice' } })
+        arr.splice(8, 0, { title: '本次发货金额', dataIndex: 'discountedAmount', width: '8%', align: 'right', scopedSlots: { customRender: 'amount' } })
         arr.splice(10, 0, { title: '本次入库金额', dataIndex: 'realPutAmount', width: '8%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }
       return arr

+ 6 - 1
src/views/purchasingManagement/signWarehousing/stockOrderDetail.vue

@@ -82,6 +82,11 @@
           <template slot="outOfStockNum" slot-scope="text, record">
             <span>{{ record.outOfStockNum }}</span>
           </template>
+          <!-- 采购单价 -->
+          <template slot="unitPrice" slot-scope="text, record">
+           <span v-if="record.promotionFlag && (record.promotionFlag=='GIFT' || record.promotionFlag=='DISCOUNT')">{{record.discountedPrice? toThousands(record.discountedPrice): '--'}}{{record.origPrice ? '(' + toThousands(record.origPrice) + ')' : ''}}</span>
+           <span v-else>{{toThousands(record.discountedPrice)}}</span>
+          </template>
         </s-table>
       </a-card>
     </a-spin>
@@ -141,7 +146,7 @@ export default {
         { title: '本次入库数量', dataIndex: 'realPutQty', width: '9%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
       if (this.$hasPermissions('M_ShowAllCost')) {
-        arr.splice(4, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '10%', align: 'right', customRender: function (text,record) { return ((text || text == 0) ? (_this.toThousands(text, 2) + (record.origPrice ? '(' + _this.toThousands(record.origPrice) + ')' : ''))  : '--') } })
+        arr.splice(4, 0, { title: '采购单价', dataIndex: 'discountedPrice', width: '10%', align: 'right', scopedSlots: { customRender: 'unitPrice' }})
         arr.splice(8, 0, { title: '本次发货金额', dataIndex: 'discountedAmount', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
         arr.splice(10, 0, { title: '本次入库金额', dataIndex: 'realPutAmount', width: '9%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text, 2) : '--') } })
       }