lilei 3 years ago
parent
commit
e13d645324

+ 29 - 15
src/views/salesManagement/salesQuery/detail.vue

@@ -48,18 +48,23 @@
       <a-card size="small" :bordered="false" class="pages-wrap">
         <!-- alert -->
         <a-alert type="info" style="margin-bottom: 10px;">
-          <div slot="message">
-            总款数:<strong>{{ detailData&&(detailData.totalCategory || detailData.totalCategory==0) ? detailData.totalCategory : '--' }}</strong>;
-            总数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
-            总赠品数量:<strong>{{ detailData&&(detailData.giftQty || detailData.giftQty==0) ? detailData.giftQty : '--' }}</strong>;
-            急件总款数:<strong>{{ detailData&&(detailData.oosCategory || detailData.oosCategory==0) ? detailData.oosCategory : '--' }}</strong>;
-            急件总数量:<strong>{{ detailData&&(detailData.oosQty || detailData.oosQty==0) ? detailData.oosQty : '--' }}</strong>;<br/>
-            总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</strong>;
-            总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? detailData.totalCost : '--' }}</strong>;
-            总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? detailData.grossProfit : '--' }}</strong>;
-            折后总售价:<strong>{{ detailData&&(detailData.discountedAmount || detailData.discountedAmount==0) ? detailData.discountedAmount : '--' }}</strong>;
-            折扣:<strong>{{ detailData&&(detailData.discountRate || detailData.discountRate==0) ? detailData.discountRate+'%' : '--' }}</strong>;
-            折扣金额:<strong>{{ detailData&&(detailData.discountAmount || detailData.discountAmount==0) ? detailData.discountAmount : '--' }}</strong>;
+          <div style="display: flex;align-items: center;justify-content: space-between;" slot="message">
+            <div>
+              总款数:<strong>{{ detailData&&(detailData.totalCategory || detailData.totalCategory==0) ? detailData.totalCategory : '--' }}</strong>;
+              总数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
+              总赠品数量:<strong>{{ detailData&&(detailData.giftQty || detailData.giftQty==0) ? detailData.giftQty : '--' }}</strong>;
+              急件总款数:<strong>{{ detailData&&(detailData.oosCategory || detailData.oosCategory==0) ? detailData.oosCategory : '--' }}</strong>;
+              急件总数量:<strong>{{ detailData&&(detailData.oosQty || detailData.oosQty==0) ? detailData.oosQty : '--' }}</strong>;<br/>
+              总售价:<strong>{{ detailData&&(detailData.totalAmount || detailData.totalAmount==0) ? detailData.totalAmount : '--' }}</strong>;
+              总成本:<strong>{{ detailData&&(detailData.totalCost || detailData.totalCost==0) ? detailData.totalCost : '--' }}</strong>;
+              总毛利:<strong>{{ detailData&&(detailData.grossProfit || detailData.grossProfit==0) ? detailData.grossProfit : '--' }}</strong>;
+              折后总售价:<strong>{{ detailData&&(detailData.discountedAmount || detailData.discountedAmount==0) ? detailData.discountedAmount : '--' }}</strong>;
+              折扣:<strong>{{ detailData&&(detailData.discountRate || detailData.discountRate==0) ? detailData.discountRate+'%' : '--' }}</strong>;
+              折扣金额:<strong>{{ detailData&&(detailData.discountAmount || detailData.discountAmount==0) ? detailData.discountAmount : '--' }}</strong>;
+            </div>
+            <div>
+              <a-checkbox v-model="showCost" id="salesQuery-cost">成本价</a-checkbox>
+            </div>
           </div>
         </a-alert>
         <!-- 列表 -->
@@ -101,13 +106,13 @@ export default {
       showPage: false,
       spinning: false,
       disabled: false,
+      showCost: false,
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '产品名称', dataIndex: 'productName', width: '11%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '原厂编码', dataIndex: 'productOrigCode', width: '9%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '成本价', dataIndex: 'cost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '原厂编码', dataIndex: 'productOrigCode', width: '9%', align: 'center', customRender: function (text) { return text && text != ' ' ? text : '--' } },
         { title: '售价', dataIndex: 'price', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '折后售价', dataIndex: 'discountedPrice', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '销售数量', dataIndex: 'qty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -131,7 +136,7 @@ export default {
               data.list[i].no = no + i + 1
               const productCode = (data.list[i].productEntity && data.list[i].productEntity.code) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.code)
               const productName = (data.list[i].productEntity && data.list[i].productEntity.name) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.name)
