lilei 3 dagar sedan
förälder
incheckning
5c44897c95

+ 1 - 1
public/version.json

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

+ 9 - 2
src/views/salesReturnManagement/custConfirm/list.vue

@@ -27,9 +27,16 @@
         <div style="border-top:1px solid #eee;padding-top:10px;">
           <a-button type="primary" :loading="loading" @click="openProductModal=true">新增产品</a-button>
           <a-button type="primary" :loading="loading" class="button-info" @click="setNewSalesRetrunOrder">生成新销退单</a-button>
-          <a-button type="primary" ghost style="margin-left:10px;" :loading="loading" @click="handlePlss">批量设置退货单价</a-button>
-          <a-button type="primary" ghost style="margin-left:5px;" class="button-info" :loading="loading" @click="openPlSetReason">批量设置退货原因</a-button>
+          <a-button type="primary" ghost :loading="loading" @click="handlePlss">批量设置退货单价</a-button>
+          <a-button
+            type="primary"
+            ghost
+            style="margin-left:5px;"
+            class="button-info"
+            :loading="loading"
+            @click="openPlSetReason">批量设置退货原因</a-button>
           <span style="margin-left:10px;" v-if="selNums">已选{{ selNums }}项</span>
+          <a-button style="margin-left:10px;" type="primary" class="button-error" :loading="loading">批量导入退货单价</a-button>
           <div style="float:right;color:#999;margin-top:8px;">说明:红色行表示收货时新增的产品;黄色行表示客服确认时新增的产品;退货原因文字显示红色表示退货原因和退货类别不一致;</div>
         </div>
         <!-- 已选配件列表 -->

+ 35 - 1
src/views/salesReturnManagement/salesReturn/salesReturnEdit.vue

@@ -9,9 +9,12 @@
             单号:{{ ordeDetail&&ordeDetail.salesReturnBillNo }}
           </span>
           <span style="margin: 0 10px;color: #666;">客户名称:{{ ordeDetail&&ordeDetail.buyerName || '--' }}</span>
-          <span style="margin: 0 10px;color: #666;">
+          <span style="margin: 0 0 0 10px;color: #666;">
             退货仓库:{{ ordeDetail&&ordeDetail.warehouseName }}
           </span>
+          <a-button size="small" type="link" @click="showEditModal=true">
+            <a-icon type="edit"></a-icon>修改
+          </a-button>
           <span style="margin: 0 10px;color: #666;">
             退货类别:{{ ordeDetail&&ordeDetail.goodFlagDictValue }}
           </span>
@@ -163,6 +166,27 @@
         </div>
       </div>
     </commonModal>
+    <!-- 修改仓库 -->
+    <commonModal modalTit="修改退货仓库" :openModal="showEditModal" @cancel="showEditModal=false" @ok="editOk">
+      <div>
+        <span>退货单号:</span>
+        {{ ordeDetail&&ordeDetail.salesReturnBillNo }}
+      </div>
+      <div style="margin: 10px 0;">
+        <span>原退货仓库:</span>
+        {{ ordeDetail&&ordeDetail.warehouseName }}
+      </div>
+      <div>
+        <span>新退货仓库:</span>
+        <warehouse
+          v-model="newWarehouseSn"
+          style="width: 250px"
+          showDef
+          id="chooseCustom-edit-warehouseSn"
+          placeholder="请选择退货仓库"
+        />
+      </div>
+    </commonModal>
   </div>
 </template>
 
@@ -218,6 +242,8 @@ export default {
       disabled: false,
       isInster: false, // 是否正在添加产品
       openDepartUserModal: false,
+      showEditModal: false,
+      newWarehouseSn: undefined,
       ordeDetail: { discountAmount: 0 },
       delLoading: false,
       // 已选产品
@@ -329,6 +355,14 @@ export default {
         record.initialQty = valBackups
       }
     },
