Commit 8f50f3bd by chenwq

商品管理

1 parent 4bd93cef
{
"name": "purchase",
"name": "commodity",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
......@@ -6448,9 +6448,9 @@
}
},
"glsx-common": {
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/glsx-common/-/glsx-common-2.0.8.tgz",
"integrity": "sha512-hKt/SNFu+NslOHWvDLxmRwUkINBrnATTYIkOj+jmcx5RqfXIbMgEipzFGbCICWMlYYoecwRiJ6341sstPCCHLQ==",
"version": "2.0.9",
"resolved": "https://registry.npmjs.org/glsx-common/-/glsx-common-2.0.9.tgz",
"integrity": "sha512-d4C404dGtp9fS4r4phi79ozuwleJd326xtfUqokiSs7Y7Zw7bn0Nza5UHHRuIHQettccjVOr18BNf7yG/cKuww==",
"requires": {
"axios": "^0.21.3",
"md5": "^2.3.0",
......
......@@ -14,7 +14,7 @@
"dayjs": "^1.10.7",
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^2.0.8",
"glsx-common": "^2.0.9",
"glsx-components": "^1.5.4",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
......
import { http } from '@/main'
const path = 'dj.api.smartcarlife.'
const path2 = 'dj.api.'
const path3 = 'dj.smartcarlife.api.'
const path4 = 'dj.api.goodsCategoryConfiguration.'
// 获取当前登录账号可见的园区店列表
const getyqMerchantList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}permission.yqMerchant.list`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 入库管理列表
const getGoodsWarehousingList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path2}life.GoodsWarehousingInfo.list`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 库存记录分页查询
const getMerchantGoodsStockMonthReport = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}MerchantGoodsStockMonthReport.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 月度的库存结算单
const getReportByGoods = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}MerchantGoodsStockMonthReport.listByGoods`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 出库记录查询
const getMerchantGoodsStockReduceRecord = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}MerchantGoodsStockReduceRecord.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 分页查询盘点单列表
const stockCheckPage = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path3}stock.check.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// // 分页查询盘点详细信息
const stockCheckDetailPage = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path3}stock.check.detail.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 商品库存列表(创建盘点、调拨时展示)
const stockRemainPage = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path3}stock.remain.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 保存盘点确认单
const saveStockCheck = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path3}stock.check.save`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// // 根据场景类型查询对应所有类目
// const queryGoodsCategoryBySceneId=(data)=> {
// data.method = `${path4}queryGoodsCategoryBySceneId`
// return http({
// url: 'rop-scrm-boutiquecoupon/router',
// method: 'POST',
// data: params,
// sign: true
// })
// }
// 分页查询调拨单列表
const stockAllocatePage = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path3}stock.allocate.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 分页查询调拨详细信息
const stockAllocateDetailPage = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path3}stock.allocate.detail.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
//导出
const exportExcel = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.life.GoodsWarehousingInfo.exportExcel`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
//导出
const exportMerchantExcel = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smartcarlife.MerchantGoodsStockMonthReport.export`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
//导出
const exportReduceExcel = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smartcarlife.MerchantGoodsStockReduceRecord.export`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
//导出
const exportCheckExcel = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.smartcarlife.api.stock.check.export`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
//导出
const exportaAllocateExcel = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.smartcarlife.api.stock.allocate.export.async`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
const exportaInventExcel = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.life.InventoryWarningInfo.exportExcel`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 保存调拨单
const saveStockAllocate = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path3}stock.allocate.save`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 调入门店
const yqRelatedList = params => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path3}yqRelated.yqMerchant.list`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// // 库存预警列表查询
export function inventoryWarningList(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path2}life.InventoryWarning.list`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
const getListApi = params => {
params.method = `scrm.api.shopmall.goods.page.curMerchant`
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
export default { inventoryWarningList, exportaInventExcel, exportaAllocateExcel, exportCheckExcel, exportReduceExcel, exportMerchantExcel, exportExcel, saveStockAllocate, stockAllocateDetailPage, stockAllocatePage, yqRelatedList, saveStockCheck, stockRemainPage, stockCheckDetailPage, stockCheckPage, getMerchantGoodsStockReduceRecord, getReportByGoods, getyqMerchantList, getGoodsWarehousingList, getMerchantGoodsStockMonthReport, getListApi }
......@@ -11,13 +11,13 @@
let cfg = require('./conf.js')
import { Http, utils } from 'glsx-common'
let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) {
export const fetchConfig = function(isEnv = true) {
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
let params = { moduleName: 'commodity', mockUrl: 'http://oss-config.dev.glsx.com.cn/mock/6423df03079be3540abbb69e/purchase/config',httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
let params = { moduleName: 'commodity', mockUrl: 'http://oss-config.dev.glsx.com.cn/mock/64489a52ad0aa72e7cd2bd3d/commodity/config', env: 'test', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
return utils.getConfig(params)
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/616d28231072f92988f059fb/home/config')
// return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get('http://config-center-backend.test.glsx.com/glsxAdmin/config?moduleUrl=home').then(res => res)
......@@ -26,4 +26,4 @@ export const config = {
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
\ No newline at end of file
}
......@@ -2,12 +2,12 @@ const staticRoutes = Object.freeze([
{
name: 'default',
path: '/',
redirect: '/allocation/index'
redirect: '/commodity/index'
},
{
name: 'allocation',
path: '/allocation/index',
component: resolve => require([`@/views/allocation/index.vue`], resolve),
name: 'commodity',
path: '/commodity/index',
component: resolve => require([`@/views/commodity/index.vue`], resolve),
meta: {}
}
])
......
<template>
<div class="addWrap">
<div class="d2-container-content" style="padding: 10px 20px">
<el-form :inline="true" :model="editAllocationForm" ref="editAllocationFormRef" :rules="formRules" class="demo-form-inline">
<el-form-item label="调出门店:" prop="callOutYqMerchantId">
<el-select v-model="editAllocationForm.callOutYqMerchantId" style="width: 300px">
<el-option v-for="item in callOutYqMerchantList" :key="item.merchantNo" :label="item.merchantName" :value="item.merchantNo" />
</el-select>
</el-form-item>
<el-form-item label="调入门店:" prop="callInYqMerchantId">
<el-select v-model="editAllocationForm.callInYqMerchantId" filterable style="width: 300px">
<el-option v-for="item in callInYqMerchantList" :key="item.merchantId" :label="item.merchantName" :value="item.merchantId" />
</el-select>
</el-form-item>
</el-form>
</div>
<div class="d2-container-content">
<div style="padding: 15px 0">
<div>
<el-input v-model="searchForm.searchName" style="width: 200px" placeholder="请输入商品名称/系列" maxlength="20" clearable />
<el-button @click="handleSearch" size="small" type="primary" style="marginleft: 15px">查询</el-button>
</div>
</div>
<GLTable ref="allocationTable" :getListApi="getListApi" :searchForm="searchFormSearch" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn">
<div slot="auth-button" slot-scope="scope">
<el-button type="text" @click="allocation(scope.scope)" :disabled="setDisabled(scope.scope)">盘点</el-button>
</div>
</GLTable>
</div>
<div class="d2-container-content">
<p class="title">调拨确认单</p>
<GLTable ref="allocationTable2" :tableData="chooseDataList" :tableParams="tableParams2" :hasPage="false">
<div slot="auth-button" slot-scope="scope">
<el-button type="text" @click="cancelAllocation(scope.row, scope.$index)">取消</el-button>
</div>
</GLTable>
</div>
<glsx-form ref="allocationForm" :origin-data="editData" :form-list="editForm" form-ref="inveFormRef" @handleAddConfirm="handleAddConfirm" @handleClose="handleAddClose"></glsx-form>
<!-- 盘点 -->
<allocation-num-dialog :allocation-num-visible="allocationNumVisible" :allocation-info="allocationInfo" v-if="allocationNumVisible" @dialogClose="dialogClose" />
</div>
</template>
<script>
import allocationNumDialog from './allocationNumDialog'
import { membraneTypeList } from '@/utils/constants.js'
export default {
name: 'allocationList',
components: {
allocationNumDialog
},
data() {
return {
callOutYqMerchantList: [],
membraneTypeList: membraneTypeList,
callInYqMerchantList: [],
searchForm: {
searchName: '',
stockFlag: true
},
searchFormSearch: {},
searchSelectObj: {},
showFormData: [
{
// label: '商品名称/系列',
placeholder: '请输入商品名称/系列',
name: 'searchName',
type: 'input',
maxlength: '20',
isClear: true
}
],
getListApi: this.$apis.stockManage.stockRemainPage,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '商品名称',
prop: 'goodsName',
width: '160px'
},
{
label: '系列',
prop: 'sourceMaterialName',
width: '250px'
},
{
label: '所属分类',
prop: 'goodsTypeName',
width: '250px'
},
{
label: '库存',
prop: 'stock',
formatter: cellValue => {
return cellValue.stock || cellValue.stock == 0 ? parseFloat(cellValue.stock).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
}
},
{
label: '所属门店',
prop: 'yqMerchantName',
width: '200px'
}
]
},
tableParams2: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '商品名称',
prop: 'goodsName',
width: '160px'
},
{
label: '系列',
prop: 'sourceMaterialName',
width: '250px'
},
{
label: '所属分类',
prop: 'goodsTypeName',
width: '250px'
},
{
label: '库存',
prop: 'stock',
formatter: cellValue => {
return cellValue.stock || cellValue.stock == 0 ? parseFloat(cellValue.stock).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
}
},
{
label: '调拨库存',
prop: 'allocateNumber ',
formatter: cellValue => {
return cellValue.allocateNumber || cellValue.allocateNumber == 0 ? parseFloat(cellValue.allocateNumber).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
}
}
]
},
editData: {
// thumbUrlList: [],
},
editForm: [
{
formBlock: [
{
name: 'remark',
label: '备注说明',
type: 'textarea',
maxlength: 100
}
]
}
],
editAllocationForm: {
callOutYqMerchantId: '',
callInYqMerchantId: ''
},
allocationNumVisible: false,
allocationInfo: null,
chooseDataList: [],
formRules: {
callOutYqMerchantId: [
{
required: true,
message: '请选择调出门店',
trigger: 'change'
}
],
callInYqMerchantId: [
{
required: true,
message: '请选择调入门店',
trigger: 'change'
}
]
}
}
},
mounted() {
// this.editAllocationForm.callOutYqMerchantId =
// this.callOutYqMerchantList[0].merchantNo
//调入门店
this.$apis.stockManage.yqRelatedList({ includeSelf: false }).then((res) => {
this.callInYqMerchantList = res
})
},
methods: {
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = this.$common.utils.deepClone(this.searchForm)
resolve()
})
},
handleSearch() {
this.$refs.allocationTable.refreshTable()
},
// 调拨
allocation(row) {
this.allocationInfo = row
this.allocationNumVisible = true
},
//设置禁选
setDisabled(row) {
const index = this.chooseDataList.findIndex((item) => item.id == row.id)
if (index == -1) {
return false
} else {
return true
}
},
dialogClose(chooseData) {
this.allocationNumVisible = !this.allocationNumVisible
console.log(chooseData)
if (chooseData) {
this.chooseDataList.push(chooseData)
}
},
// 取消
cancelAllocation(row, index) {
this.chooseDataList.splice(index, 1)
},
handleAddConfirm(data) {
this.$refs.editAllocationFormRef.validate((valid) => {
if (valid) {
if (this.chooseDataList.length == 0) {
this.notice.warningTips("请选择调拨商品")
return
}
var params = {}
params.stockCheckDetailList = this.chooseDataList
if (data.remark) {
params.remark = data.remark
}
params = {
...params,
...this.editAllocationForm
}
this.$confirm(
"调拨单保存后,系统自动按照调拨数量对调出和调入门店进行库存更新;是否确定保存?",
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}
)
.then(() => {
this.$apis.stockManage.saveStockAllocate(params).then((res) => {
this.notice.okTips()
this.handleAddClose()
})
})
.catch((err) => {
console.log(err)
})
}
})
},
handleAddClose(isRefresh = false) {
// this.close({ tagName: "/addAllocation" })
// this.$router.push({ name: "allocationList" })
}
}
}
</script>
<style scoped>
.d2-container-content {
background: #fff;
padding: 20px;
margin-bottom: 20px;
}
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
.title {
font-weight: 600;
font-size: 16px;
color: #333333;
padding: 17px 0;
}
.leftSpan {
display: inline-block;
box-sizing: border-box;
margin-right: 10px;
}
</style>
<!-- 盘点详情弹窗弹窗 -->
<template>
<GLDialog bigTitle="详细信息"
:visible.sync="allocationDetailVisible"
class="inventoryDetailDailog"
mode="big"
@onCancel="handleClose"
@onOk="handleClose">
<div>
<div class="d2-container-content">
<GLTable ref="recordTable"
:getListApi="getListApi"
:searchForm="searchFormSearch"
:tableParams="tableParams"
:beforeSearchFn="beforeSearchFn">
</GLTable>
</div>
</div>
</GLDialog>
</template>
<script>
import { membraneTypeList } from '@/utils/constants.js'
export default {
name: 'allocationDetailDialog',
data() {
return {
membraneTypeList: membraneTypeList,
searchForm: {
id: ''
},
searchFormSearch: {},
searchSelectObj: {},
showFormData: [],
getListApi: this.$apis.stockManage.stockAllocateDetailPage,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '商品名称',
prop: 'goodsName'
},
{
label: '系列',
prop: 'sourceMaterialName'
},
{
label: '所属分类',
prop: 'goodsTypeName'
},
{
label: '调拨数量',
prop: 'allocateNumber',
formatter: cellValue => {
return cellValue.allocateNumber || cellValue.allocateNumber == 0 ? parseFloat(cellValue.allocateNumber).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
}
}
]
},
baseData: {}
}
},
props: {
allocationDetailVisible: {
type: Boolean,
default: false
},
allocationInfo: {
type: Object,
default: () => {}
}
},
computed: {},
mounted() {
console.log(11111111)
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm.id = this.allocationInfo.id
this.searchFormSearch = this.$common.utils.deepClone(this.searchForm)
resolve()
})
},
handleClose() {
this.$emit('dialogClose')
}
}
}
</script>
<style scoped>
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
.inventoryDetailDailog .el-dialog {
margin-top: 20vh !important;
min-width: 700px;
}
</style>
<!-- 盘点 -->
<template>
<GLDialog title="调拨" mode="small" :visible.sync="allocationNumVisible" class="allocationNumDailog" okText="确定" @onCancel="handleClose" @onOk="handleAddConfirm">
<el-form ref="allocationNumForm" :model="infoForm" :rules="formRules" label-width="120px">
<el-form-item label="调拨数量:" prop="allocationNum">
<el-input placeholder="请输入调拨数量" v-model="infoForm.allocationNum" style="width: 250px" clearable @input="handleUpgradeNum"></el-input>
</el-form-item>
</el-form>
</GLDialog>
</template>
<script>
import { limitPrice } from '@/common/format'
export default {
name: 'AllocationNumDialog',
data() {
return {
infoForm: {
allocationNum: ''
},
oldVal: {
allocationNum: ''
},
formRules: {
allocationNum: [{ required: true, message: '请输入调拨数量', trigger: 'change' }]
},
selectLoading: false
}
},
props: {
allocationNumVisible: {
type: Boolean,
default: false
},
allocationInfo: {
type: Object,
default: () => {}
}
},
watch: {},
created() {},
components: {},
computed: {},
mounted() {},
methods: {
handleUpgradeNum(newVal) {
this.infoForm.allocationNum = limitPrice(newVal, this.oldVal.allocationNum, 8, 2, 0, this.allocationInfo.stock)
this.oldVal.allocationNum = this.infoForm.allocationNum
},
handleAddConfirm() {
this.$refs.allocationNumForm.validate(valid => {
if (valid) {
this.allocationInfo.allocateNumber = parseFloat(this.infoForm.allocationNum)
this.handleClose(this.allocationInfo)
}
})
},
handleClose(info) {
this.$emit('dialogClose', info)
}
}
}
</script>
<style >
</style>
<template>
<div class="purchase">
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="table-header">
<el-button type="primary" size="small" @click="handleAdd">创建调拨</el-button>
<el-button type="primary" size="small" @click="exportExcel">导出</el-button>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="allocationRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">查看</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- 查看 -->
<allocation-detail-dialog :allocation-detail-visible="allocationDetailVisible" :allocationInfo="allocationInfo" v-if="allocationDetailVisible" @dialogClose="dialogClose" />
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import allocationDetailDialog from './allocationDetailDialog'
export default {
name: 'warehousing',
components: {
allocationDetailDialog
},
data() {
return {
size: 'small',
url: url,
searchForm: {
allocateTime: '',
allocateCode: '',
callOutYqMerchantId: '',
callInYqMerchantId: ''
},
tableSearchForm: {},
allocationInfo: {},
allocationDetailVisible: false,
showFormData: [
{
label: '调拨单号',
name: 'allocateCode',
type: 'input',
maxlength: '20',
isClear: true
},
{
label: '调拨时间',
name: 'allocateTime',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '调出门店',
name: 'callOutYqMerchantId',
type: 'select',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'yqRelatedMerchantList'
},
{
label: '调入门店',
name: 'callInYqMerchantId',
type: 'select',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'yqRelatedMerchantList'
}
],
// 表格
getListApi: this.$apis.stockManage.stockAllocatePage,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '调拨单号',
prop: 'allocateCode',
width: 200
},
{
label: '调拨时间',
prop: 'allocateTime',
formatter: cellValue => {
return dayjs(cellValue.allocateTime).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '调拨人',
prop: 'operator'
},
{
label: '调出门店',
prop: 'callOutYqMerchantName'
},
{
label: '调入门店',
prop: 'callInYqMerchantName'
},
{
label: '备注',
prop: 'remark'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
// 基本数据
baseData: {
yqRelatedMerchantList: []
},
imgVisible: false,
previewImgUrl: ''
}
},
mounted() {
//调入门店
this.$apis.stockManage.yqRelatedList({}).then(res => {
this.baseData.yqRelatedMerchantList = res
this.getOptionsList('showFormData')
})
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.allocateTime) {
params.allocateTimeStart = new Date(this.searchForm.allocateTime[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.allocateTimeEnd = new Date(this.searchForm.allocateTime[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.allocateTime
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
// 查看详情
handleDetail(row) {
this.allocationInfo = row
this.allocationDetailVisible = true
console.log(this.allocationDetailVisible)
},
handleAdd() {
this.$router.push({ path: '/allocation/add' })
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.allocationRef.data.length ? (this.$refs.allocationRef.tableHeightValues = '') : this.$refs.allocationRef.setTableHeightFun()
},
exportExcel() {
this.exportLoading = true
var params = this.getParams()
this.$apis.stockManage.exportaAllocateExcel(params).then(res => {
this.exportLoading = false
window.location.href = res
})
},
handleSearch() {
this.$refs.allocationRef.refreshTable()
},
handleReset() {
this.searchForm = {
allocateTime: '',
allocateCode: '',
callOutYqMerchantId: '',
callInYqMerchantId: ''
}
this.handleSearch()
},
handleEnlargeImg(url) {
if (url) {
this.previewImgUrl = url
this.imgVisible = !this.imgVisible
}
},
handleCloseImg() {
this.imgVisible = !this.imgVisible
},
dialogClose() {
this.allocationDetailVisible = !this.allocationDetailVisible
}
}
}
</script>
<style scoped lang="scss">
@import '@/assets/css/mixin.scss';
.purchase {
.table-header {
@include space-between_center;
margin-bottom: 10px;
h2 {
font-weight: 600;
font-size: 16px;
color: #333;
}
}
}
</style>
......@@ -4,10 +4,10 @@
<div class="edit-box">
<div class="container m-b-20">
<p class="edit-title">基础信息</p>
<el-form label-width="100px" :inline="true">
<el-form label-width="120px" :inline="true">
<el-row v-for="(item, index) in detailFormDataRow" :key="index">
<el-form-item v-for="(subItem, subIndex) in item.rowList" :key="subIndex" :label="subItem.label" class="row-item">
<span class="detail-txt ellipsis-1" :title="detailForm[subItem.name]">{{ detailForm[subItem.name] ? detailForm[subItem.name] + (subItem.suffix || '') : '-' }}</span>
<el-form-item v-for="(subItem, subIndex) in item.rowList" :key="subIndex" :label="subItem.label + ':'" class="row-item">
<span class="detail-txt ellipsis-1" :title="detailForm[subItem.name]">{{ detailForm[subItem.name] ? detailForm[subItem.name] + (subItem.suffix || '') : subItem.isNum ? '0' + (subItem.suffix || '') : '-' }}</span>
</el-form-item>
</el-row>
</el-form>
......@@ -62,27 +62,33 @@ export default {
},
{
label: '售价/元',
name: 'sellPrice'
name: 'sellPrice',
isNum: true
},
{
label: '最低售价/元',
name: 'minSellPrice'
name: 'minSellPrice',
isNum: true
},
{
label: '赠送成本/元',
name: 'giftCost'
name: 'giftCost',
isNum: true
},
{
label: '产品成本/元',
name: 'productCost'
name: 'productCost',
isNum: true
},
{
label: '库存预警',
name: 'warningValue'
name: 'warningValue',
isNum: true
},
{
label: '质保年限',
name: 'warrantyPeriod',
isNum: true,
suffix: '年'
}
],
......
......@@ -126,6 +126,10 @@ export default {
// 库存预警
'editForm.warningValue'(newValue, oldValue) {
this.editForm.warningValue = limitPrice(newValue, oldValue, 6, 2)
},
// 年限
'editForm.warrantyPeriod'(newValue, oldValue) {
this.editForm.warrantyPeriod = limitPrice(newValue, oldValue, 2, 0)
}
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!