-              const productOrigCode = (data.list[i].productEntity && data.list[i].productEntity.origCode) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.origCode)
+              const productOrigCode = (data.list[i].productEntity && data.list[i].productEntity.origCode) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.origCode) || '--'
               const productOrigUnit = (data.list[i].productEntity && data.list[i].productEntity.unit) || (data.list[i].dealerProductEntity && data.list[i].dealerProductEntity.unit)
               data.list[i].productCode = productCode || '--'
               data.list[i].productName = productName || '--'
@@ -196,6 +201,15 @@ export default {
       })
     }
   },
+  watch: {
+    showCost (newValue, oldValue) {
+      if (newValue) {
+        this.columns.splice(4, 0, { title: '成本价', dataIndex: 'cost', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      } else {
+        this.columns.splice(4, 1)
+      }
+    }
+  },
   mounted () {
     this.showPage = true
     if (!this.$store.state.app.isNewTab || this.outBizSn) { // 页签刷新 或 为弹框时调用

+ 1 - 1
src/views/salesManagement/salesReturn/salesReturnEdit.vue

@@ -439,7 +439,7 @@ export default {
     //  重置
     resetSearchForm (flag) {
       this.$refs.table.refresh(!!flag)
-      this.getOrderDetail()
+      // this.getOrderDetail()
     },
     // 添加或修改产品
     saveProduct (row, type) {

+ 1 - 2
src/views/salesManagement/salesReturn/salesReturnGrabEdit.vue

@@ -425,7 +425,7 @@ export default {
     //  重置
     resetSearchForm (flag) {
       this.$refs.table.refresh(!!flag)
-      this.getOrderDetail()
+      // this.getOrderDetail()
     },
     // 添加或修改产品
     saveProduct (row, type) {
@@ -460,7 +460,6 @@ export default {
       this.spinning = true
       salesReturnSaveProduct(params).then(res => {
         this.resetSearchForm(type != 'edit')
-        this.$refs.queryPart.refreshData()
         this.isInster = false
         this.spinning = false
       })

+ 1 - 1
src/views/salesManagement/urgentItemsOffset/detail.vue

@@ -67,7 +67,7 @@
         </s-table>
       </a-card>
     </a-spin>
-    <div class="affix-cont" v-if="!isWriteDown&&$hasPermissions('B_urgentWriteDown')">
+    <div class="affix-cont" v-if="!isWriteDown&&$hasPermissions('B_urgentWriteDown')&&!spinning">
       <a-button
         size="large"
         style="padding: 0 60px;"

+ 35 - 2
src/views/salesManagement/urgentItemsOffset/list.vue

@@ -77,6 +77,17 @@
           <span style="color: #ed1c24;cursor: pointer;" v-if="$hasPermissions('M_urgentDetail')" @click="handleDetail(record)">{{ record.urgentBillNo }}</span>
           <span v-else>{{ record.urgentBillNo }}</span>
         </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.status == 'WAIT' && $hasPermissions('B_urgentWriteDown')"
+            @click="handleWriteDown(record)"
+            class="button-primary"
+            id="urgentItemsOffsetDetail-btn-submit">冲减</a-button>
+          <span v-else>--</span>
+        </template>
       </s-table>
     </a-spin>
   </a-card>
@@ -84,7 +95,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { urgentList } from '@/api/urgent'
+import { urgentList, urgentWriteDown } from '@/api/urgent'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
@@ -122,7 +133,8 @@ export default {
         { title: '总数量', dataIndex: 'totalQty', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '创建时间', dataIndex: 'createDate', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '冲减时间', dataIndex: 'offSetTime', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', dataIndex: 'statusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '状态', dataIndex: 'statusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -150,6 +162,27 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 冲减
+    handleWriteDown (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定要进行冲减吗?',
+        centered: true,
+        onOk () {
+          _this.disabled = true
+          _this.spinning = true
+          urgentWriteDown({ urgentBillSn: row.urgentBillSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+            _this.disabled = false
+            _this.spinning = false
+          })
+        }
+      })
+    },
     //  重置
     resetSearchForm () {
       this.$refs.rangeDate.resetDate(this.time)