+    // 修改单据退货仓库
+    editOk () {
+      if (this.newWarehouseSn) {
+
+      } else {
+        this.$message.info('请选择退货仓库')
+      }
+    },
     // 修改仓库
     updateWarehouse (warehouseSn) {
       const _this = this

+ 188 - 0
src/views/setting/removeSetting/erpBaseModal.vue

@@ -0,0 +1,188 @@
+<template>
+  <a-modal
+    v-model="opened"
+    :title="title"
+    centered
+    :maskClosable="false"
+    :confirmLoading="confirmLoading"
+    :width="560"
+    :footer="null"
+    @cancel="cancel"
+  >
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="chooseCustom-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol"
+      >
+        <a-row :gutter="15">
+          <a-col :span="20">
+            <a-form-model-item label="业务单号" prop="bizNo">
+              <a-input
+                id="base-bizNo"
+                :disabled="bizSn"
+                v-model.trim="form.bizNo"
+                @change="fetchUser"
+                allowClear
+                placeholder="请输入业务单号"/>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="15">
+          <a-col :span="20">
+            <a-form-model-item label="客户名称" prop="dealerSn">
+              {{ dealerData&&dealerData.dealerName||'--' }}
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+          <a-button @click="cancel" style="margin-right: 15px" id="chooseCustom-btn-back">取消</a-button>
+          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect } from '@/components'
+import debounce from 'lodash/debounce'
+import warehouse from '@/views/common/chooseWarehouse.js'
+import { bizRemoveConfigCreate, bizRemoveConfigModify, bizRemoveConfigDetail, salesReturnDetailByNo } from '@/api/bizRemove'
+export default {
+  name: 'ErpBaseModal',
+  mixins: [commonMixin],
+  components: { VSelect, warehouse },
+  props: {
+    show: [Boolean]
+  },
+  data () {
+    this.lastFetchId = 0
+    this.fetchUser = debounce(this.fetchUser, 800)
+    return {
+      opened: this.show,
+      spinning: false,
+      title: '新增配置',
+      confirmLoading: false,
+      formItemLayout: {
+        labelCol: { span: 8 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        bizNo: '',
+        dealerSn: undefined,
+        configType: 'TIRE_SUBSIDY',
+        bizSn: undefined, // bizsn
+        tireSubsidyYf: '1'
+      },
+      rules: {
+        bizNo: [{ required: true, message: '请输入业务单号', trigger: ['change', 'blur'] }],
+        dealerSn: [{ required: true, message: '请选择客户', trigger: ['change', 'blur'] }],
+        tireSubsidyYf: [{ required: true, message: '请选择', trigger: ['change', 'blur'] }]
+      },
+      fetching: false,
+      dealerData: null,
+      bizSn: undefined
+    }
+  },
+  methods: {
+    fetchUser () {
+      if (!this.form.bizNo) return
+      this.lastFetchId += 1
+      const fetchId = this.lastFetchId
+      this.dealerData = null
+      this.spinning = true
+      this.fetching = true
+      salesReturnDetailByNo({ bizNo: this.form.bizNo, configType: 'TIRE_SUBSIDY' }).then(res => {
+        if (fetchId !== this.lastFetchId) {
+          return
+        }
+        if (res.data) {
+          this.dealerData = res.data
+          this.form.dealerSn = res.data.dealerSn
+          this.form.bizSn = res.data.bizSn
+        } else {
+          this.dealerData = null
+          this.form.dealerSn = undefined
+          this.form.bizSn = undefined
+        }
+        this.fetching = false
+        this.spinning = false
+      })
+    },
+    //  保存
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          // 保存
+          _this.salesSaveFun()
+        } else {
+          return false
+        }
+      })
+    },
+    // 新建业务单
+    salesSaveFun () {
+      const _this = this
+      const form = this.form
+      const funs = !this.bizSn ? bizRemoveConfigCreate : bizRemoveConfigModify
+      _this.spinning = true
+      funs(form).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$emit('ok', res.data)
+          _this.cancel()
+        }
+        _this.spinning = false
+      })
+    },
+    cancel () {
+      this.opened = false
+      this.form = {
+        configType: 'TIRE_SUBSIDY',
+        bizNo: '',
+        dealerSn: undefined,
+        bizSn: undefined, // bizsn
+        tireSubsidyYf: '1'
+      }
+      this.bizSn = undefined
+      this.dealerData = null
+      this.$refs.ruleForm.resetFields()
+      this.$emit('cancel')
+    },
+    getDetail () {
+      bizRemoveConfigDetail({ bizSn: this.bizSn, configType: 'TIRE_SUBSIDY' }).then(res => {
+        const { bizSn, bizNo, dealerSn, dealerName } = res.data
+        this.dealerData = { dealerName: dealerName }
+        this.form = Object.assign(this.form, {
+          bizNo: bizNo,
+          dealerSn: dealerSn,
+          bizSn: bizSn,
+          tireSubsidyYf: '1'
+        })
+      })
+    },
+    edit (row) {
+      if (row && row.bizSn) {
+        this.title = '编辑配置'
+        this.bizSn = row.bizSn
+        this.getDetail()
+      } else {
+        this.title = '新增配置'
+        this.bizSn = undefined
+      }
+    }
+  },
+  watch: {
+    show (newValue, oldValue) {
+      this.opened = newValue
+    }
+  }
+}
+</script>

+ 276 - 0
src/views/setting/removeSetting/erpList.vue

