Ver código fonte

Merge branch 'develop_yh43' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh43

chenrui 11 meses atrás
pai
commit
0c42d07476

+ 2 - 2
src/views/dowloadFile/list.vue

@@ -29,7 +29,7 @@
       </div>
       <!-- 总计 -->
       <a-alert type="info" style="margin-bottom:10px">
-        <div slot="message">注意:所有文件只保留7天,超过7天后,状态变为过期,不能下载</div>
+        <div slot="message">注意:所有文件只保留7天,超过7天后,不能下载</div>
       </a-alert>
       <!-- 列表 -->
       <s-table
@@ -92,7 +92,7 @@ export default {
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
               const furl = data.list[i].fileUrl
-              data.list[i].fileUrl = furl ? furl.replace('http:',location.protocol) : ''
+              data.list[i].fileUrl = furl ? furl.replace('http:', location.protocol) : ''
             }
             this.total = data.count || 0
             this.disabled = false

+ 7 - 3
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -118,7 +118,8 @@ export default {
       showTableHead: true, // 是否显示表格头部
       colspanNums: 13, // 单元格合并列数
       hasOutStockOfActive: false,
-      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE // 空图片
+      simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, // 空图片
+      showStockCol: false
     }
   },
   computed: {
@@ -236,9 +237,12 @@ export default {
       }
       //  审核,需用到库存
       if (this.showStock) {
-        this.colspanNums = this.colspanNums + 2
+        this.colspanNums = this.colspanNums + 1
         arr.push({ title: '库存', field: 'stockQty', width: 80, key: 'm', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
-        arr.push({ title: '第三方库存', field: 'stockQty', width: 80, key: 'mm', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+        if (this.showStockCol) {
+          this.colspanNums = this.colspanNums + 1
+          arr.push({ title: '第三方库存', field: 'stockQty', width: 80, key: 'mm', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
+        }
       }
       this.colspanNums = this.colspanNums + 3
       arr = arr.concat([

+ 11 - 4
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -66,7 +66,6 @@
           <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
             <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" :id="'salesEdit-refresh-'+id">查询</a-button>
             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" :id="'salesEdit-reset-'+id">重置</a-button>
-            <a-button type="primary" style="margin-left: 15px" class="button-info" :id="'salesEdit-updateStock-'+id">第三方库存</a-button>
           </a-col>
         </a-row>
       </a-form>
@@ -84,6 +83,7 @@
             class="button-info"
             @click="showSearchBox=!showSearchBox" ><a-icon :type="showSearchBox?'close':'search'"/> 筛选</a-button>
           <!-- // 操作按钮 -->
+          <a-button type="link" class="button-info" @click="searchThreeStock" id="salesEdit-updateStock"><a-icon type="redo"/>第三方库存</a-button>
           <a-dropdown>
             <a-menu slot="overlay" @click="handleMenuClick" :id="'salesEdit-menu-'+id">
               <a-menu-item key="3" :disabled="disablePromo" :id="'salesEdit-menu-3'+id">
@@ -408,7 +408,8 @@ export default {
       promoProductClz: null, // 活动产品分类
       disablePromo: false, // 是否禁用活动
       countData: null, // 统计信息
-      warehouseTit: '' // 仓库设置唐卡标题
+      warehouseTit: '', // 仓库设置唐卡标题
+      showStockCol: false // 第三方库存是否显示
     }
   },
   computed: {
@@ -425,11 +426,13 @@ export default {
         { title: '起订量', dataIndex: 'unitQtyV', width: '6%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '6%', align: 'center' },
         { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '6%', align: 'center' },
-        { title: '第三方库存', dataIndex: 'stockQty', width: '6%', align: 'center', customRender: text => ((text || text == 0) ? text : '--') },
         { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '10%', align: 'center' },
         { title: '单位', dataIndex: 'productEntity.unit', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
       ]
+      if (this.showStockCol) {
+        arr.splice(6, 0, { title: '第三方库存', dataIndex: 'stockQty', width: '6%', align: 'center', customRender: text => ((text || text == 0) ? text : '--') })
+      }
       // 售价权限
       if (this.$hasPermissions('B_salesEdit_salesPrice')) {
         arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '6%', align: 'right', scopedSlots: { customRender: 'price' } })
@@ -440,7 +443,7 @@ export default {
           idx = idx + 1
           arr.splice(5, 0, { title: '折扣', dataIndex: 'discountPrice', width: '6%', align: 'right', scopedSlots: { customRender: 'discountPrice' } })
         }
-        arr.splice(9 + idx, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice((this.showStockCol ? 9 : 8) + idx, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
       return arr
     }
@@ -465,6 +468,10 @@ export default {
     showSearch () {
       this.showSearchBox = !this.showSearchBox
     },
+    // 查询第三方库存
+    searchThreeStock () {
+      this.showStockCol = true
+    },
     // 显示规则详细
     showDesc (descDetail) {
       this.showDescBox = !this.showDescBox

+ 11 - 4
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -32,7 +32,6 @@
           <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
             <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="salesEdit-refresh">查询</a-button>
             <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="salesEdit-reset">重置</a-button>
-            <a-button type="primary" style="margin-left: 15px" class="button-info" id="salesEdit-updateStock">第三方库存</a-button>
           </a-col>
         </a-row>
       </a-form>
@@ -44,6 +43,7 @@
           <span v-if="selectTotal" style="margin-right:5px;">已选{{ selectTotal }}项</span>
         </a-col>
         <a-col :md="16" :sm="24" style="text-align:right;">
+          <a-button type="link" class="button-info" @click="searchThreeStock" id="salesEdit-updateStock"><a-icon type="redo"/>第三方库存</a-button>
           <a-dropdown>
             <a-menu slot="overlay" @click="handleMenuClick">
               <a-menu-item key="3" id="salesEdit-pl-3">
@@ -279,7 +279,8 @@ export default {
       warehouseDataList: [], // 仓库列表
       countData: null, // 统计数据
       isInster: false, // 是否添加
-      warehouseTit: '' // 仓库设置弹框标题
+      warehouseTit: '', // 仓库设置弹框标题
+      showStockCol: false // 是否显示第三方库存
     }
   },
   computed: {
@@ -299,16 +300,18 @@ export default {
         { title: '产品名称', dataIndex: 'productEntity.name', scopedSlots: { customRender: 'productName' }, width: '20%', align: 'left' },
         { title: '销售数量', scopedSlots: { customRender: 'salesNums' }, width: '7%', align: 'center' },
         { title: '库存', dataIndex: 'stockQty', scopedSlots: { customRender: 'stockQty' }, width: '7%', align: 'center' },
-        { title: '第三方库存', dataIndex: 'stockQty', width: '8%', align: 'center', customRender: text => ((text || text == 0) ? text : '--') },
         { title: '出库仓库', scopedSlots: { customRender: 'warehouseBox' }, width: '10%', align: 'center' },
         { title: '单位', dataIndex: 'productEntity.unit', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
+      if (this.showStockCol) {
+        arr.splice(5, 0, { title: '第三方库存', dataIndex: 'stockQty', width: '8%', align: 'center', customRender: text => ((text || text == 0) ? text : '--') })
+      }
       // 售价权限
       if (this.$hasPermissions('B_salesEdit_salesPrice')) {
         arr.splice(3, 0, { title: '售价', dataIndex: 'price', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
         arr.splice(4, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } })
-        arr.splice(8, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
+        arr.splice(this.showStockCol ? 8 : 7, 0, { title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') })
       }
       return arr
     }
@@ -332,6 +335,10 @@ export default {
     openCpModal () {
       this.$emit('openCpModal', 0, 'productNormalList')
     },
+    // 查询第三方库存
+    searchThreeStock () {
+      this.showStockCol = true
+    },
     // 获取统计
     getCount () {
       salesDetaiCount(Object.assign(this.queryParam, { showStock: true })).then(res => {

+ 5 - 1
src/views/salesManagement/salesQueryNew/detail.vue

@@ -128,12 +128,12 @@
                   <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>
-                    <a-button v-if="showStock" type="primary" style="margin-left: 15px" class="button-info" id="salesDetail-updateStock">第三方库存</a-button>
                   </a-col>
                 </a-row>
               </a-form>
             </div>
             <div>
+              <a-button id="salesDetail-updateStock" v-if="showStock" @click="getThreeStock" type="link" 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>
             </div>
@@ -333,6 +333,10 @@ export default {
     searchTable () {
       this.$refs.productList.searchTable()
     },
+    // 查询第三方库存
+    getThreeStock () {
+      this.$refs.productList.showStockCol = true
+    },
     // 详情
     getDetail () {
       salesDetailBySn({ salesBillSn: this.bizSn || this.$route.params.sn }).then(res => {

+ 11 - 2
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -103,7 +103,7 @@
           <a-icon style="font-size: 14px;" type="question-circle" />
         </a-tooltip>
         <span style="margin-left: 10px;" v-if="selectedRowKeys.length">已选 {{ selectedRowKeys.length }} 项</span>
-        <a-button type="primary" style="margin-left: 15px" class="button-info" id="dispatch-updateStock">整单转采购单</a-button>
+        <a-button @click="showPurchaseModal" type="primary" style="margin-left: 15px" class="button-info" id="dispatch-updateStock">整单转采购单</a-button>
       </div>
       <div style="padding-left: 20px;">
         总销售数量:<strong>{{ detailData&&(detailData.totalQty || detailData.totalQty==0) ? detailData.totalQty : '--' }}</strong>;
@@ -141,6 +141,8 @@
       <div v-show="showEmpty" class="empty-data"><a-empty description="暂无产品" :image="simpleImage"/></div>
       <!-- 活动规则详情 -->
       <detailModal :openModal="openDetailModal" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
+      <!-- 转采购单 -->
+      <toPurchaseModal :openModal="openPurchaseModal" ref="purchaseModal"></toPurchaseModal>
     </a-spin>
 
   </div>
@@ -150,6 +152,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { salesPromoQueryList } from '@/api/salesNew'
 import detailModal from '@/views/promotionRulesManagement/dealerPromotions/detailModal.vue'
+import toPurchaseModal from './toPurchaseModal'
 import { Empty } from 'ant-design-vue'
 import { salesDetailAllList, salesPromoDetailCount, salesDetaiCount } from '@/api/salesDetailNew'
 import { STable, VSelect } from '@/components'
@@ -157,7 +160,7 @@ import chooseWarehouse from '@/views/common/chooseWarehouse'
 export default {
   name: 'QueryPart',
   mixins: [commonMixin],
-  components: { STable, VSelect, chooseWarehouse, detailModal },
+  components: { STable, VSelect, chooseWarehouse, detailModal, toPurchaseModal },
   props: {
     newLoading: { // loading
       type: Boolean,
@@ -176,6 +179,7 @@ export default {
     return {
       advanced: true, // 高级搜索 展开/关闭
       openDetailModal: false, // 活动规则详情弹框
+      openPurchaseModal: false, // 转采购单弹框
       simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
       detailSn: null, // 活动详情sn
       productType: [], // 产品类型
@@ -753,6 +757,11 @@ export default {
       })
 
       this.$emit('cancelProduct', obj)
+    },
+    // 打开整单转采购单
+    showPurchaseModal () {
+      this.openPurchaseModal = true
+      this.$refs.purchaseModal.setDetail(this.detailData)
     }
   }
 }

+ 158 - 0
src/views/salesManagement/waitDispatchNew/toPurchaseModal.vue

@@ -0,0 +1,158 @@
+<template>
+  <a-modal
+    centered
+    class="dealerAccountEdit-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="title"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="800">
+    <!-- 表单 -->
+    <div>
+      <a-spin :spinning="spinning" tip="Loading...">
+        <a-form-model
+          id="to-purchase-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="销售单号">
+            <span>{{ detailData ? detailData.salesBillNo : '--' }}</span>
+          </a-form-model-item>
+          <a-form-model-item label="客户名称">
+            <span>{{ detailData ? detailData.buyerName : '--' }}</span>
+          </a-form-model-item>
+          <a-form-model-item label="销售类型" prop="salesType">
+            <a-radio-group v-model="form.salesType" id="purchase-salesType">
+              <a-radio value="0">
+                平台购
+              </a-radio>
+              <a-radio value="1">
+                直购
+              </a-radio>
+            </a-radio-group>
+          </a-form-model-item>
+          <a-form-model-item label="直采分类" prop="directClass">
+            <a-radio-group v-model="form.directClass" id="purchase-directClass">
+              <a-radio value="1">
+                轮胎
+              </a-radio>
+            </a-radio-group>
+          </a-form-model-item>
+          <a-form-model-item label="备注">
+            <a-input
+              id="purchase-explainInfo"
+              type="textarea"
+              :maxLength="30"
+              v-model.trim="form.remark"
+              placeholder="请输入备注(最多30字符)"
+              allowClear />
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button id="purchase-back" @click="isShow = false">取消</a-button>
+          <a-button type="primary" id="purchase-save" @click="handleSave" style="margin-left: 15px;">确定</a-button>
+        </div>
+      </a-spin>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { dealerRecevieAddrQuery } from '@/api/dealerRecevieAddr'
+export default {
+  name: 'DsModal',
+  mixins: [commonMixin],
+  components: { },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    title: {
+      type: String,
+      default: '整单转采购单'
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        salesNo: '',
+        salesType: undefined,
+        directClass: undefined,
+        remark: ''
+      },
+      rules: {
+        salesType: [{ required: true, message: '请选择销售类型', trigger: 'change' }],
+        directClass: [{ required: true, message: '请选择直采分类', trigger: 'change' }]
+      },
+      detailData: null //  详情数据
+    }
+  },
+  methods: {
+    //  保存
+    handleSave () {
+      const _this = this
+      _this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const formData = JSON.parse(JSON.stringify(_this.form))
+          _this.$emit('ok', formData)
+          _this.isShow = false
+        } else {
+          return false
+        }
+      })
+    },
+    //  获取详情
+    setDetail (data) {
+      this.detailData = data
+    },
+    // 重置表单
+    resetForm () {
+      this.detailData = null
+      this.$refs.ruleForm.resetFields()
+      this.form = {
+        salesNo: '',
+        salesType: undefined,
+        directClass: undefined,
+        remark: ''
+      }
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetForm()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .dealerAccountEdit-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>