chenrui 6 місяців тому
батько
коміт
0fbd9beea0

+ 132 - 0
src/views/salesManagement/salesQueryNew/changeOrderModal.vue

@@ -0,0 +1,132 @@
+<template>
+  <a-modal
+    centered
+    :footer="null"
+    :maskClosable="false"
+    class="change-order-modal"
+    title="转单"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="600">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="change-order-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-form-model-item label="客户名称">{{ form.buyerName || '--' }}</a-form-model-item>
+        <a-form-model-item label="发货经销商" prop="dataScope">
+          <custList
+            id="change-order-dataScope"
+            ref="custList"
+            :notDealerSn="notDealer"
+            @change="dealerChange"
+            placeholder="请输入发货经销商"></custList>
+        </a-form-model-item>
+      </a-form-model>
+      <div class="btn-cont">
+        <a-button id="change-order-back" @click="handleCancel">取消</a-button>
+        <a-button type="primary" style="margin-left: 15px;" id="change-order-save" @click="handleSave">确定</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import custList from '@/views/common/custList.vue'
+export default {
+  components: { custList },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      // 导出选项
+      form: {
+        buyerName: '',
+        dataScope: undefined
+      },
+      // 选项校验
+      rules: {
+        dataScope: [{ required: true, message: '请输入发货经销商', trigger: 'change' }]
+      },
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 15 }
+      },
+      spinning: false
+    }
+  },
+  methods: {
+    // 选择经销商
+    dealerChange (val) {
+      this.queryParam.dealer.dealerSn = val.key
+      this.queryParam.dealer.dealerName = val.key ? (val.label.replace('\n', '')).trim() : ''
+    },
+    // 确认
+    handleSave (isPrint) {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          // 价格类型
+          _this.form.priceType = _this.form.dataScope == 'ENOUGH' ? 'SALES_BILL_NOT_LACK' : 'SALES_BILL'
+          _this.form.priceType += _this.form.orgCode == '1' ? '_ORIG_CODE' : ''
+          const obj = {
+            salesBillSn: _this.itemData.salesBillSn,
+            priceType: _this.form.priceType,
+            dataScope: _this.form.dataScope == 'all' ? '' : _this.form.dataScope,
+            type: isPrint || 'preview'
+          }
+          _this.$emit('ok', obj)
+          _this.isShow = false
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    // 取消选择分类
+    handleCancel () {
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        // 重置表单
+        this.form = {
+          buyerName: '',
+          dataScope: undefined
+        }
+        this.$refs.custList.resetForm()
+        this.$refs.ruleForm.resetFields()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .change-order-type-modal{
+    .ant-form-item{
+      margin-bottom: 10px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 104 - 0
src/views/salesManagement/salesQueryNew/comps/dealerStockModal.vue

@@ -0,0 +1,104 @@
+<template>
+  <a-modal
+    v-model="isShow"
+    title="经销商库存"
+    centered
+    :maskClosable="false"
+    :confirmLoading="confirmLoading"
+    width="500px"
+    :footer="null"
+    @cancel="cancel">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div style="padding: 0 30px;">
+        <a-radio-group v-model="chooseVal">
+          <a-radio :style="radioStyle" v-for="(item,index) in dealerList" :key="item.id" :value="index">
+            {{ item.nameInfo }}
+            <custList
+              id="dealerStockModal-custList"
+              v-if="index==dealerList.length-1"
+              ref="custList"
+              style="margin-left:10px;"
+              :notDealerSn="notDealer"
+              @change="dealerChange"
+              placeholder="请输入经销商名称搜索"></custList>
+          </a-radio>
+        </a-radio-group>
+      </div>
+      <div style="padding: 30px 0 0;text-align: center;">
+        <a-button @click="cancel" style="margin-right: 15px" type="default" id="chooseCustom-btn-back">取消</a-button>
+        <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">确定</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { salesPromoMatchProduct } from '@/api/salesNew'
+import custList from '@/views/common/custList.vue'
+export default {
+  name: 'DealerStockModal',
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  components: { custList },
+  data () {
+    return {
+      isShow: this.openModal,
+      spinning: false,
+      confirmLoading: false,
+      chooseVal: null,
+      radioStyle: "display:block;height: '30px';lineHeight: '30px';padding:5px 0;",
+      dealerList: [{ id: 1, nameInfo: '大兴店库存(上级)' }, { id: 2, nameInfo: '东莞服务中心库存(省仓)' }, { id: 3, nameInfo: '其他经销商库存' }],
+      editRow: null,
+      promoRuleSn: null
+    }
+  },
+  methods: {
+    getActiveList (data, record) {
+      this.promoRuleSn = data.promoRuleSn
+      this.editRow = record
+      this.spinning = true
+      salesPromoMatchProduct(data).then(res => {
+        this.activeList = res.data || []
+        this.spinning = false
+      })
+    },
+    // 选择经销商
+    dealerChange (val) {
+      this.queryParam.dealer.dealerSn = val.key
+      this.queryParam.dealer.dealerName = val.key ? (val.label.replace('\n', '')).trim() : ''
+    },
+    //  保存
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      if (_this.upActiveVal) {
+        _this.confirmLoading = true
+        _this.$emit('ok', _this.upActiveVal, _this.editRow)
+      } else {
+        _this.$message.info('请选择活动规则!')
+      }
+    },
+    cancel () {
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      }
+    }
+  }
+}
+</script>

+ 2 - 1
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -245,7 +245,8 @@ export default {
           arr.push({ title: '第三方库存', field: 'thirdStockQty', width: 80, key: 'mm', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
         }
       }
-      this.colspanNums = this.colspanNums + 3
+      this.colspanNums = this.colspanNums + 4
+      arr.push({ title: '经销商库存', field: 'thirdStockQty1', width: 80, key: 'mm', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
       arr = arr.concat([
         { title: '待下推数', field: 'unpushedQty', width: 80, key: 'o', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } },
         { title: '已下推数', field: 'pushedQty', width: 80, key: 'p', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } }

+ 45 - 6
src/views/salesManagement/salesQueryNew/detail.vue

@@ -61,7 +61,8 @@
             <a-descriptions-item label="财务状态">{{ detailData&&detailData.financialStatusDictValue || '--' }}</a-descriptions-item>
             <a-descriptions-item label="改单时间" v-if="detailData&&detailData.salesBillSource=='PURCHASE'&&detailData.submitDate">{{ detailData.submitDate }}</a-descriptions-item>
             <a-descriptions-item label="最新提交时间" v-if="detailData&&detailData.salesBillSource=='SALES'&&detailData.submitDate">{{ detailData.submitDate }}</a-descriptions-item>
-            <a-descriptions-item label="备注" :span="3">{{ detailData&&detailData.remarks || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="发货经销商">{{ detailData&&detailData.billStatusDictValue || '--' }}</a-descriptions-item>
+            <a-descriptions-item label="备注" :span="2">{{ detailData&&detailData.remarks || '--' }}</a-descriptions-item>
           </a-descriptions>
         </div>
       </a-card>
@@ -96,12 +97,12 @@
             <div style="flex-grow: 1;width: 60%;">
               <a-form layout="inline" @keyup.enter.native="searchTable">
                 <a-row :gutter="15" type="flex">
-                  <a-col flex="300px">
+                  <a-col flex="260px">
                     <a-form-item label="出库仓库">
                       <chooseWarehouse id="salesDetail-warehouse" ref="warehouse" v-model="warehouseSn"></chooseWarehouse>
                     </a-form-item>
                   </a-col>
-                  <a-col flex="300px" v-if="hasPrompActive">
+                  <a-col flex="260px" v-if="hasPrompActive">
                     <a-form-item label="产品类型">
                       <a-select v-model.trim="promoFlag" id="salesDetail-promoFlag" allowClear :dropdownMatchSelectWidth="false" placeholder="请选择产品类型">
                         <a-select-option value="0">
@@ -125,6 +126,17 @@
                       </a-select>
                     </a-form-item>
                   </a-col>
+                  <a-col flex="260px">
+                    <a-form-item label="经销商库存">
+                      <v-select
+                        code="FLAG"
+                        id="purchaseOrder-basicInfo-settleStyleSn"
+                        v-model="settleStyleSn"
+                        allowClear
+                        placeholder="请选择经销商库存是否满足"
+                      ></v-select>
+                    </a-form-item>
+                  </a-col>
                   <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
                     <a-button type="primary" @click="searchTable" :disabled="disabled" id="salesDetail-refresh">查询</a-button>
                     <a-button style="margin-left: 5px" @click="resetSearchForm" id="salesDetail-reset">重置</a-button>
@@ -132,7 +144,8 @@
                 </a-row>
               </a-form>
             </div>
-            <div>
+            <div style="margin-bottom: 10px;">
+              <a-button id="salesDetail-updateStock" type="primary" style="margin-right: 10px;" @click="openDealerModal" class="button-dealerStock">经销商库存</a-button>
               <a-button id="salesDetail-updateStock" type="primary" v-if="showStock" @click="getThreeStock" class="button-info">第三方库存</a-button>
               <a-button id="salesDetail-stockOut" v-if="detailData && (detailData.billStatus == 'WAIT_AUDIT' || detailData.billStatus == 'HQ_CHANGE')" type="link" @click="openStockOut">缺货明细</a-button>
               <a-checkbox id="salesDetail-cityPrice" v-model="isCityPrice" v-if="$hasPermissions(authCode + '_cityPrice')"><span style="display: inline-block;margin-top: 1px;">市级价</span></a-checkbox>
@@ -155,6 +168,17 @@
       </a-card>
     </a-spin>
     <div class="affix-cont" :style="{padding:hideFooter?0:'7px 0 4px'}">
+      <a-button
+        style="width: 100px;margin-right:20px;"
+        :disabled="spinning"
+        type="primary"
+        class="button-info"
+        id="salesDetail-audit-btn"
+        v-if="detailData&&detailData.billStatus == 'WAIT_AUDIT'&&$hasPermissions('B_salesAudit')"
+        @click="handleAudit()"
+      >
+        转单
+      </a-button>
       <a-button
         style="width: 100px;"
         :disabled="spinning"
@@ -222,6 +246,8 @@
     <stockOutDetail :openModal="showStockOut" :detailData="detailData" :salesBillSn="$route.params.sn || bizSn" @close="showStockOut=false"></stockOutDetail>
     <!-- 改单 -->
     <tipModal ref="tipModal" :openModal="openTipModal" :dataList="sourceData" @close="closeTipModal" @ok="openTipModalOk"></tipModal>
+    <!-- 经销商库存 弹窗 -->
+    <dealerStockModal :openModal="openDealerStock" @close="closeDealerStock" @ok="openDealerStockOk"></dealerStockModal>
   </div>
 </template>
 
@@ -236,6 +262,7 @@ import dsModal from '@/views/salesManagement/waitDispatchNew/dsModal.vue'
 import stockOutDetail from './stockOutDetailModal.vue'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import detailProductList from './comps/detailProductList.vue'
+import dealerStockModal from './comps/dealerStockModal.vue'
 import tipModal from './tipModal.vue'
 // 接口
 import { salesDetailBySn, salesDetailPrint, salesDetailExcel, salesDetailTypeExcel, salesWriteAuditPass, salesWriteAuditReject, salesWriteAuditPush, getThirdStockQty, salesPromoValidaSubmit, changeBillCheckUpdatePrice, changeBillCheck } from '@/api/salesNew'
@@ -243,7 +270,7 @@ import { salesDetailBySn, salesDetailPrint, salesDetailExcel, salesDetailTypeExc
 export default {
   name: 'SalesDetailNew',
   mixins: [commonMixin],
-  components: { VSelect, printModal, auditModal, dsModal, stockOutDetail, chooseWarehouse, detailProductList, tipModal },
+  components: { VSelect, printModal, auditModal, dsModal, stockOutDetail, chooseWarehouse, detailProductList, dealerStockModal,tipModal },
   props: {
     bizSn: { //  有值则为弹框,无值则为页面
       type: [Number, String],
@@ -270,7 +297,9 @@ export default {
       warehouseSn: undefined, // 所在仓库
       promoFlag: undefined, // 产品类型
       openTipModal: false, // 改单弹窗
-      sourceData: undefined// 价格变动数据
+      sourceData: undefined, // 价格变动数据
+      settleStyleSn: undefined, // 经销商库存查询
+      openDealerStock: false // 打开经销商库存弹窗
     }
   },
   computed: {
@@ -312,6 +341,16 @@ export default {
     //  返回
     handleBack () {
       this.$router.push({ name: 'salesQueryNewList' })
+    },
+    // 打开 经销商库存弹窗
+    openDealerModal () {
+      this.openDealerStock = true
+    },
+    closeDealerStock () {
+
+    },
+    openDealerStockOk () {
+
     },
     // 编辑
     handleEdit () {

+ 6 - 0
src/views/salesManagement/salesQueryNew/list.vue

@@ -95,6 +95,11 @@
                     allowClear></v-select>
                 </a-form-item>
               </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="发货经销商">
+                  <dealerSubareaScopeList ref="dealerSubareaScopeList" id="salesManagementList-buyerName" @change="custChange" />
+                </a-form-item>
+              </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="转费用报销单">
                   <a-select v-model="queryParam.expenseClainFlag" placeholder="请选择转费用报销单状态" allowClear>
@@ -192,6 +197,7 @@
             <span v-else>{{ record.salesBillNo }}</span>
             <a-badge :count="'改'+record.changeTimes" :number-style="{ zoom:'80%' }" v-if="record.changeTimes>0"></a-badge>
             <a-badge count="促" v-if="record.promoFlag==1" :number-style="{ backgroundColor: '#52c41a', zoom:'80%' }"></a-badge>
+            <a-badge count="转" :number-style="{ backgroundColor: '#ccb01e', zoom:'80%' }"></a-badge>
           </template>
           <!-- 出库仓库 -->
           <template slot="warehouseBox" slot-scope="text, record">