@@ -0,0 +1,276 @@
+<template>
+  <div>
+    <a-card size="small" :bordered="false" class="searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="业务时间">
+                <rangeDate ref="rangeCreateDate" id="salesReturnRemove-createDate" :value="createDate" @change="dateCreateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="客户名称" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
+                <dealerSubareaScopeList ref="dealerSubareaScopeList" id="salesReturnRemove-dealerSn" @change="custChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="销售退货单号">
+                <a-input id="salesReturnRemove-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入销售退货单号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button id="salesReturnRemove-search" type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button id="salesReturnRemove-reset" style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                <a-button
+                  style="margin-left: 10px"
+                  type="primary"
+                  class="button-warning"
+                  v-if="$hasPermissions('B_srr_export')"
+                  @click="handleExport"
+                  :disabled="disabled"
+                  :loading="exportLoading"
+                  id="salesReturnRemove-export">导出</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+      <a-spin :spinning="spinning" tip="Loading...">
+        <div class="table-operator" style="flex-grow: 1;display: flex;justify-content: space-between;align-items: center;">
+          <div style="flex-grow: 1;display: flex;align-items: center;">
+            <!-- 操作按钮 -->
+            <div>
+              <a-button type="primary" v-if="$hasPermissions('B_srr_add')" @click="handleEdit">新增</a-button>
+            </div>
+          </div>
+          <div></div>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+75+'px' }"
+          size="small"
+          :rowKey="(record) => record.no"
+          rowKeyName="no"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 操作 -->
+          <template slot="action" slot-scope="text, record, index">
+            <div>
+              <a-button
+                size="small"
+                type="link"
+                class="button-info"
+                v-if="record.show&&$hasPermissions('B_srr_edit')"
+                @click="handleEdit(record)"
+                :id="'salesReturnRemove-edit-btn'+index">编辑</a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-error"
+                v-if="record.show&&$hasPermissions('B_srr_del')"
+                @click="handleDel(record)"
+                :id="'salesReturnRemove-del-btn'+index">删除</a-button>
+            </div>
+          </template>
+        </s-table>
+      </a-spin>
+      <!-- 选择客户弹框 -->
+      <baseModal :show="openModal" ref="openModal" @ok="handleOk" @cancel="openModal=false"></baseModal>
+    </a-card>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import baseModal from './erpBaseModal.vue'
+import { hdExportExcel } from '@/libs/exportExcel'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { bizRemoveConfigPageList, bizRemoveConfigDelete, bizRemoveConfigReportExport } from '@/api/bizRemove'
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
+export default {
+  name: 'SrrErpSetting',
+  mixins: [commonMixin],
+  components: {
+    STable,
+    VSelect,
+    baseModal,
+    dealerSubareaScopeList,
+    rangeDate
+  },
+  data () {
+    return {
+      spinning: false,
+      // 高级搜索 展开/关闭
+      advanced: true,
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      createDate: [
+        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ], //  创建时间
+      openModal: false, // 选择客户弹框是否显示
+      openDepartUserModal: false,
+      // 查询参数
+      queryParam: {
+        configType: 'TIRE_SUBSIDY',
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        dealerSn: undefined, //  客户名称
+        bizNo: undefined, //  业务单号
+        bizType: undefined
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        return bizRemoveConfigPageList(params).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
+              data.list[i].show = new Date(data.list[i].bizDate).getMonth() == new Date().getMonth()
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      visibleAudit: false
+    }
+  },
+  computed: {
+    columns () {
+      const a = ['', '剔除']
+      const arr = [
+        { title: '编号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售退货单号', dataIndex: 'bizNo', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务状态', dataIndex: 'billStatusName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '业务时间', dataIndex: 'bizDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerName', width: '46%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '创建时间', dataIndex: 'createDate', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+      return arr
+    }
+  },
+  methods: {
+    //  创建时间  change
+    dateCreateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    // 选择客户
+    custChange (val) {
+      this.queryParam.dealerSn = val.key
+    },
+    // 导出
+    handleExport () {
+      const _this = this
+      const params = JSON.parse(JSON.stringify(_this.queryParam))
+      _this.exportLoading = true
+      _this.spinning = true
+      hdExportExcel(bizRemoveConfigReportExport, params, '销售退货同步erp剔除配置-', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+      })
+    },
+    // 编辑
+    handleEdit (row) {
+      this.openModal = true
+      this.$refs.openModal.edit(row)
+    },
+    handleOk (res) {
+      this.$refs.table.refresh()
+    },
+    // 删除
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: <div>销售退货单号:{row.bizNo}<div>确认要删除吗?</div></div>,
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          bizRemoveConfigDelete({ bizSn: row.bizSn, configType: 'TIRE_SUBSIDY' }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+            }
+            _this.spinning = false
+          })
+        }
+      })
+    },
+    // 重置查询
+    resetSearchForm () {
+      this.$refs.rangeCreateDate.resetDate(this.createDate)
+      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.dealerSn = undefined
+      this.$refs.dealerSubareaScopeList.resetForm()
+      this.queryParam.bizNo = ''
+      this.queryParam.bizType = undefined
+
+      this.$refs.table.refresh(true)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 295
+    }
+  },
+  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>

+ 5 - 1
src/views/setting/removeSetting/index.vue

@@ -11,6 +11,9 @@
         <a-tab-pane key="3" tab="轮胎补贴剔除" force-render>
           <list3></list3>
         </a-tab-pane>
+        <a-tab-pane key="4" tab="销售退货同步erp剔除" force-render>
+          <list4></list4>
+        </a-tab-pane>
       </a-tabs>
     </a-card>
   </div>
@@ -21,10 +24,11 @@ import { commonMixin } from '@/utils/mixin'
 import list1 from '../salesReturnRemove/list.vue'
 import list2 from '../dailyReportSettings/salesReturnRemove.vue'
 import list3 from './list.vue'
+import list4 from './erpList.vue'
 export default {
   name: 'DailyReportSettingsIndex',
   mixins: [commonMixin],
-  components: { list1, list2, list3 },
+  components: { list1, list2, list3, list4 },
   data () {
     return {
       tabVal: '1'