فهرست منبع

Merge branch 'develop_yh18' of jianguan-web/jg-ocs-html into pre-release

李磊 2 سال پیش
والد
کامیت
1ef326d591

BIN
public/templ/批量下线导入模板.xlsx


BIN
public/templ/散件入库产品导入模板.xlsx


+ 1 - 1
public/version.json

@@ -1,4 +1,4 @@
 {
-    "version": "2.2.24",
+    "version": "2.2.28",
     "message": "发现有新版本发布,确定更新系统?"
 }

+ 52 - 0
src/api/product.js

@@ -439,3 +439,55 @@ export const priceChangeEnabled = (params) => {
     method: 'post'
   })
 }
+
+/*
+* 批量导入下线产品
+*/
+// 批量导入下线产品
+export const offlineImport = (params) => {
+  return axios({
+    url: '/product/offline/import',
+    data: params,
+    method: 'post'
+  })
+}
+// 导出错误项产品
+export const exportErrorOffline = (params) => {
+  return axios({
+    url: '/product/offline/exportError',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+
+// 批量保存产品
+export const importSaveBatch = (params) => {
+  return axios({
+    url: '/product/offline/importSaveBatch',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 产品状态信息
+export const queryOnlinePage = (params) => {
+  const url = `/product/queryOnlinePage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 产品状态信息 导出
+export const excelOnlineList = (params) => {
+  return axios({
+    url: '/product/excelOnlineList',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 9 - 1
src/api/salesReturn.js

@@ -262,4 +262,12 @@ export const salesReturnDetailImportError = (params) => {
     method: 'post',
     responseType: 'blob'
   })
-}
+}
+// 获取审批人员默认值
+export const queryLastFinishDingUser = (params) => {
+  return axios({
+    url: '/salesReturn/queryLastFinishDingUser',
+    data: params,
+    method: 'post'
+  })
+}

+ 3 - 1
src/components/Table/index.js

@@ -27,6 +27,9 @@ export default {
       type: [String, Function],
       default: ''
     },
+    pagination:{
+      type: Object
+    },
     data: {
       type: Function,
       required: true
@@ -124,7 +127,6 @@ export default {
     this.localPagination = ['auto', true].includes(this.showPagination) && Object.assign({}, this.localPagination, {
       current: localPageNum,
       pageSize: this.pageSize,
-      pageSizeOptions: ['5', '10', '20', '30', '40'],
       showTotal: total => `共 ${total} 条记录`,
       showSizeChanger: this.showSizeChanger
     }) || false

+ 25 - 0
src/config/router.config.js

@@ -2547,6 +2547,31 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/productManagement/productNotOnline',
+            redirect: '/productManagement/productNotOnline/list',
+            name: 'productNotOnline',
+            component: BlankLayout,
+            meta: {
+              title: '产品状态信息',
+              icon: 'fall',
+              permission: 'M_productNotOnlineList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'productNotOnlineList',
+                component: () => import(/* webpackChunkName: "productManagement" */ '@/views/productManagement/productNotOnline/list.vue'),
+                meta: {
+                  title: '产品状态信息列表',
+                  icon: 'fall',
+                  hidden: true,
+                  permission: 'M_productNotOnlineList'
+                }
+              }
+            ]
+          },
           {
             path: '/productManagement/priceChangeRecord',
             redirect: '/productManagement/priceChangeRecord/list',

+ 3 - 1
src/views/allocationManagement/transferOut/edit.vue

@@ -229,6 +229,8 @@
               @rowSelection="rowSelectionFun"
               :columns="chooseColumns"
               :data="chooseLoadData"
+              :pagination="{pageSizeOptions: ['20','50','100','200','500']}"
+              :pageSize="20"
               :scroll="{ y: 300 }"
               bordered>
               <!-- 售价 -->
@@ -741,7 +743,7 @@ export default {
       const _this = this
       this.spinning = true
       const params = { allocateSn: this.outBizSn || this.$route.params.sn, printType: printType, ...data }
-      
+
       exportExcel(allocateBillDetailExcel, params, filename, function () {
         _this.spinning = false
         _this.$store.state.app.curActionPermission = ''

+ 1 - 1
src/views/dealerManagement/merchantInfoManagement/list.vue

@@ -223,7 +223,7 @@ export default {
     },
     // 经销权
     handleDistribution (row) {
-      this.$router.push({ name: `merchantInfoManagementSet`, params: { sn: row.dealerSn } })
+      this.$router.push({ name: `merchantInfoManagementSet`, params: { sn: row.dealerSn, name: row.dealerName } })
     },
     // 审核
     handleAudit (row) {

+ 1 - 0
src/views/dealerManagement/merchantInfoManagement/permissionSetting.vue

@@ -5,6 +5,7 @@
         <!-- 自定义的二级文字标题 -->
         <template slot="subTitle">
           <a id="permissionSetting-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
+          <span style="margin-left: 20px;color: #666;">经销商:{{ $route.params.name }}</span>
         </template>
       </a-page-header>
       <a-card size="small" :bordered="false" class="permissionSetting-main">

+ 4 - 1
src/views/financialManagement/collectionDetailStatic/list.vue

@@ -172,7 +172,8 @@
           :data="loadData"
           :row-selection="{ columnWidth: 40 }"
           @rowSelection="rowSelectionFun"
-          :scroll="{ y: tableHeight }"
+          :scroll="{ y: tableHeight-45}"
+          :defaultLoadData="false"
           bordered>
           <!-- 开票日期 -->
           <template slot="draftDate" slot-scope="text, record">
@@ -332,6 +333,8 @@ export default {
         { title: '仓库', dataIndex: 'warehouseName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '收款事由', dataIndex: 'bookReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '收款日期', dataIndex: 'receiptDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '区域', dataIndex: 'subareaArea.subareaName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
         { title: '付款方类型', dataIndex: 'payerTypeDictValue', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
         { title: '付款方', dataIndex: 'payerName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
         { title: '财务编码', dataIndex: 'kdMidCustomerFnumber', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },

+ 32 - 9
src/views/productManagement/productInfo/importGuideModal.vue

@@ -16,10 +16,19 @@
           </div>
           <ul>
             <li>1) 请先下载导入模板,模板中已标示出必填项</li>
-            <li>2) 产品编码具有唯一性,系统中已存在的无法导入</li>
-            <li>3) 产品品牌、产品分类、单位、包装数单位,必须是系统中已经存在的值,否则无法导入</li>
+            <li>2) 产品编码具有唯一性,{{ guideType=='1'?'系统中已存在的无法导入':'下线导入,必须是系统中已存在的产品编码' }}</li>
+            <li v-if="guideType=='1'">3) 产品品牌、产品分类、单位、包装数单位,必须是系统中已经存在的值,否则无法导入</li>
+            <li v-if="guideType=='2'"><a :href="filePath" style="margin: 5px 0 0 15px;display: block;">
+              <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+            </a></li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
+          <a-button
+            v-if="guideType=='1'"
+            type="link"
+            icon="download"
+            style="padding: 0 0 0 23px;"
+            :loading="exportLoading"
+            @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -59,17 +68,19 @@
     </div>
     <!-- 导入 -->
     <chooseImportModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+    <offlineImportModal :openModal="openOfflineImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
   </a-modal>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
 import ChooseImportModal from './chooseImportModal.vue'
+import offlineImportModal from './offlineImportModal.vue'
 import { Upload } from '@/components'
 export default {
   name: 'SalesImportGuideModal',
   mixins: [commonMixin],
-  components: { ChooseImportModal, Upload },
+  components: { ChooseImportModal, offlineImportModal, Upload },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -78,6 +89,10 @@ export default {
     params: {
       type: Object,
       default: null
+    },
+    guideType: {
+      type: String,
+      default: ''
     }
   },
   data () {
@@ -89,16 +104,23 @@ export default {
       uploadParams: {
         savePathType: 'local'
       },
-      exportLoading: false
+      exportLoading: false,
+      openOfflineImportModal: false,
+      filePath: location.protocol + '//' + location.host + '/templ/批量下线导入模板.xlsx'
     }
   },
   methods: {
     // 下一步
     handlerNextStep () {
-      if (this.paramsData) {
-        this.openImportModal = true
+      const _this = this
+      if (_this.paramsData) {
+        if (_this.guideType == 1) {
+          _this.openImportModal = true
+        } else {
+          _this.openOfflineImportModal = true
+        }
       } else {
-        this.$message.warning('添加文件后再进行下一步操作!')
+        _this.$message.warning('添加文件后再进行下一步操作!')
       }
     },
     // 上传文件  change
@@ -111,7 +133,7 @@ export default {
     },
     // 导入
     hanldeOk (obj) {
-      if (obj && obj.length > 0) {
+      if (obj) {
         this.$emit('ok', obj)
         this.isShow = false
       }
@@ -119,6 +141,7 @@ export default {
     // 关闭
     handleClose () {
       this.openImportModal = false
+      this.openOfflineImportModal = false
       this.isShow = false
     },
     // 下载模板

+ 33 - 12
src/views/productManagement/productInfo/list.vue

@@ -101,13 +101,19 @@
           :loading="loadingDownline"
           @click="handleBatchDownline"
           style="margin: 0 10px;">批量下线</a-button>
-        <a-button
-          id="productInfoList-batchImport"
+        <!-- <a-button
           v-if="$hasPermissions('B_productInfo_batchImport')"
           type="primary"
           class="button-error"
           @click="openGuideModal=true"
-          style="margin: 0 10px;">批量导入</a-button>
+          style="margin: 0 10px;">批量导入</a-button> -->
+        <a-dropdown id="productInfoList-batchImport">
+          <a-menu slot="overlay" @click="handleMenuClick">
+            <a-menu-item key="1" v-if="$hasPermissions('B_productInfo_batchImport')">新增产品导入</a-menu-item>
+            <a-menu-item key="2">下线产品导入</a-menu-item>
+          </a-menu>
+          <a-button type="primary" class="button-error" style="margin: 0 10px;"> 批量导入 <a-icon type="down" /> </a-button>
+        </a-dropdown>
         <span style="margin-left: 8px" v-if="$hasPermissions('B_productInfo_batchAudit') || $hasPermissions('B_productInfo_batchLaunch') || $hasPermissions('B_productInfo_batchDownline')">
           <template v-if="rowSelectionInfo && rowSelectionInfo.selectedRowKeys.length>0">{{ `已选 ${rowSelectionInfo.selectedRowKeys.length} 项` }}</template>
         </span>
@@ -203,7 +209,7 @@
     <!-- 产品下线 -->
     <product-info-offline-modal v-drag :openModal="openOfflineModal" :offlineProductList="offlineProductList" @close="closeOfflineModal" @ok="$refs.table.refresh()" />
     <!-- 导入产品 -->
-    <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="hanldeOk" />
+    <importGuideModal :guideType="guideModalType" :openModal="openGuideModal" @close="openGuideModal=false" @ok="hanldeOk" />
   </a-card>
 </template>
 
@@ -217,7 +223,7 @@ import productTypeAll from '@/views/common/productTypeAll.js'
 import { exportExcel } from '@/libs/JGPrint.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import importGuideModal from './importGuideModal.vue'
-import { productList, productAudit, productBatchAudit, productDel, productOnline, productBatchOnline, productExport, saveBatchImportProduct } from '@/api/product'
+import { productList, productAudit, productBatchAudit, productDel, productOnline, productBatchOnline, productExport, saveBatchImportProduct, importSaveBatch } from '@/api/product'
 export default {
   name: 'ProductInfoList',
   mixins: [commonMixin],
@@ -286,7 +292,8 @@ export default {
       openOfflineModal: false, //  下线  弹框
       offlineProductList: [], //  下线 当前所选数据
       pageFromInfo: null,
-      rowSelectionInfo: null
+      rowSelectionInfo: null,
+      guideModalType: ''// 1 新增产品批量导入 2下线产品批量导入
     }
   },
   computed: {
@@ -296,6 +303,11 @@ export default {
     }
   },
   methods: {
+    // 批量导入
+    handleMenuClick (e) {
+      this.guideModalType = e.key
+      this.openGuideModal = true
+    },
     //  创建时间  change
     dateChange (date) {
       this.queryParam.updateBeginDate = date[0] || ''
@@ -308,12 +320,21 @@ export default {
     // 批量导入产品
     hanldeOk (obj) {
       this.spinning = true
-      saveBatchImportProduct(obj).then(res => {
-        if (res.status == 200) {
-          this.resetSearchForm()
-        }
-        this.spinning = false
-      })
+      if (obj && obj.type && obj.type == 'offline') { // 下线导入
+        importSaveBatch(obj).then(res => {
+          if (res.status == 200) {
+            this.resetSearchForm()
+          }
+          this.spinning = false
+        })
+      } else {
+        saveBatchImportProduct(obj).then(res => {
+          if (res.status == 200) {
+            this.resetSearchForm()
+          }
+          this.spinning = false
+        })
+      }
     },
     // 审核
     handleAudit (row) {

+ 266 - 0
src/views/productManagement/productInfo/offlineImportModal.vue

@@ -0,0 +1,266 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="60%">
+    <div class="chooseImport-con">
+      <!-- 可导入数据 -->
+      <p style="font-weight:bold;">可导入数据{{ loadData.length }}条,确认要批量下线吗?</p>
+      <a-form-model :model="form" ref="ruleForm" :rules="rules" :label-col="labelCol" :wrapper-col="wrapperCol">
+        <a-form-model-item label="下线选项" prop="offlineReasonType">
+          <v-select
+            code="OFFLINE_REASON_TYPE"
+            id="productInfoOffline-offlineReasonType"
+            v-model="form.offlineReasonType"
+            allowClear
+            placeholder="请选择下线选项"
+          ></v-select>
+        </a-form-model-item>
+        <a-form-model-item label="通用编码" :required="form.offlineReasonType=='通用'">
+          <a-table
+            class="sTable"
+            ref="table"
+            size="small"
+            :rowKey="(record) => record.allocateSn"
+            :columns="nowColumns"
+            :dataSource="loadData"
+            :loading="loading"
+            :scroll="{ y: 200}"
+            :pagination="false"
+            bordered>
+            <template slot="currency" slot-scope="text, record">
+              <productCodeList :ref="'productCodeList'+record.no" :dealerVal="record.commonName" @change="e => productCodeChange(e, record)" />
+            </template>
+          </a-table>
+        </a-form-model-item>
+        <a-form-model-item label="下线备注">
+          <a-textarea
+            v-model="form.offlineRemark"
+            placeholder="请输入下线备注(最多60个字符)"
+            :maxLength="60"
+            :auto-size="{ minRows: 2, maxRows: 5 }"
+            allowClear
+          />
+        </a-form-model-item>
+      </a-form-model>
+
+      <a-divider />
+      <!-- 不可导入数据 -->
+      <p class="red">不可导入数据{{ unLoadData.length }}条</p>
+      <a-table
+        class="sTable"
+        ref="unTable"
+        size="small"
+        :rowKey="(record) => record.errorDesc"
+        :columns="nowUnColumns"
+        :dataSource="unLoadData"
+        :loading="loading"
+        :scroll="{ y: 200}"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="chooseImport-submit"
+          size="large"
+          :class="loadData.length==0?'button-grey':'button-primary'"
+          @click="handleSubmit"
+          style="padding: 0 40px;">确认导入</a-button>
+        <a-button
+          id="chooseImport-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 40px;margin-left: 15px;">取消</a-button>
+        <a-button
+          type="primary"
+          id="chooseImport-error"
+          size="large"
+          class="button-error"
+          @click="handleError"
+          style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { VSelect } from '@/components'
+import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { offlineImport, exportErrorOffline } from '@/api/product'
+import productCodeList from '@/views/common/productCodeList.vue'
+export default {
+  name: 'SalesChooseImportModal',
+  mixins: [commonMixin],
+  components: { VSelect, productCodeList },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: {
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      labelCol: { span: 2 },
+      wrapperCol: { span: 22 },
+      isShow: this.openModal, //  是否打开弹框
+      nowColumns: [
+        { title: '序号', dataIndex: 'no', width: '3%', align: 'center' },
+        { title: '产品编码', dataIndex: 'code', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '通用编码', scopedSlots: { customRender: 'currency' }, width: '5%', align: 'center' }
+      ],
+      loadData: [],
+      form: {
+        type: 'offline',
+        offlineReasonType: undefined,
+        offlineRemark: '',
+        offlineProductList: []
+      },
+      nowUnColumns: [
+        { title: '序号', dataIndex: 'no', width: '3%', align: 'center' },
+        { title: '产品编码', dataIndex: 'code', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '通用编码', dataIndex: 'commonCode', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'remark', width: '5%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      unLoadData: [],
+      loading: false,
+      rules: {
+        offlineReasonType: [
+          { required: true, message: '请选择下线选项', trigger: 'change' }
+        ]
+      }
+    }
+  },
+  methods: {
+    productCodeChange (val, row) {
+      row.commonSn = val.key
+      if (val && val.row) {
+        row.commonCode = val.row.code
+      }
+    },
+    getData () {
+      const _this = this
+      this.loading = true
+      const params = {
+        path: this.paramsData.path
+      }
+      offlineImport(params).then(res => {
+        _this.loading = false
+        if (res.status == 200) {
+          if (res.data.rightList && res.data.rightList.length > 0) {
+            res.data.rightList.map((item, index) => {
+              item.no = index + 1
+              _this.$nextTick(() => {
+                const val = 'productCodeList' + item.no
+                _this.$refs[val].setData({ key: item.commonCode })
+              })
+            })
+          }
+          if (res.data.errorList && res.data.errorList.length > 0) {
+            res.data.errorList.map((item, index) => {
+              item.no = index + 1
+            })
+          }
+          _this.loadData = res.data.rightList || []
+          _this.unLoadData = res.data.errorList || []
+        }
+      })
+    },
+    // 确认导入
+    handleSubmit () {
+      if (this.loadData.length == 0) {
+        this.$message.warning('无可导入产品!')
+      } else {
+        const _this = this
+        this.$refs.ruleForm.validate(valid => {
+          if (valid) {
+            // 通用必填时判断
+            _this.isHandleOk()
+          } else {
+            return false
+          }
+        })
+      }
+    },
+    isHandleOk () {
+      const _this = this
+      if (_this.form.offlineReasonType === '通用') {
+        const flag = _this.loadData.some(item => !item.commonSn)
+        if (flag) {
+          _this.$message.warning('通用编码不能为空!')
+          return
+        }
+      }
+      _this.$set(_this.form, 'offlineProductList', _this.loadData)
+      _this.$emit('ok', JSON.parse(JSON.stringify(_this.form)))
+      _this.isShow = false
+    },
+    // 导出
+    handleError () {
+      const _this = this
+      if (_this.unLoadData.length < 1) {
+        _this.$message.info('暂无可导出的错误项~')
+        return
+      }
+      _this.spinning = true
+      hdExportExcel(exportErrorOffline, _this.unLoadData, '导出产品错误项', function () {
+        _this.spinning = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.loadData = []
+        this.unLoadData = []
+        this.form = {
+          type: 'offline',
+          offlineReasonType: undefined,
+          offlineRemark: '',
+          offlineProductList: []
+        }
+        this.$refs.ruleForm.resetFields()
+      } else {
+        this.getData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseImport-modal{
+    .chooseImport-con{
+      .red{
+        color: #f30;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel,.button-error{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 267 - 0
src/views/productManagement/productNotOnline/list.vue

@@ -0,0 +1,267 @@
+<template>
+  <a-card size="small" :bordered="false" class="productPricingList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="searchForm">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品名称">
+                <a-input id="productPricingList-name" v-model.trim="queryParam.name" allowClear placeholder="请输入产品名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品编码/原厂编码">
+                <a-input id="productPricingList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入产品编码/原厂编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="品牌">
+                <ProductBrand id="productPricingList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+              </a-form-item>
+            </a-col>
+            <template v-if="advanced">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="产品分类">
+                  <ProductType id="productPricingList-productType" placeholder="请选择产品分类" @change="changeProductType" v-model="productType"></ProductType>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="定价时间">
+                  <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="定价状态">
+                  <v-select code="PRICING_STATUS" id="productPricingList-pricingState" v-model="queryParam.pricingState" allowClear placeholder="请选择定价状态"></v-select>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="产品状态">
+                  <v-select code="PRODUCT_STATUS" id="productInfoList-state" v-model="queryParam.state" allowClear placeholder="请选择产品状态"></v-select>
+                </a-form-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="searchForm" :disabled="disabled" id="productPricingList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="productPricingList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                v-if="$hasPermissions('B_ProductPriceExoprt')"
+                id="productInfoList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator" style="text-align:right;">
+        <a-checkbox v-model="zeroQtyFlag" id="inventoryQueryList-zeroQtyFlag" @change="handleChangeQty">仅显示有库存</a-checkbox>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.no"
+        rowKeyName="no"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 产品分类 -->
+        <template slot="productType" slot-scope="text, record">
+          <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+          <span v-else>--</span>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { STable, VSelect } from '@/components'
+import { exportExcel } from '@/libs/JGPrint.js'
+import { queryOnlinePage, excelOnlineList } from '@/api/product'
+import ProductType from '@/views/common/productType.js'
+import ProductBrand from '@/views/common/productBrand.js'
+export default {
+  name: 'ProductPricingList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, rangeDate, ProductBrand, ProductType },
+  data () {
+    return {
+      spinning: false,
+      advanced: true, // 高级搜索 展开/关闭
+      tableHeight: 0,
+      time: [],
+      queryParam: { //  查询条件
+        name: '', //  产品名称
+        queryWord: '', // 产品编码/原厂编码
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        pricingState: undefined, //  定价状态
+        pricingTimeBegin: undefined, // 定价时间
+        pricingTimeEnd: undefined,
+        state: undefined, // 产品状态
+        stockFlag: undefined
+      },
+      zeroQtyFlag: false,
+      productType: [],
+      disabled: false, //  查询、重置按钮是否可操作
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return queryOnlinePage(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'name', align: 'left', width: '10%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'code', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'origCode', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '品牌', dataIndex: 'productBrandName', width: '5%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '7%', align: 'center' },
+        { title: '仓库', dataIndex: 'warehouseName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '可用库存', dataIndex: 'currentStockQty', width: '5%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '第一次入库时间', dataIndex: 'skCreateDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '定价状态', dataIndex: 'pricingStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '定价时间', dataIndex: 'pricingTime', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '最新成本', dataIndex: 'lastStockCost', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '省级价', dataIndex: 'provincePrice', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '市级价', dataIndex: 'cityPrice', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '特约价', dataIndex: 'specialPrice', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '终端价', dataIndex: 'terminalPrice', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '车主价', dataIndex: 'carOwnersPrice', width: '5%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    //  定价时间  change
+    dateChange (date) {
+      this.queryParam.pricingTimeBegin = date[0]
+      this.queryParam.pricingTimeEnd = date[1]
+    },
+    handleChangeQty (e) {
+      this.zeroQtyFlag = e.target.checked
+      this.queryParam.stockFlag = e.target.checked ? '1' : undefined
+      this.$refs.table.refresh(true)
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.name = ''
+      this.queryParam.queryWord = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.pricingState = undefined
+      this.queryParam.stockFlag = undefined
+      this.zeroQtyFlag = false
+
+      this.queryParam.pricingTimeBegin = undefined
+      this.queryParam.pricingTimeEnd = undefined
+      this.queryParam.state = undefined
+      this.time = []
+      this.$refs.rangeDate.resetDate(this.time)
+      this.productType = []
+      this.$refs.table.clearSelected() // 清空表格选中项
+      this.$refs.table.refresh(true)
+    },
+    searchForm () {
+      this.$refs.table.clearSelected() // 清空表格选中项
+      this.$refs.table.refresh(true)
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      const params = this.queryParam
+      this.spinning = true
+      exportExcel(excelOnlineList, params, '产品状态信息导出', function () {
+        _this.spinning = false
+      })
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 235
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>

+ 8 - 18
src/views/purchasingManagement/bulkWarehousingOrder/importGuideModal.vue

@@ -17,9 +17,13 @@
           <ul>
             <li>1) 导入的Excel文件中必须包含名为“产品编码”、“数量”、“成本价”的列,且名称必须相同</li>
             <li>2) 除了“产品编码”、“数量”、“成本价”三列,其他列可自定义,不影响数据导入</li>
-            <li>3) “成本价”为0或输入的价格与系统相同时,允许导入,成本价为0按赠品处理</li>
+            <li>3) “成本价”为空或0时,允许导入;成本价为空,自动获取系统成本价;成本价为0,按赠品处理</li>
+            <li>
+              <a :href="filePath" style="margin: 5px 0 0;display: block;">
+                <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+              </a>
+            </li>
           </ul>
-          <a-button type="link" icon="download" style="padding: 0 0 0 23px;" :loading="exportLoading" @click="handleExport">下载导入模板</a-button>
         </div>
         <div class="explain-item">
           <div class="explain-tit">
@@ -65,8 +69,6 @@
 <script>
 import ChooseImportModal from './chooseImportModal.vue'
 import { Upload } from '@/components'
-import { hdExportExcel } from '@/libs/exportExcel'
-import { sparePartsDetailDownload } from '@/api/spareParts'
 export default {
   name: 'ImportGuideModal',
   components: { ChooseImportModal, Upload },
@@ -89,7 +91,8 @@ export default {
       uploadParams: {
         savePathType: 'local'
       },
-      exportLoading: false
+      exportLoading: false,
+      filePath: location.protocol + '//' + location.host + '/templ/散件入库产品导入模板.xlsx'
     }
   },
   methods: {
@@ -121,19 +124,6 @@ export default {
     handleClose () {
       this.openImportModal = false
       this.isShow = false
-    },
-    //  导出
-    handleExport () {
-      const _this = this
-      const params = { grabFlag: this.params.grabFlag }
-      this.spinning = true
-      this.exportLoading = true
-      setTimeout(() => {
-        _this.exportLoading = false
-      }, 1000)
-      hdExportExcel(sparePartsDetailDownload, params, '散件入库导入模板', function () {
-        _this.spinning = false
-      })
     }
   },
   watch: {

+ 13 - 13
src/views/reportData/hPriceDifferenceDetailReport/list.vue

@@ -61,7 +61,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="区域负责人">
-                    <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
+                  <BizUser v-model="queryParam.subareaArea.bizUserSn"></BizUser>
                 </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -165,7 +165,7 @@ export default {
           dealerLevel: undefined,
           provinceSn: undefined
         },
-        subareaArea:{
+        subareaArea: {
           subareaSn: undefined,
           subareaAreaSn: undefined,
           bizUserSn: undefined
@@ -221,18 +221,18 @@ export default {
   },
   computed: {
     columns () {
-      let _this=this
+      const _this = this
       const arr = [
         { title: '区域', dataIndex: 'subareaArea.subareaName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '区域负责人', dataIndex: 'subareaArea.bizUserName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '订单号', dataIndex: 'bizNo', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '日期', dataIndex: 'bizCreateDate', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '省份', dataIndex: 'dealer.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '省份', dataIndex: 'provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '直接绑定客户名称', dataIndex: 'directDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '间接绑定客户名称', dataIndex: 'indirectDealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'dealer.dealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户级别', dataIndex: 'dealer.dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'buyerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '客户级别', dataIndex: 'buyerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌', dataIndex: 'productBrandName', width: 130, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '二级分类', dataIndex: 'productTypeName2', width: 130, align: 'center', customRender: function (text) { return text || '--' } },
         { title: '数量', dataIndex: 'qty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
@@ -243,11 +243,11 @@ export default {
         // { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
         { title: '类型', dataIndex: 'bizTypeValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } }
       ]
-        arr.splice(11, 0, { title: '分公司金额', dataIndex: 'wholesalePrice1', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(12, 0, { title: '加盟商金额', dataIndex: 'wholesalePrice2', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(13, 0, { title: '特约加盟店金额', dataIndex: 'wholesalePrice3', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(14, 0, { title: '直接差价', dataIndex: 'directRebateAmount', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
-        arr.splice(15, 0, { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(11, 0, { title: '分公司金额', dataIndex: 'wholesalePrice1', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(12, 0, { title: '加盟商金额', dataIndex: 'wholesalePrice2', width: 90, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(13, 0, { title: '特约加盟店金额', dataIndex: 'wholesalePrice3', width: 100, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(14, 0, { title: '直接差价', dataIndex: 'directRebateAmount', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      arr.splice(15, 0, { title: '间接差价', dataIndex: 'indirectRebateAmount', width: 80, align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
       return arr
     }
   },
@@ -315,7 +315,7 @@ export default {
       this.queryParam.product.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.product.productTypeSn3 = val[2] ? val[2] : ''
     },
-    subareaChange(val){
+    subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
@@ -343,7 +343,7 @@ export default {
       this.queryParam.bizType = undefined
       this.productType = []
       this.totalData = null
-      if(this.advanced){
+      if (this.advanced) {
         this.$refs.subarea.clearData()
       }
       this.$refs.custList.resetForm()

+ 31 - 1
src/views/salesReturnManagement/salesReturn/chooseDepartUserModal.vue

@@ -82,6 +82,7 @@ import { VSelect, Upload } from '@/components'
 import dingDepartUser from '@/views/common/dingDepartUser.js'
 import employee from '@/views/expenseManagement/expenseReimbursement/employee.js'
 import { sign } from 'core-js/fn/number'
+import { queryLastFinishDingUser } from '@/api/salesReturn'
 export default {
   name: 'ChooseDepartUserModal',
   components: { dingDepartUser, employee, VSelect, Upload },
@@ -89,6 +90,10 @@ export default {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
+    },
+    showDefUser: { // 是否显示默认值
+      type: Boolean,
+      default: true
     }
   },
   data () {
@@ -152,6 +157,13 @@ export default {
       })
       return ret.join(',')
     },
+    getFormatUser (data) {
+      const ret = []
+      data.map(item => {
+        ret.push({ label: item.userName, value: item.userId || item.userid })
+      })
+      return ret
+    },
     // 确定
     handleSave (e) {
       e.preventDefault()
@@ -160,13 +172,13 @@ export default {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
           form.attachmentList = this.attachList
+
           if (form.approvers) {
             form.approvers = this.getTreeVal(form.approvers)
           }
           if (form.ccList) {
             form.ccList = this.getTreeVal(form.ccList)
           }
-          console.log(form)
           this.$emit('submit', form)
           this.$emit('close')
         } else {
@@ -204,6 +216,22 @@ export default {
     },
     cancel () {
       this.isShow = false
+    },
+    pageInit () {
+      // 获取审批人员默认值
+      if (this.showDefUser) {
+        queryLastFinishDingUser({}).then(res => {
+          if (res.status == 200) {
+            this.form.applyPersonSn = res.data.applyPersonSn
+            if (res.data.approversTaskList) {
+              this.form.approvers = this.getFormatUser(res.data.approversTaskList)
+            }
+            if (res.data.ccTaskList) {
+              this.form.ccList = this.getFormatUser(res.data.ccTaskList)
+            }
+          }
+        })
+      }
     }
   },
   watch: {
@@ -216,6 +244,8 @@ export default {
       if (!newValue) {
         this.$emit('close')
         this.resetForm()
+      } else {
+        this.pageInit()
       }
     }
   }

+ 12 - 12
src/views/salesReturnManagement/salesReturn/salesReturnEdit.vue

@@ -8,14 +8,14 @@
           <span style="margin: 0 15px;color: #666;">客户名称:{{ ordeDetail&&ordeDetail.buyerName || '--' }}</span>
           <span style="margin: 0 15px;color: #666;" v-if="ordeDetail">
             退货仓库:<warehouse
-               style="width:200px;"
-               :allowClear="false"
-               disabled
-                v-model="ordeDetail.warehouseSn"
-                @change="updateWarehouse"
-                id="basicInfo-warehouseSn"
-                placeholder="请选择退货仓库"
-              />
+              style="width:200px;"
+              :allowClear="false"
+              disabled
+              v-model="ordeDetail.warehouseSn"
+              @change="updateWarehouse"
+              id="basicInfo-warehouseSn"
+              placeholder="请选择退货仓库"
+            />
           </span>
         </template>
         <!-- 操作区,位于 title 行的行尾 -->
@@ -141,7 +141,7 @@
         id="salesReturn-handleSubmit">提交</a-button>
     </div>
     <!-- 选择审核人员 -->
-    <chooseDepartUserModal ref="chooseDepart" :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSubmit"></chooseDepartUserModal>
+    <chooseDepartUserModal ref="chooseDepart" :showDefUser="true" :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSubmit"></chooseDepartUserModal>
     <!-- 导入产品 -->
     <importGuideModal :openModal="openGuideModal" :params="{salesReturnBillSn: $route.params.sn}" @close="closeGuideModel" @ok="hanldeOk" />
     <!-- 批量设置退货原因 -->
@@ -309,10 +309,10 @@ export default {
       }
     },
     // 修改仓库
-    updateWarehouse(warehouseSn){
+    updateWarehouse (warehouseSn) {
       const _this = this
       _this.spinning = true
-      const params = {id:this.ordeDetail.id,warehouseSn: warehouseSn}
+      const params = { id: this.ordeDetail.id, warehouseSn: warehouseSn }
       salesReturnModify(params).then(res => {
         if (res.status == 200) {
           _this.$message.success(res.message)
@@ -379,7 +379,7 @@ export default {
     getOrderDetail (flag) {
       salesReturnDetail({ sn: this.orderSn }).then(res => {
         this.ordeDetail = res.data || null
-        if(!flag){
+        if (!flag) {
           this.$refs.partQuery.pageInit(this.buyerSn, this.ordeDetail.warehouseSn)
         }
       })

+ 18 - 9
src/views/supplierManagement/costSetting/list.vue

@@ -93,12 +93,19 @@
               v-if="record.auditState=='WAIT'&&$hasPermissions('B_costSetAudit')"
               @click="handleAudit([record.supplierProductSn])"
             >审核</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              v-if="record.auditState=='WAIT'&&$hasPermissions('B_costSetting')"
+              @click="handleCostSet(record,editFlag = true)"
+            >编辑</a-button>
             <a-button
               size="small"
               type="link"
               class="button-warning"
               v-if="record.auditState!='WAIT'&&$hasPermissions('B_costSetting')"
-              @click="handleCostSet(record)"
+              @click="handleCostSet(record,false)"
             >设置成本</a-button>
           </div>
         </template>
@@ -108,7 +115,7 @@
     <!-- 新增 -->
     <addProductModal :openModal="newProduct" @close="newProduct=false" @ok="handleProductsOk" />
     <!-- 设置成本价 -->
-    <SettingCost ref="settingCost" :openModal="openSetModal" @ok="$refs.table.refresh()" @close="openSetModal=false"></SettingCost>
+    <SettingCost ref="settingCost" :edit="editFlag" :openModal="openSetModal" @ok="$refs.table.refresh()" @close="openSetModal=false"></SettingCost>
     <!-- 导入产品 -->
     <importGuideModal :openModal="openGuideModal" @close="openGuideModal=false" @ok="handleGuideOk" />
   </a-card>
@@ -125,7 +132,7 @@ import ImportGuideModal from './importGuideModal.vue'
 import SettingCost from './settingCost.vue'
 import { supplierProductList, supplierProductExportDetail, supplierProductUpdateAuditState, supplierProductNewBatchInsert } from '@/api/supplier'
 export default {
-  name: 'costSettingList',
+  name: 'CostSettingList',
   mixins: [commonMixin],
   components: { STable, VSelect, ProductBrand, ProductType, addProductModal, SettingCost, ImportGuideModal },
   data () {
@@ -143,7 +150,7 @@ export default {
           productBrandSn: undefined, //  产品品牌
           productTypeSn1: '', //  产品一级分类
           productTypeSn2: '', //  产品二级分类
-          productTypeSn3: '' ,//  产品三级分类
+          productTypeSn3: '' //  产品三级分类
         },
         auditState: undefined
       },
@@ -169,7 +176,8 @@ export default {
       },
       rowSelectionInfo: null,
       newProduct: false,
-      openSetModal: false
+      openSetModal: false,
+      editFlag: false
     }
   },
   computed: {
@@ -243,7 +251,7 @@ export default {
     },
     // 批量导入
     handleBatchImport () {
-      this.openGuideModal=true
+      this.openGuideModal = true
     },
     // 批量审核
     handleBatchAudit () {
@@ -275,13 +283,13 @@ export default {
         }
       })
     },
-    auditOrder(sn,val){
+    auditOrder (sn, val) {
       this.spinning = true
       supplierProductUpdateAuditState({
         auditState: val,
         supplierProductSnList: sn
       }).then(res => {
-        if(res.status == 200){
+        if (res.status == 200) {
           this.$refs.table.refresh(true)
           this.$refs.table.clearSelected()
           this.$message.info(res.message)
@@ -290,8 +298,9 @@ export default {
       })
     },
     // 成本设置
-    handleCostSet (row) {
+    handleCostSet (row, flag) {
       this.openSetModal = true
+      this.editFlag = !!flag
       this.$refs.settingCost.setData(row)
     },
     pageInit () {

+ 11 - 4
src/views/supplierManagement/costSetting/settingCost.vue

@@ -67,6 +67,10 @@ export default {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
+    },
+    edit: {
+      type: Boolean,
+      default: false
     }
   },
   data () {
@@ -96,18 +100,21 @@ export default {
     setData (row) {
       this.form.supplierSn = row.supplierSn
       this.form.supplierProductSn = row.supplierProductSn
-      this.form.modifyCost = ''
       this.cost = row.cost
       this.productName = row.product.name
       this.productCode = row.product.code
       this.supplierName = row.supplierName
+      const _this = this
+      _this.$nextTick(() => {
+        _this.form.modifyCost = _this.edit ? row.modifyCost : ''
+      })
     },
     onSubmit () {
       const _this = this
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const params = JSON.parse(JSON.stringify(_this.form))
-          if(params.modifyCost==0){
+          if (params.modifyCost == 0) {
             this.$message.warning('成本价不能是0!')
             return false
           }
@@ -132,8 +139,8 @@ export default {
       this.productName = ''
       this.productCode = ''
       this.form.modifyCost = ''
-      this.form.supplierSn= ''
-      this.form.supplierProductSn= ''
+      this.form.supplierSn = ''
+      this.form.supplierProductSn = ''
       this.$refs.ruleForm.resetFields()
     }
   },

+ 3 - 3
vue.config.js

@@ -30,7 +30,7 @@ const assetsCDN = {
     BASE_URL + 'js/vue.min.js',
     BASE_URL + 'js/vue-router.min.js',
     BASE_URL + 'js/vuex.min.js',
-    BASE_URL + 'js/axios.min.js',
+    BASE_URL + 'js/axios.min.js'
     // BASE_URL + 'js/echarts.min.js'
   ]
 }
@@ -108,9 +108,9 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.2.117/ocs-admin',
+        target: 'http://192.168.2.111/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
-        target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
+        // target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,
         changeOrigin: true,
         pathRewrite: {