Commit 15576c02 by wangql

创建新的文件夹及菜单

1 parent bc4464c6
import request from "./request"
import RequestMethods from "./request.methods"
const path = "dj.api.smartcarlife."
const path2 = "dj.api."
const path3 = "dj.smartcarlife.api."
// 获取当前登录账号可见的园区店列表
export function getyqMerchantList(data) {
data.method = `${path}permission.yqMerchant.list`
return request(data)
}
// 入库管理列表
export function getGoodsWarehousingList(data) {
data.method = `${path2}life.GoodsWarehousingInfo.list`
return request(data, RequestMethods.POST)
}
// 库存记录分页查询
export function getMerchantGoodsStockMonthReport(data) {
data.method = `${path}MerchantGoodsStockMonthReport.page`
return request(data, RequestMethods.POST)
}
// 月度的库存结算单
export function getReportByGoods(data) {
data.method = `${path}MerchantGoodsStockMonthReport.listByGoods`
return request(data, RequestMethods.POST)
}
// 出库记录查询
export function getMerchantGoodsStockReduceRecord(data) {
data.method = `${path}MerchantGoodsStockReduceRecord.page`
return request(data, RequestMethods.POST)
}
// 分页查询盘点单列表
export function stockCheckPage(data) {
data.method = `${path3}stock.check.page`
return request(data, RequestMethods.POST)
}
// 分页查询盘点详细信息
export function stockCheckDetailPage(data) {
data.method = `${path3}stock.check.detail.page`
return request(data, RequestMethods.POST)
}
// 保存盘点确认单
export function saveStockCheck(data) {
data.method = `${path3}stock.check.save`
return request(data, RequestMethods.POST)
}
// 分页查询调拨单列表
export function stockAllocatePage(data) {
data.method = `${path3}stock.allocate.page`
return request(data, RequestMethods.POST)
}
// 分页查询调拨详细信息
export function stockAllocateDetailPage(data) {
data.method = `${path3}stock.allocate.detail.page`
return request(data, RequestMethods.POST)
}
// 创建调拨单调入园区店门店列表
export function stockAllocateMerchantList(data) {
data.method = `${path3}stock.allocate.merchant.list`
return request(data, RequestMethods.POST)
}
// 保存调拨单
export function saveStockAllocate(data) {
data.method = `${path3}stock.allocate.save`
return request(data, RequestMethods.POST)
}
// 商品库存列表(创建盘点、调拨时展示)
export function stockRemainPage(data) {
data.method = `${path3}stock.remain.page`
return request(data, RequestMethods.POST)
}
// 调入门店
export function yqRelatedList(data) {
data.method = `${path3}yqRelated.yqMerchant.list`
return request(data, RequestMethods.POST)
}
// 库存预警列表查询
export function inventoryWarningList(data) {
data.method = `${path2}life.InventoryWarning.list`
return request(data, RequestMethods.POST)
}
const _import = require("@/libs/util.import." + process.env.NODE_ENV)
export const routerName = {
910: {
path: "/rightsAndInterestsManage",
name: "rightsAndInterestsManage",
meta: {
title: "权益配置",
authId: "910",
parentId: "1",
cache: false
}
},
91001: {
path: "/ruleConfigurationList",
name: "ruleConfigurationList",
meta: {
title: "规则配置",
authId: "91001",
parentId: "910",
cache: false
},
auth: [
{
authId: "9100101",
parentId: "91001",
label: "查看",
handle: "handleDetail"
},
{
authId: "9100102",
parentId: "91001",
label: "编辑",
handle: "handleEdit"
}
],
component: _import("rightsAndInterestsManage/ruleConfigurationList")
}
}
const _import = require("@/libs/util.import." + process.env.NODE_ENV)
export const routerName = {
911: {
path: "/vehicleDamage",
name: "vehicleDamage",
meta: {
title: "车损报价单",
authId: "911",
parentId: "1",
cache: false
}
},
91101: {
path: "/vehicleDamageList",
name: "vehicleDamageList",
meta: {
title: "车损报价单",
authId: "91101",
parentId: "911",
cache: false
},
auth: [
{
authId: "9110101",
parentId: "91101",
label: "查看",
handle: "handleDetail"
},
{
authId: "9110102",
parentId: "91101",
label: "编辑",
handle: "handleEdit"
},
{
authId: "9110103",
parentId: "91101",
label: "打印",
handle: "handlePrint"
}
],
component: _import("vehicleDamage/vehicleDamageList")
}
}
<!-- 规则配置 -->
<template>
<div>
<d2-container>
<div class="header"
slot="header"
style="padding: 10px 20px;">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData" />
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<auth-button category="Button" />
</d2-table-header>
<d2-table ref="recordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn">
<auth-button slot="auth-button"
slot-scope="scope"
:data="scope.scope" />
</d2-table>
</div>
</d2-container>
<!-- 查看 -->
<stock-month-dialog :stock-month-visible="stockMonthVisible"
:recordInfo="recordInfo"
v-if="stockMonthVisible"
@dialogClose="dialogClose" />
</div>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { getProductTypeBySceneId } from '@api/product'
import { getyqMerchantList, getMerchantGoodsStockMonthReport } from '@api/rightsAndInterestsManage'
import stockMonthDialog from './stockMonthDialog'
import { membraneTypeList } from '@/common/constants.js'
export default {
name: 'StockList',
components: {
stockMonthDialog
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
membraneTypeList: membraneTypeList,
searchForm: {
upgradeGoodsName: '',
yqMerchantId: '',
goodsType: '',
goodsSeries: ''
},
searchFormSearch: {},
searchSelectObj: {
orderOrTrade: {
attr: 'inputtedOrderCode',
value: ''
}
},
showFormData: [{
label: '商品名称',
name: 'upgradeGoodsName',
type: 'input',
maxlength: '20',
isClear: true
}, {
label: '系列',
name: 'goodsSeries',
type: 'input',
maxlength: '20',
isClear: true
}, {
label: '所属分类',
name: 'goodsType',
type: 'select',
optionList: [],
optionId: 'categoryType',
optionLabel: 'categoryName',
optionsName: 'productTypeList'
}, {
label: '所属门店',
name: 'yqMerchantId',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'yqMerchantList'
}],
getListApi: getMerchantGoodsStockMonthReport,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [{
label: '商品名称',
prop: 'upgradeGoodsName',
width: '160px'
}, {
label: '系列',
prop: 'goodsSeries',
width: '250px'
}, {
label: '所属分类',
prop: 'goodsTypeName',
width: '250px'
}, {
label: '上月结存库存',
prop: 'lastMonthRemainStock',
// formatter: (cellValue) => {
// return (cellValue.lastMonthRemainStock || cellValue.lastMonthRemainStock == 0) ? parseFloat(cellValue.lastMonthRemainStock).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
// }
}, {
label: '上月结存金额',
prop: 'lastMonthRemainMoney',
formatter: (cellValue) => {
return (cellValue.lastMonthRemainMoney || cellValue.lastMonthRemainMoney == 0) ? '¥' + cellValue.lastMonthRemainMoney.toFixed(2) : '-'
}
}, {
label: '当前库存',
prop: 'stock',
// formatter: (cellValue) => {
// return (cellValue.stock || cellValue.stock == 0) ? parseFloat(cellValue.stock).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) == 1 ? '米' : '件') : '-'
// }
}, {
label: '所属门店',
prop: 'yqMerchantName',
width: '200px'
}
]
},
baseData: {
productTypeList: [],
yqMerchantList: []
},
stockMonthVisible: false,
recordInfo: null,
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
// this.getBaseData()
// 获取全部类目
getProductTypeBySceneId({ sceneType: '' }).then(res => {
this.baseData.productTypeList = res
this.getOptionsList()
})
// 获取当前登录账号可见的园区店列表
getyqMerchantList({}).then(res => {
this.baseData.yqMerchantList = res
this.getOptionsList()
})
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
...mapActions('d2admin/user', ['actionSetDownloadList']),
// async getBaseData() {
// this.getOptionsList()
// },
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
handleSearch() {
this.$refs.recordTable.refreshTable()
},
handleReset() {
this.searchForm = {
upgradeGoodsName: '',
yqMerchantId: '',
goodsType: '',
goodsSeries: ''
}
this.$refs.recordTable.refreshTable()
},
handleExport() {
var params = this.searchFormSearch
params.method = 'dj.api.smartcarlife.MerchantGoodsStockMonthReport.export.async'
const list = [
...this.dowloadList,
{
name: '库存列表',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
// 查看
look(row) {
this.recordInfo = row
this.stockMonthVisible = true
},
dialogClose(flag) {
this.stockMonthVisible = !this.stockMonthVisible
// if (flag) {
// this.$refs.recordTable.refreshTable()
// }
},
}
}
</script>
<style scoped>
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
.leftSpan {
display: inline-block;
box-sizing: border-box;
margin-right: 10px;
}
</style>
<!-- 月度库存结算单弹窗 -->
<template>
<d2-dialog title="月度库存结算单"
:is-visible="stockMonthVisible"
class="stockMonthDailog"
width="70%"
:no-cancel="true"
btn-ok-label="关闭"
@closeDialog="handleClose"
@confirmDialog="handleClose">
<div>
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:search-select-obj="searchSelectObj"
:form-data="showFormData">
<div slot="yearChoose"
slot-scope="scope">
<el-date-picker v-model="searchForm.year"
type="year"
placeholder="选择年"
value-format="yyyy"
format="yyyy"
:clearable="false"
:picker-options="pickerOption"
@change="chooseYear">
</el-date-picker>
</div>
</d2-search>
<!-- <div class="up-btns">
<el-button @click="handleSearch"
size="small"
type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div> -->
</div>
<div class="d2-container-content">
<d2-table ref="recordTable"
:tableData="tableData"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
:hasPage="false"
:has-num="false">
</d2-table>
</div>
<!-- <span class="btn-tips"><img
src="../../../assets/icon-warn.png">说明:月平均加权单价=上月结存库存金额+本月采购金额/上月结存库存数量+本月采购数量</span> -->
</div>
</d2-dialog>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { getReportByGoods } from '@api/rightsAndInterestsManage'
import { rangePickerOptions_year_2023 } from '@/common/format'
import { membraneTypeList } from '@/common/constants.js'
export default {
name: 'StockMonthDialog',
components: {
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
membraneTypeList: membraneTypeList,
pickerOption: rangePickerOptions_year_2023,
countObj: {},
searchForm: {
year: '',
upgradeGoodsId: '',
yqMerchantId: ''
},
searchFormSearch: {},
searchSelectObj: {},
showFormData: [{
label: '年度',
addHtml: 'yearChoose',
}],
// getListApi: getReportByGoods,
tableData: [],
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
// singleSelectUniqueKey: 'id',
tableOption: false,
tableColumns: [{
label: '月份',
prop: 'dataMonth',
width: '100px'
}, {
label: '本月采购金额/元',
prop: 'purchaseMoney',
formatter: (cellValue) => {
return (cellValue.purchaseMoney || cellValue.purchaseMoney == 0) ? '¥' + cellValue.purchaseMoney.toFixed(2) : '-'
}
}, {
label: '本月采购数量',
prop: 'purchaseNum',
formatter: (cellValue) => {
return (cellValue.purchaseNum || cellValue.purchaseNum == 0) ? parseFloat(cellValue.purchaseNum).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
}
}, {
label: '月平均加权单价',
prop: 'averageWeightedPrice',
formatter: (cellValue) => {
return (cellValue.averageWeightedPrice || cellValue.averageWeightedPrice == 0) ? '¥' + cellValue.averageWeightedPrice.toFixed(2) : '-'
}
}, {
label: '出库金额/元',
prop: 'reduceStockMoney',
formatter: (cellValue) => {
return (cellValue.reduceStockMoney || cellValue.reduceStockMoney == 0) ? '¥' + cellValue.reduceStockMoney.toFixed(2) : '-'
}
}, {
label: '出库数量',
prop: 'reduceStockNum',
formatter: (cellValue) => {
return (cellValue.reduceStockNum || cellValue.reduceStockNum == 0) ? parseFloat(cellValue.reduceStockNum).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
}
}, {
label: '结存库存金额/元',
prop: 'remainMoney',
formatter: (cellValue) => {
return (cellValue.remainMoney || cellValue.remainMoney == 0) ? '¥' + cellValue.remainMoney.toFixed(2) : '-'
}
}, {
label: '结存库存数量',
prop: 'stock',
formatter: (cellValue) => {
return (cellValue.stock || cellValue.stock == 0) ? parseFloat(cellValue.stock).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
}
}
]
},
baseData: {
},
merchantDialogVisible: false,
}
},
props: {
stockMonthVisible: {
type: Boolean,
default: false
},
recordInfo: {
type: Object,
default: () => { }
},
},
computed: {
},
mounted() {
const nowDate = new Date()
this.searchForm.year = nowDate.getFullYear().toString()
if (this.recordInfo) {
this.searchForm.upgradeGoodsId = this.recordInfo.upgradeGoodsId
this.searchForm.yqMerchantId = this.recordInfo.yqMerchantId
}
this.getList()
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
chooseYear() {
this.getList()
},
getList() {
var params = deepClone(this.searchForm)
getReportByGoods(params).then(res => {
this.tableData = res
})
},
handleClose() {
this.$emit('dialogClose')
}
}
}
</script>
<style scoped>
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
.stockMonthDailog .el-dialog {
margin-top: 20vh !important;
min-width: 700px;
}
.stockMonthDailog .btn-tips img {
width: 18px;
height: 15px;
margin-right: 9px;
vertical-align: bottom;
}
.stockMonthDailog .btn-tips {
display: inline-block;
font-size: 12px;
height: 14px;
line-height: 14px;
background-color: #fff2e5;
color: #999999;
margin-right: 24px;
padding: 6.5px 10px;
}
.show-search {
margin-left: -65px;
}
</style>
<!-- 月度库存结算单弹窗 -->
<template>
<d2-dialog title="月度库存结算单"
:is-visible="stockMonthVisible"
class="stockMonthDailog"
width="70%"
:no-cancel="true"
btn-ok-label="关闭"
@closeDialog="handleClose"
@confirmDialog="handleClose">
<div>
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:search-select-obj="searchSelectObj"
:form-data="showFormData">
<div slot="yearChoose"
slot-scope="scope">
<el-date-picker v-model="searchForm.year"
type="year"
placeholder="选择年"
value-format="yyyy"
format="yyyy"
:clearable="false"
:picker-options="pickerOption"
@change="chooseYear">
</el-date-picker>
</div>
</d2-search>
<!-- <div class="up-btns">
<el-button @click="handleSearch"
size="small"
type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div> -->
</div>
<div class="d2-container-content">
<d2-table ref="recordTable"
:tableData="tableData"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn"
:hasPage="false"
:has-num="false">
</d2-table>
</div>
<!-- <span class="btn-tips"><img
src="../../../assets/icon-warn.png">说明:月平均加权单价=上月结存库存金额+本月采购金额/上月结存库存数量+本月采购数量</span> -->
</div>
</d2-dialog>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { getReportByGoods } from '@api/rightsAndInterestsManage'
import { rangePickerOptions_year_2023 } from '@/common/format'
import { membraneTypeList } from '@/common/constants.js'
export default {
name: 'StockMonthDialog',
components: {
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
membraneTypeList: membraneTypeList,
pickerOption: rangePickerOptions_year_2023,
countObj: {},
searchForm: {
year: '',
upgradeGoodsId: '',
yqMerchantId: ''
},
searchFormSearch: {},
searchSelectObj: {},
showFormData: [{
label: '年度',
addHtml: 'yearChoose',
}],
// getListApi: getReportByGoods,
tableData: [],
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
// singleSelectUniqueKey: 'id',
tableOption: false,
tableColumns: [{
label: '月份',
prop: 'dataMonth',
width: '100px'
}, {
label: '本月采购金额/元',
prop: 'purchaseMoney',
formatter: (cellValue) => {
return (cellValue.purchaseMoney || cellValue.purchaseMoney == 0) ? '¥' + cellValue.purchaseMoney.toFixed(2) : '-'
}
}, {
label: '本月采购数量',
prop: 'purchaseNum',
formatter: (cellValue) => {
return (cellValue.purchaseNum || cellValue.purchaseNum == 0) ? parseFloat(cellValue.purchaseNum).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
}
}, {
label: '月平均加权单价',
prop: 'averageWeightedPrice',
formatter: (cellValue) => {
return (cellValue.averageWeightedPrice || cellValue.averageWeightedPrice == 0) ? '¥' + cellValue.averageWeightedPrice.toFixed(2) : '-'
}
}, {
label: '出库金额/元',
prop: 'reduceStockMoney',
formatter: (cellValue) => {
return (cellValue.reduceStockMoney || cellValue.reduceStockMoney == 0) ? '¥' + cellValue.reduceStockMoney.toFixed(2) : '-'
}
}, {
label: '出库数量',
prop: 'reduceStockNum',
formatter: (cellValue) => {
return (cellValue.reduceStockNum || cellValue.reduceStockNum == 0) ? parseFloat(cellValue.reduceStockNum).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
}
}, {
label: '结存库存金额/元',
prop: 'remainMoney',
formatter: (cellValue) => {
return (cellValue.remainMoney || cellValue.remainMoney == 0) ? '¥' + cellValue.remainMoney.toFixed(2) : '-'
}
}, {
label: '结存库存数量',
prop: 'stock',
formatter: (cellValue) => {
return (cellValue.stock || cellValue.stock == 0) ? parseFloat(cellValue.stock).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
}
}
]
},
baseData: {
},
merchantDialogVisible: false,
}
},
props: {
stockMonthVisible: {
type: Boolean,
default: false
},
recordInfo: {
type: Object,
default: () => { }
},
},
computed: {
},
mounted() {
const nowDate = new Date()
this.searchForm.year = nowDate.getFullYear().toString()
if (this.recordInfo) {
this.searchForm.upgradeGoodsId = this.recordInfo.upgradeGoodsId
this.searchForm.yqMerchantId = this.recordInfo.yqMerchantId
}
this.getList()
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
chooseYear() {
this.getList()
},
getList() {
var params = deepClone(this.searchForm)
getReportByGoods(params).then(res => {
this.tableData = res
})
},
handleClose() {
this.$emit('dialogClose')
}
}
}
</script>
<style scoped>
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
.stockMonthDailog .el-dialog {
margin-top: 20vh !important;
min-width: 700px;
}
.stockMonthDailog .btn-tips img {
width: 18px;
height: 15px;
margin-right: 9px;
vertical-align: bottom;
}
.stockMonthDailog .btn-tips {
display: inline-block;
font-size: 12px;
height: 14px;
line-height: 14px;
background-color: #fff2e5;
color: #999999;
margin-right: 24px;
padding: 6.5px 10px;
}
.show-search {
margin-left: -65px;
}
</style>
<!-- 规则配置 -->
<template>
<div>
<d2-container>
<div class="header"
slot="header"
style="padding: 10px 20px;">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData" />
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<auth-button category="Button" />
</d2-table-header>
<d2-table ref="recordTable"
:get-list-api="getListApi"
:search-form="searchFormSearch"
:table-params="tableParams"
:before-search-fn="beforeSearchFn">
<auth-button slot="auth-button"
slot-scope="scope"
:data="scope.scope" />
</d2-table>
</div>
</d2-container>
<!-- 查看 -->
<stock-month-dialog :stock-month-visible="stockMonthVisible"
:recordInfo="recordInfo"
v-if="stockMonthVisible"
@dialogClose="dialogClose" />
</div>
</template>
<script>
import { Util, deepClone } from '@/common/util'
import { mapActions, mapState } from 'vuex'
import { getProductTypeBySceneId } from '@api/product'
import { getyqMerchantList, getMerchantGoodsStockMonthReport } from '@api/rightsAndInterestsManage'
import stockMonthDialog from './stockMonthDialog'
import { membraneTypeList } from '@/common/constants.js'
export default {
name: 'StockList',
components: {
stockMonthDialog
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
membraneTypeList: membraneTypeList,
searchForm: {
upgradeGoodsName: '',
yqMerchantId: '',
goodsType: '',
goodsSeries: ''
},
searchFormSearch: {},
searchSelectObj: {
orderOrTrade: {
attr: 'inputtedOrderCode',
value: ''
}
},
showFormData: [{
label: '商品名称',
name: 'upgradeGoodsName',
type: 'input',
maxlength: '20',
isClear: true
}, {
label: '系列',
name: 'goodsSeries',
type: 'input',
maxlength: '20',
isClear: true
}, {
label: '所属分类',
name: 'goodsType',
type: 'select',
optionList: [],
optionId: 'categoryType',
optionLabel: 'categoryName',
optionsName: 'productTypeList'
}, {
label: '所属门店',
name: 'yqMerchantId',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'yqMerchantList'
}],
getListApi: getMerchantGoodsStockMonthReport,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [{
label: '商品名称',
prop: 'upgradeGoodsName',
width: '160px'
}, {
label: '系列',
prop: 'goodsSeries',
width: '250px'
}, {
label: '所属分类',
prop: 'goodsTypeName',
width: '250px'
}, {
label: '上月结存库存',
prop: 'lastMonthRemainStock',
// formatter: (cellValue) => {
// return (cellValue.lastMonthRemainStock || cellValue.lastMonthRemainStock == 0) ? parseFloat(cellValue.lastMonthRemainStock).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) ? '米' : '件') : '-'
// }
}, {
label: '上月结存金额',
prop: 'lastMonthRemainMoney',
formatter: (cellValue) => {
return (cellValue.lastMonthRemainMoney || cellValue.lastMonthRemainMoney == 0) ? '¥' + cellValue.lastMonthRemainMoney.toFixed(2) : '-'
}
}, {
label: '当前库存',
prop: 'stock',
// formatter: (cellValue) => {
// return (cellValue.stock || cellValue.stock == 0) ? parseFloat(cellValue.stock).toFixed(2) + (this.membraneTypeList.includes(cellValue.goodsType) == 1 ? '米' : '件') : '-'
// }
}, {
label: '所属门店',
prop: 'yqMerchantName',
width: '200px'
}
]
},
baseData: {
productTypeList: [],
yqMerchantList: []
},
stockMonthVisible: false,
recordInfo: null,
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
mounted() {
// this.getBaseData()
// 获取全部类目
getProductTypeBySceneId({ sceneType: '' }).then(res => {
this.baseData.productTypeList = res
this.getOptionsList()
})
// 获取当前登录账号可见的园区店列表
getyqMerchantList({}).then(res => {
this.baseData.yqMerchantList = res
this.getOptionsList()
})
},
methods: {
...mapActions({
get: 'd2admin/base/get',
close: 'd2admin/page/close'
}),
...mapActions('d2admin/user', ['actionSetDownloadList']),
// async getBaseData() {
// this.getOptionsList()
// },
beforeSearchFn() {
return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm)
resolve()
})
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部') {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
}
})
},
handleSearch() {
this.$refs.recordTable.refreshTable()
},
handleReset() {
this.searchForm = {
upgradeGoodsName: '',
yqMerchantId: '',
goodsType: '',
goodsSeries: ''
}
this.$refs.recordTable.refreshTable()
},
handleExport() {
var params = this.searchFormSearch
params.method = 'dj.api.smartcarlife.MerchantGoodsStockMonthReport.export.async'
const list = [
...this.dowloadList,
{
name: '库存列表',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
// 查看
look(row) {
this.recordInfo = row
this.stockMonthVisible = true
},
dialogClose(flag) {
this.stockMonthVisible = !this.stockMonthVisible
// if (flag) {
// this.$refs.recordTable.refreshTable()
// }
},
}
}
</script>
<style scoped>
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
.leftSpan {
display: inline-block;
box-sizing: border-box;
margin-right: 10px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!