Commit 48775129 by 前端

Merge branch 'v4.20.0' into 'master'

V4.20.0

See merge request !2
2 parents ebb594d5 d2df42ee
...@@ -2839,6 +2839,11 @@ ...@@ -2839,6 +2839,11 @@
"resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
"integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==" "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ=="
}, },
"bignumber.js": {
"version": "9.1.1",
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.1.tgz",
"integrity": "sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig=="
},
"binary-extensions": { "binary-extensions": {
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
......
...@@ -9,12 +9,13 @@ ...@@ -9,12 +9,13 @@
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint"
}, },
"dependencies": { "dependencies": {
"bignumber.js": "^9.1.1",
"core-js": "^3.4.4", "core-js": "^3.4.4",
"dayjs": "^1.10.7", "dayjs": "^1.10.7",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^2.0.8", "glsx-common": "^2.0.9",
"glsx-components": "^1.2.5", "glsx-components": "^1.5.7",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuex": "^3.1.2" "vuex": "^3.1.2"
......
...@@ -37,5 +37,27 @@ const getGoodsList = (params) => { ...@@ -37,5 +37,27 @@ const getGoodsList = (params) => {
sign: true sign: true
}) })
} }
//查询服务商所有商品列表
const getfwsGoodsList = (params) => {
params.method = `scrm.api.partner.goods.list`
return http({
url: 'rop-scrm-partner/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getGoodsList,getProductInfo, getProductTypeBySceneId } // 添加自采订单
const addSelfOrder = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.purchaseOrder.selfAddOrEdit`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
export default { addSelfOrder,getGoodsList,getProductInfo, getProductTypeBySceneId ,getfwsGoodsList}
...@@ -26,6 +26,17 @@ const purchaseOrderCancelOrCheck = (params) => { ...@@ -26,6 +26,17 @@ const purchaseOrderCancelOrCheck = (params) => {
returnAll: true returnAll: true
}) })
} }
const purchaseOrderDelete = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.purchaseOrder.deleteByOrderCode`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 查看采购订单 // 查看采购订单
const purchaseOrderDetail = (params) => { const purchaseOrderDetail = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale` params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
...@@ -189,7 +200,17 @@ export function getMerchantList(params) { ...@@ -189,7 +200,17 @@ export function getMerchantList(params) {
}) })
} }
//编辑
export function selectByOrderCode(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.purchaseOrder.selectByOrderCode`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 确认发货 // 确认发货
// export function purchaseOrderConfirmDelivery(data) { // export function purchaseOrderConfirmDelivery(data) {
...@@ -198,4 +219,4 @@ export function getMerchantList(params) { ...@@ -198,4 +219,4 @@ export function getMerchantList(params) {
// return http(data) // return http(data)
// } // }
export default { getMerchantList,purchaseOrderPutIn, exportExcel, shoppingCarUpdateNumber, purchaseOrderAdd, shoppingCarAdd, shoppingCarRemove, updateSelectedFlag, listGroupByGoodsType, getPurchaseOrderList, purchaseOrderCancelOrCheck, purchaseOrderDetail, listWithPagePurchaseInfo, addressGet, addressSave }
\ No newline at end of file \ No newline at end of file
export default { selectByOrderCode,purchaseOrderDelete, getMerchantList, purchaseOrderPutIn, exportExcel, shoppingCarUpdateNumber, purchaseOrderAdd, shoppingCarAdd, shoppingCarRemove, updateSelectedFlag, listGroupByGoodsType, getPurchaseOrderList, purchaseOrderCancelOrCheck, purchaseOrderDetail, listWithPagePurchaseInfo, addressGet, addressSave }
\ No newline at end of file \ No newline at end of file
...@@ -10,15 +10,16 @@ ...@@ -10,15 +10,16 @@
// let request = require('@/http/request.js') // let request = require('@/http/request.js')
let cfg = require('./conf.js') let cfg = require('./conf.js')
import { Http, utils } from 'glsx-common' import { Http, utils } from 'glsx-common'
// console.log(Vue.prototype.$common,'999')
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) { export const fetchConfig = function (common) {
// if (isEnv) { // if (isEnv) {
// let { request } = cfg // let { request } = cfg
// Object.assign(request, { timeout }) // Object.assign(request, { timeout })
// return Promise.resolve(cfg) // return Promise.resolve(cfg)
// } // }
let params = { moduleName: 'purchase', mockUrl: 'https://oss-config.glsx.com.cn/mock/643e06c7ea3da3a974f54357/purchase/config', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } } let params = { moduleName: 'purchase', mockUrl: 'https://oss-config.glsx.com.cn/mock/643e06c7ea3da3a974f54357/purchase/config',httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
return utils.getConfig(params) return common.utils.getConfig(params)
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/616d28231072f92988f059fb/home/config') // 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) // 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)
} }
......
...@@ -12,7 +12,7 @@ let instance = null ...@@ -12,7 +12,7 @@ let instance = null
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
export async function bootstrap({ history, common, messenger, globalState ,routerBase}) { export async function bootstrap({ history, common, messenger, globalState ,routerBase}) {
const { response, request, sign, secret, sign_common, request_common } = await fetchConfig() const { response, request, sign, secret, sign_common, request_common } = await fetchConfig(common)
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
......
...@@ -37,327 +37,17 @@ export const defaultStatusOptions = [ ...@@ -37,327 +37,17 @@ export const defaultStatusOptions = [
label: "已入库" label: "已入库"
} }
] ]
export const membraneTypeList = [1, 4, 6, 12, 14] //采购类型
export const tableData = [ export const purchaseTypeList=[
{
"id": 87,
"orderCode": "CG202303246031",
"totalPrice": 2000,
"orderTime": 1679628260000,
"merchantId": 44211025,
"merchantName": "流程测试园区门店",
"putStatus": 2,
"putTime": 1679628300000,
"putMerchantId": 44211025,
"putMerchantName": "流程测试园区门店",
"status": 2,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedDate": null,
"deletedFlag": null,
"sortType": 0,
"orderTimeStart": null,
"orderTimeEnd": null,
"orderTimeStr": null,
"deliveryStatus": 2,
"putTimeStr": null,
"putTimeStart": null,
"putTimeEnd": null,
"contactName": "宋司机",
"contactPhone": "13750523252",
"contactAddress": "111111111111111111111111111111111111111111111111",
"deliveryNumber": "23213123321",
"deliveryCompany": "顺丰",
"yqMerchantIds": null
},
{
"id": 86,
"orderCode": "CG202303245909",
"totalPrice": 200,
"orderTime": 1679627865000,
"merchantId": 44211025,
"merchantName": "流程测试园区门店",
"putStatus": 2,
"putTime": 1679627971000,
"putMerchantId": 44211025,
"putMerchantName": "流程测试园区门店",
"status": 2,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedDate": null,
"deletedFlag": null,
"sortType": 0,
"orderTimeStart": null,
"orderTimeEnd": null,
"orderTimeStr": null,
"deliveryStatus": 2,
"putTimeStr": null,
"putTimeStart": null,
"putTimeEnd": null,
"contactName": "宋司机",
"contactPhone": "13750523252",
"contactAddress": "111111111111111111111111111111111111111111111111",
"deliveryNumber": "202303113333",
"deliveryCompany": "顺丰",
"yqMerchantIds": null
},
{
"id": 85,
"orderCode": "CG202303074278",
"totalPrice": 222,
"orderTime": 1678175926000,
"merchantId": 44211753,
"merchantName": "权限验证门店",
"putStatus": 1,
"putTime": null,
"putMerchantId": null,
"putMerchantName": null,
"status": 1,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedDate": null,
"deletedFlag": null,
"sortType": 0,
"orderTimeStart": null,
"orderTimeEnd": null,
"orderTimeStr": null,
"deliveryStatus": 1,
"putTimeStr": null,
"putTimeStart": null,
"putTimeEnd": null,
"contactName": "test",
"contactPhone": "13156464645",
"contactAddress": "test",
"deliveryNumber": null,
"deliveryCompany": null,
"yqMerchantIds": null
},
{
"id": 84,
"orderCode": "CG202303062215",
"totalPrice": 2,
"orderTime": 1678094753000,
"merchantId": 44211025,
"merchantName": "流程测试园区门店",
"putStatus": 1,
"putTime": null,
"putMerchantId": null,
"putMerchantName": null,
"status": 1,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedDate": null,
"deletedFlag": null,
"sortType": 0,
"orderTimeStart": null,
"orderTimeEnd": null,
"orderTimeStr": null,
"deliveryStatus": 1,
"putTimeStr": null,
"putTimeStart": null,
"putTimeEnd": null,
"contactName": "宋司机",
"contactPhone": "13750523252",
"contactAddress": "111111111111111111111111111111111111111111111111",
"deliveryNumber": null,
"deliveryCompany": null,
"yqMerchantIds": null
},
{
"id": 83,
"orderCode": "CG202303061686",
"totalPrice": 80,
"orderTime": 1678094729000,
"merchantId": 44211025,
"merchantName": "流程测试园区门店",
"putStatus": 1,
"putTime": null,
"putMerchantId": null,
"putMerchantName": null,
"status": 1,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedDate": null,
"deletedFlag": null,
"sortType": 0,
"orderTimeStart": null,
"orderTimeEnd": null,
"orderTimeStr": null,
"deliveryStatus": 1,
"putTimeStr": null,
"putTimeStart": null,
"putTimeEnd": null,
"contactName": "宋司机",
"contactPhone": "13750523252",
"contactAddress": "111111111111111111111111111111111111111111111111",
"deliveryNumber": null,
"deliveryCompany": null,
"yqMerchantIds": null
},
{ {
"id": 82, id: 1,
"orderCode": "CG202303061255", label: "商城采购"
"totalPrice": 100,
"orderTime": 1678094705000,
"merchantId": 44211025,
"merchantName": "流程测试园区门店",
"putStatus": 1,
"putTime": null,
"putMerchantId": null,
"putMerchantName": null,
"status": 1,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedDate": null,
"deletedFlag": null,
"sortType": 0,
"orderTimeStart": null,
"orderTimeEnd": null,
"orderTimeStr": null,
"deliveryStatus": 1,
"putTimeStr": null,
"putTimeStart": null,
"putTimeEnd": null,
"contactName": "宋司机",
"contactPhone": "13750523252",
"contactAddress": "111111111111111111111111111111111111111111111111",
"deliveryNumber": null,
"deliveryCompany": null,
"yqMerchantIds": null
},
{
"id": 81,
"orderCode": "CG202303068699",
"totalPrice": 200,
"orderTime": 1678094690000,
"merchantId": 44211025,
"merchantName": "流程测试园区门店",
"putStatus": 1,
"putTime": null,
"putMerchantId": null,
"putMerchantName": null,
"status": 1,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedDate": null,
"deletedFlag": null,
"sortType": 0,
"orderTimeStart": null,
"orderTimeEnd": null,
"orderTimeStr": null,
"deliveryStatus": 1,
"putTimeStr": null,
"putTimeStart": null,
"putTimeEnd": null,
"contactName": "宋司机",
"contactPhone": "13750523252",
"contactAddress": "111111111111111111111111111111111111111111111111",
"deliveryNumber": null,
"deliveryCompany": null,
"yqMerchantIds": null
},
{
"id": 80,
"orderCode": "CG202303061510",
"totalPrice": 88,
"orderTime": 1678094683000,
"merchantId": 44211025,
"merchantName": "流程测试园区门店",
"putStatus": 1,
"putTime": null,
"putMerchantId": null,
"putMerchantName": null,
"status": 1,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedDate": null,
"deletedFlag": null,
"sortType": 0,
"orderTimeStart": null,
"orderTimeEnd": null,
"orderTimeStr": null,
"deliveryStatus": 1,
"putTimeStr": null,
"putTimeStart": null,
"putTimeEnd": null,
"contactName": "宋司机",
"contactPhone": "13750523252",
"contactAddress": "111111111111111111111111111111111111111111111111",
"deliveryNumber": null,
"deliveryCompany": null,
"yqMerchantIds": null
}, },
{ {
"id": 79, id: 2,
"orderCode": "CG202303068980", label: "自采入库"
"totalPrice": 266,
"orderTime": 1678094455000,
"merchantId": 44211452,
"merchantName": "lsq园区店02",
"putStatus": 2,
"putTime": 1678938194000,
"putMerchantId": 44211452,
"putMerchantName": "lsq园区店02",
"status": 2,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedDate": null,
"deletedFlag": null,
"sortType": 0,
"orderTimeStart": null,
"orderTimeEnd": null,
"orderTimeStr": null,
"deliveryStatus": 2,
"putTimeStr": null,
"putTimeStart": null,
"putTimeEnd": null,
"contactName": "刘世权",
"contactPhone": "15089782612",
"contactAddress": "广东省深圳市龙岗区坂田街道",
"deliveryNumber": "202303061722",
"deliveryCompany": "wllw",
"yqMerchantIds": null
}, },
{ ]
"id": 78, export const membraneTypeList = [1, 4, 6, 12, 14]
"orderCode": "CG202303068011",
"totalPrice": 66,
"orderTime": 1678094339000,
"merchantId": 44211025,
"merchantName": "流程测试园区门店",
"putStatus": 1,
"putTime": null,
"putMerchantId": null,
"putMerchantName": null,
"status": 1,
"createdBy": null,
"createdDate": null,
"updatedBy": null,
"updatedDate": null,
"deletedFlag": null,
"sortType": 0,
"orderTimeStart": null,
"orderTimeEnd": null,
"orderTimeStr": null,
"deliveryStatus": 1,
"putTimeStr": null,
"putTimeStart": null,
"putTimeEnd": null,
"contactName": "宋司机",
"contactPhone": "13750523252",
"contactAddress": "111111111111111111111111111111111111111111111111",
"deliveryNumber": null,
"deliveryCompany": null,
"yqMerchantIds": null
}
]
\ No newline at end of file \ No newline at end of file
<template> <template>
<!-- <div>商品详情</div> --> <!-- <div>商品详情</div> -->
<GLDialog destroy-on-close="true" :visible.sync="dialogShow" :hasFooter="false" mode="big" bigTitle="产品详情" :close-on-click-modal="false" @onOk="handleSubmit" @onCancel="handleDetailClose"> <GLDialog destroy-on-close="true" :visible.sync="dialogShow" :hasFooter="false" mode="big" bigTitle="产品详情"
:close-on-click-modal="false" @onOk="handleSubmit" @onCancel="handleDetailClose">
<div class="detail-content"> <div class="detail-content">
<!-- 商品详情 --> <!-- 商品详情 -->
<div class="goodsInfoCom"> <div class="goodsInfoCom">
...@@ -22,16 +23,11 @@ ...@@ -22,16 +23,11 @@
<div class="skuCon"> <div class="skuCon">
<div class="label">规格:</div> <div class="label">规格:</div>
<div class="itemCon"> <div class="itemCon">
<div <div class="skuItem one-line-ellipsis pointer" :class="{ active: index === selectIndex }"
class="skuItem one-line-ellipsis pointer" v-for="(item, index) in goodsInfo.upgradeGoodsList" :key="index" @click="
:class="{ active: index === selectIndex }"
v-for="(item, index) in goodsInfo.upgradeGoodsList"
:key="index"
@click="
selectIndex = index selectIndex = index
setHandleItemInfo(item) setHandleItemInfo(item)
" ">
>
{{ item.upgradeGoodsName }} {{ item.upgradeGoodsName }}
</div> </div>
</div> </div>
...@@ -50,7 +46,12 @@ ...@@ -50,7 +46,12 @@
</div> </div>
<!-- <i class="carIcon"></i> --> <!-- <i class="carIcon"></i> -->
</div> </div>
<h3 style="margin-top:20px;">产品详情</h3> <div class="table-wrap" v-if="tableInfo.length">
<h3>适用门店</h3>
<GLTable :hasNum="false" :hasPage="false" :tableParams="tableParams" :table-data="tableInfo"></GLTable>
</div>
<div class="table-wrap">
<h3>产品详情</h3>
<div class="goodsDescList"> <div class="goodsDescList">
<div class="goodsDescItem" v-for="(item, index) in goodsInfo.goodsDescList" :key="index"> <div class="goodsDescItem" v-for="(item, index) in goodsInfo.goodsDescList" :key="index">
<img :src="item.content" v-if="item.resType == 1" class="productDetailsImg" alt="" /> <img :src="item.content" v-if="item.resType == 1" class="productDetailsImg" alt="" />
...@@ -59,6 +60,7 @@ ...@@ -59,6 +60,7 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</GLDialog> </GLDialog>
</template> </template>
...@@ -73,7 +75,7 @@ export default { ...@@ -73,7 +75,7 @@ export default {
}, },
selectItemInfo: { selectItemInfo: {
type: Object, type: Object,
default: () => {} default: () => { }
}, },
goodsId: { goodsId: {
type: [String, Number] type: [String, Number]
...@@ -92,7 +94,27 @@ export default { ...@@ -92,7 +94,27 @@ export default {
goodsNumber: 1, goodsNumber: 1,
upgradeGoodsId: '', upgradeGoodsId: '',
purchasePrice: 0 purchasePrice: 0
},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [
{
label: '商户名称',
prop: 'merchantName'
},
{
label: '商户号',
prop: 'merchantId'
},
{
label: '商品别名',
prop: 'goodsAlias'
} }
]
},
tableInfo: []
} }
}, },
computed: { computed: {
...@@ -128,6 +150,7 @@ export default { ...@@ -128,6 +150,7 @@ export default {
getGoodsDetail() { getGoodsDetail() {
this.$apis.product.getProductInfo({ id: this.goodsId }).then(res => { this.$apis.product.getProductInfo({ id: this.goodsId }).then(res => {
this.goodsInfo = res this.goodsInfo = res
this.tableInfo = res.upgradeGoodsList.filter(item => item.upgradeGoodsAlias)
// 调试用 // 调试用
// for (let index = 0; index < 12; index++) { // for (let index = 0; index < 12; index++) {
// this.goodsInfo.upgradeGoodsList[index] = this.goodsInfo.upgradeGoodsList[0] // this.goodsInfo.upgradeGoodsList[index] = this.goodsInfo.upgradeGoodsList[0]
...@@ -145,6 +168,8 @@ export default { ...@@ -145,6 +168,8 @@ export default {
upgradeGoodsId: id, upgradeGoodsId: id,
purchasePrice purchasePrice
}) })
// this.tableInfo = item.merchantGoodsInfo
this.tableInfo = item.merchantGoodsInfo.filter(item => item.goodsAlias)
}, },
handleDetailClose() { handleDetailClose() {
this.dialogShow = false this.dialogShow = false
...@@ -221,7 +246,7 @@ export default { ...@@ -221,7 +246,7 @@ export default {
font-weight: 600; font-weight: 600;
font-size: 30px; font-size: 30px;
color: #ee3040; color: #ee3040;
margin-left:8px; margin-left: 8px;
} }
} }
...@@ -290,8 +315,18 @@ export default { ...@@ -290,8 +315,18 @@ export default {
align-items: center; align-items: center;
width: 168px; width: 168px;
height: 40px; height: 40px;
margin-left:18px; margin-left: 18px;
background: #5850ff; background: #5850ff;
border-radius: 4px; border-radius: 4px;
} }
.table-wrap {
margin-top: 24px;
h3 {
font-size: 16px;
color: #333333;
margin-bottom: 16px;
}
}
</style> </style>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<img src="@/images/addressIcon.webp" alt="" class="icon" /> <img src="@/images/addressIcon.webp" alt="" class="icon" />
<span class="title">{{ paramsObj.merchantName }}</span> <span class="title">{{ paramsObj.merchantName }}</span>
</div> </div>
<div class="address-info"> <div class="address-info" v-if="paramsObj.purchaseType==1">
<span class="name"> <span class="name">
收货人: 收货人:
<span class="label">{{ detailInfo.contactName }}</span> <span class="label">{{ detailInfo.contactName }}</span>
...@@ -68,6 +68,10 @@ export default { ...@@ -68,6 +68,10 @@ export default {
prop: 'upgradeGoodsName' prop: 'upgradeGoodsName'
}, },
{ {
label: '商品编码',
prop: 'type'
},
{
label: '系列', label: '系列',
prop: 'goodsName' prop: 'goodsName'
}, },
...@@ -79,7 +83,9 @@ export default { ...@@ -79,7 +83,9 @@ export default {
label: '采购数量', label: '采购数量',
prop: 'goodsNumber', prop: 'goodsNumber',
formatter: cellValue => { formatter: cellValue => {
return membraneTypeList.includes(cellValue.goodsType) ? `${cellValue.goodsNumber}卷/${cellValue.conversionValue ? cellValue.goodsNumber * cellValue.conversionValue : '-'}米` : `${cellValue.goodsNumber}件` let condition= membraneTypeList.includes(cellValue.goodsType) ? `${cellValue.goodsNumber}卷/${cellValue.conversionValue ? cellValue.goodsNumber * cellValue.conversionValue : '-'}米` : `${cellValue.goodsNumber}件`
return this.paramsObj.purchaseType==1?condition:`${cellValue.goodsNumber}件`
} }
}, },
{ {
......
...@@ -4,16 +4,19 @@ ...@@ -4,16 +4,19 @@
<div class="container"> <div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="showFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="table-header"> <div class="table-header">
<GLButton type="primary" class="glbtn" size="small" @click="handleCreatePurchase" fn="创建采购">创建采购</GLButton> <h2>采购订单列表</h2>
<!-- <el-button type="primary" size="small" @click="handleCreatePurchase">创建采购</el-button> --> <div>
<el-button type="primary" class="btn" size="small" @click="exportExcel">导出</el-button> <GLButton type="primary" size="small" @click="handleCreatePurchase" fn="创建采购">商城采购</GLButton>
<GLButton type="primary" plain size="small" @click="handlePutStprage" fn="自采入库">自采入库</GLButton>
<el-button size="small" @click="exportExcel">导出</el-button>
</div>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="orderRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> <GLTable ref="orderRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="deliveryStatus" slot-scope="scope"> <template slot="deliveryStatus" slot-scope="scope">
<div> <div>
<span :class="[scope.scope.deliveryStatus == 1 ? 'yellowSpot' : 'greenSpot']"></span> <span v-if="scope.scope.status" :class="[scope.scope.deliveryStatus == 1 ? 'yellowSpot' : 'greenSpot']"></span>
<span>{{ scope.scope.deliveryStatus | deliveryStatus }}</span> <span>{{ scope.scope.deliveryStatus | deliveryStatus }}</span>
</div> </div>
</template> </template>
...@@ -25,15 +28,17 @@ ...@@ -25,15 +28,17 @@
</template> </template>
<template slot="status" slot-scope="scope"> <template slot="status" slot-scope="scope">
<div> <div>
<span :class="[scope.scope.status == 1 ? 'yellowSpot' : scope.scope.status == 2 ? 'greenSpot' : 'ashSpot']"></span> <span v-if="scope.scope.status" :class="[scope.scope.status == 1 ? 'yellowSpot' : scope.scope.status == 2 ? 'greenSpot' : 'ashSpot']"></span>
<span>{{ scope.scope.status | orderStatus }}</span> <span>{{ scope.scope.status | orderStatus }}</span>
</div> </div>
</template> </template>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">查看</el-button> <!-- <el-button type="text" @click="handleDetail(scope.scope)">查看</el-button>
<GLButton type="text" size="small" v-show="scope.scope.putStatus == 1 && scope.scope.purchaseType == 2" @click="handleDelete(scope.scope)" fn="删除">删除</GLButton>
<GLButton type="text" size="small" v-show="scope.scope.putStatus == 1" @click="handleEdit(scope.scope)" fn="编辑">编辑</GLButton>
<GLButton type="text" size="small" v-show="scope.scope.status == 1" @click="handleCancel(scope.scope)" fn="取消">取消</GLButton> <GLButton type="text" size="small" v-show="scope.scope.status == 1" @click="handleCancel(scope.scope)" fn="取消">取消</GLButton>
<GLButton type="text" size="small" v-show="scope.scope.putStatus == 1 && scope.scope.deliveryStatus == 2" @click="handleWarehousing(scope.scope)" fn="入库">入库</GLButton> <GLButton type="text" size="small" v-show="(scope.scope.putStatus == 1 && scope.scope.deliveryStatus == 2 && scope.scope.purchaseType == 1) || (scope.scope.putStatus == 1 && scope.scope.purchaseType == 2)" @click="handleWarehousing(scope.scope)" fn="入库">入库</GLButton> -->
<!-- <el-button type="text" v-show="scope.scope.status == 1" @click="handleCancel(scope.scope)">取消</el-button> --> <GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div> </div>
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
...@@ -46,7 +51,7 @@ ...@@ -46,7 +51,7 @@
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import orderDeatilDialog from './components/orderDetailDialog' import orderDeatilDialog from './components/orderDetailDialog'
import { defaultStatusOptions, defaultDeliveryStatusOptions, defaultPutStatusOptions, tableData } from '@/utils/constants.js' import { defaultStatusOptions, defaultDeliveryStatusOptions, defaultPutStatusOptions, purchaseTypeList } from '@/utils/constants.js'
export default { export default {
name: 'PurchaseOrder', name: 'PurchaseOrder',
components: { components: {
...@@ -61,6 +66,7 @@ export default { ...@@ -61,6 +66,7 @@ export default {
deliveryStatus: '', deliveryStatus: '',
putStatus: '', putStatus: '',
merchantId: '', merchantId: '',
purchaseType: '',
putMerchantId: '', putMerchantId: '',
sortType: 1, sortType: 1,
orderTimeStr: [], orderTimeStr: [],
...@@ -72,7 +78,6 @@ export default { ...@@ -72,7 +78,6 @@ export default {
paramsObj: {}, paramsObj: {},
// 查看门店 // 查看门店
detailVisible: false, detailVisible: false,
tableData: tableData,
showFormData: [ showFormData: [
{ {
label: '订单编号', label: '订单编号',
...@@ -107,6 +112,7 @@ export default { ...@@ -107,6 +112,7 @@ export default {
optionLabel: 'label', optionLabel: 'label',
optionsName: 'defaultPutStatusOptions' optionsName: 'defaultPutStatusOptions'
}, },
{ {
label: '下单时间', label: '下单时间',
name: 'placeOrderTimeStr', name: 'placeOrderTimeStr',
...@@ -138,6 +144,92 @@ export default { ...@@ -138,6 +144,92 @@ export default {
optionId: 'merchantNo', optionId: 'merchantNo',
optionLabel: 'merchantName', optionLabel: 'merchantName',
optionsName: 'merchantName' optionsName: 'merchantName'
},
{
label: '使用门店',
name: 'storeUsage',
type: 'select',
optionList: [],
optionId: 'merchantNo',
optionLabel: 'merchantName',
optionsName: 'storeUsageList'
},
{
label: '采购类型',
name: 'purchaseType',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'label',
optionsName: 'purchaseTypeList'
}
],
tableButtonList: [
{
type: 'el-button',
name: '查看',
attrs: {
type: 'text'
},
listeners: {
click: this.handleDetail
}
},
{
type: 'GLButton',
name: '删除',
attrs: {
type: 'text',
fn: '删除'
},
condition: row => {
return (row.putStatus == 1 && row.purchaseType == 2)
},
listeners: {
click: this.handleDelete
}
},
{
type: 'GLButton',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑'
},
condition: row => {
return (row.putStatus == 1 && row.purchaseType == 2)
},
listeners: {
click: this.handleEdit
}
},
{
type: 'GLButton',
name: '取消',
attrs: {
type: 'text',
fn: '取消'
},
condition: row => {
return row.status == 1
},
listeners: {
click: this.handleCancel
}
},
{
type: 'GLButton',
name: '入库',
attrs: {
type: 'text',
fn: '入库'
},
condition: row => {
return (row.putStatus == 1 && row.deliveryStatus == 2 && row.purchaseType == 1) || (row.putStatus == 1 && row.purchaseType == 2)
},
listeners: {
click: this.handleWarehousing
}
} }
], ],
// 表格 // 表格
...@@ -219,6 +311,15 @@ export default { ...@@ -219,6 +311,15 @@ export default {
} }
}, },
{ {
label: '采购类型',
prop: 'purchaseType',
line: 1,
width: 150,
formatter: cellValue => {
return (cellValue.purchaseType && (cellValue.purchaseType == 1 ? '商城采购' : '自采入库')) || '--'
}
},
{
label: '订单状态', label: '订单状态',
prop: 'status', prop: 'status',
addHtml: 'status', addHtml: 'status',
...@@ -237,7 +338,9 @@ export default { ...@@ -237,7 +338,9 @@ export default {
defaultStatusOptions: defaultStatusOptions, defaultStatusOptions: defaultStatusOptions,
defaultDeliveryStatusOptions: defaultDeliveryStatusOptions, defaultDeliveryStatusOptions: defaultDeliveryStatusOptions,
defaultPutStatusOptions: defaultPutStatusOptions, defaultPutStatusOptions: defaultPutStatusOptions,
merchantName: [] merchantName: [],
storeUsageList: [],
purchaseTypeList: purchaseTypeList
} }
} }
}, },
...@@ -245,6 +348,7 @@ export default { ...@@ -245,6 +348,7 @@ export default {
mounted() { mounted() {
this.$apis.purchaseShopping.getMerchantList({}).then(res => { this.$apis.purchaseShopping.getMerchantList({}).then(res => {
this.baseData.merchantName = res this.baseData.merchantName = res
this.baseData.storeUsageList = res
this.getOptionsList('showFormData') this.getOptionsList('showFormData')
}) })
}, },
...@@ -252,7 +356,6 @@ export default { ...@@ -252,7 +356,6 @@ export default {
methods: { methods: {
getParams() { getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
console.log(this.searchForm)
if (this.searchForm.placeOrderTimeStr.length) { if (this.searchForm.placeOrderTimeStr.length) {
params.orderTimeStr[0] = new Date(this.searchForm.placeOrderTimeStr[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' params.orderTimeStr[0] = new Date(this.searchForm.placeOrderTimeStr[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.orderTimeStr[1] = new Date(this.searchForm.placeOrderTimeStr[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59' params.orderTimeStr[1] = new Date(this.searchForm.placeOrderTimeStr[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
...@@ -319,10 +422,25 @@ export default { ...@@ -319,10 +422,25 @@ export default {
handleDetail(row) { handleDetail(row) {
this.paramsObj = { this.paramsObj = {
orderCode: row.orderCode, orderCode: row.orderCode,
merchantName: row.merchantName merchantName: row.merchantName,
purchaseType:row.purchaseType
} }
this.detailVisible = true this.detailVisible = true
}, },
//自采入库-编辑
handleEdit(row) {
this.$router.push({
path: '/purchaseOrder/into',
query: {
orderCode: row.orderCode
}
})
},
//删除
handleDelete(row) {
this.secondConfirm('删除', '删除后不可恢复。是否确定删除?', 'purchaseShopping', 'purchaseOrderDelete', { orderCode: row.orderCode })
},
//取消 //取消
handleCancel(row) { handleCancel(row) {
this.secondConfirm('取消', '订单取消后即自动作废该订单,且无法撤回。是否确定取消?', 'purchaseShopping', 'purchaseOrderCancelOrCheck', { orderCode: row.orderCode, operateType: 2 }) this.secondConfirm('取消', '订单取消后即自动作废该订单,且无法撤回。是否确定取消?', 'purchaseShopping', 'purchaseOrderCancelOrCheck', { orderCode: row.orderCode, operateType: 2 })
...@@ -361,6 +479,10 @@ export default { ...@@ -361,6 +479,10 @@ export default {
handleCreatePurchase() { handleCreatePurchase() {
this.$router.push('/purchaseOrder/add') this.$router.push('/purchaseOrder/add')
}, },
// 自采入库
handlePutStprage() {
this.$router.push('/purchaseOrder/into')
},
exportExcel() { exportExcel() {
var params = this.getParams() var params = this.getParams()
this.$apis.purchaseShopping.exportExcel(params).then(res => { this.$apis.purchaseShopping.exportExcel(params).then(res => {
...@@ -378,6 +500,7 @@ export default { ...@@ -378,6 +500,7 @@ export default {
putStatus: '', putStatus: '',
merchantId: '', merchantId: '',
putMerchantId: '', putMerchantId: '',
purchaseType: '',
sortType: 1, sortType: 1,
orderTimeStr: [], orderTimeStr: [],
putTimeStr: [], putTimeStr: [],
...@@ -396,14 +519,15 @@ export default { ...@@ -396,14 +519,15 @@ export default {
.table-header { .table-header {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 25px; justify-content: space-between;
margin-top:20px; margin-bottom: 10px;
margin-top: 20px;
h2 { h2 {
font-weight: 600; font-weight: 600;
font-size: 16px; font-size: 16px;
color: #333; color: #333;
} }
.glbtn{ .glbtn {
left: 46px; left: 46px;
position: absolute; position: absolute;
} }
......
<template>
<div>
<div class="container">
<div class="table-header">
<h2 class="title">采购明细</h2>
<el-button type="primary" size="small" @click="addLine">添加一行</el-button>
</div>
<el-form ref="addForm" :model="formdata" size="small" :rules="rules">
<GLTable ref="orderRef" :tableData="formdata.tableData" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :hasPage="false">
<template slot="upgradeGoodsId" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" :prop="'tableData.' + scope.index + '.upgradeGoodsId'" :rules="rules.upgradeGoodsId">
<el-select style="width: 100%" v-model="scope.scope.upgradeGoodsId" placeholder="请选择" @change="getGoodsName(scope.scope, scope.scope.upgradeGoodsId)">
<el-option v-for="item in goodsList" :key="item.upgradeGoodsId" :label="item.goodsName" :value="item.upgradeGoodsId"></el-option>
</el-select>
</el-form-item>
</template>
<template slot="goodsNumber" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" :prop="'tableData.' + scope.index + '.goodsNumber'" :rules="rules.goodsNumber">
<el-input v-model="scope.scope.goodsNumber" placeholder="请输入" @blur="handleCalculate(scope.scope, 'goodsNumber')"></el-input>
</el-form-item>
</template>
<template slot="upgradePurchasePrice" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" :prop="'tableData.' + scope.index + '.upgradePurchasePrice'" :rules="rules.upgradePurchasePrice">
<el-input v-model="scope.scope.upgradePurchasePrice" placeholder="请输入" @blur="handleCalculate(scope.scope, 'upgradePurchasePrice')"></el-input>
</el-form-item>
</template>
<template slot="goodsTotalPrice" slot-scope="scope">
<el-form-item style="margin-bottom: 0px" :prop="'tableData.' + scope.index + '.goodsTotalPrice'" :rules="rules.goodsTotalPrice">
<el-input v-model="scope.scope.goodsTotalPrice" placeholder="请输入" @blur="handleCalculate(scope.scope, 'goodsTotalPrice')"></el-input>
</el-form-item>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDelete(scope.index)">删除</el-button>
</div>
</GLTable>
</el-form>
</div>
<GLFooter style="margin-top: 16px">
<el-button @click="goBack" size="medium">取消</el-button>
<el-button @click="handleSave(1)" type="primary" plain size="medium">保存</el-button>
<el-button type="primary" @click="handleSave(2)" size="medium">保存并入库</el-button>
</GLFooter>
</div>
</template>
<script>
import BigNumber from 'bignumber.js'
export default {
data() {
var checkPrice = (rule, value, callback) => {
if (isNaN(+value)) {
callback(new Error('请输入数字值'))
} else {
if (value <= 0 || value > 999999) {
callback(new Error('仅支持输入0~999999'))
} else {
callback()
}
}
}
return {
orderCode: this.$route.query.orderCode || '',
rules: {
upgradeGoodsId: [{ required: true, message: '请选择商品名称', trigger: 'change' }],
goodsTotalPrice: [
{ required: true, message: '请输入采购总额', trigger: 'blur' },
{ validator: checkPrice, trigger: 'blur' }
],
goodsNumber: [
{ required: true, message: '请输入采购数量', trigger: 'blur' },
{ validator: checkPrice, trigger: 'blur' }
],
upgradePurchasePrice: [
{ required: true, message: '请输入采购单价', trigger: 'blur' },
{ validator: checkPrice, trigger: 'blur' }
]
},
formdata: {
tableData: [{ upgradeGoodsId: '', type: '', goodsName: '', goodsNumber: '', upgradePurchasePrice: '', goodsTotalPrice: '' }]
},
tableParams: {
tableOption: true,
tableColumns: [
{
label: '商品名称',
prop: 'upgradeGoodsId',
addHtml: 'upgradeGoodsId'
},
{
label: '商品编码',
prop: 'type'
},
{
label: '所属系列',
prop: 'goodsName'
},
{
label: '采购数量',
prop: 'goodsNumber',
addHtml: 'goodsNumber'
},
{
label: '采购单价',
prop: 'upgradePurchasePrice',
addHtml: 'upgradePurchasePrice'
},
{
label: '采购总额/元',
prop: 'goodsTotalPrice',
addHtml: 'goodsTotalPrice'
}
]
},
goodsList: []
}
},
created() {
this.getfwsGoodsList()
if (this.orderCode) this.getData()
},
methods: {
handleSave(saveOrWarehousing) {
this.$refs['addForm'].validate(valid => {
if (valid) {
let purchaseOrderGoodsList = []
this.formdata.tableData.forEach(item => {
purchaseOrderGoodsList.push({
upgradeGoodsId: item.upgradeGoodsId,
goodsName: item.goodsName,
goodsNumber: item.goodsNumber,
upgradePurchasePrice: item.upgradePurchasePrice,
goodsTotalPrice: item.goodsTotalPrice
})
})
let params = {
saveOrWarehousing,
purchaseOrderGoodsList
}
if (this.orderCode) params.orderCode = this.orderCode
if (saveOrWarehousing == 2) {
this.$confirm('入库后自动更新对应的库存且不可撤回,可在入库管理中查看记录。是否确定入库?', '入库提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$apis.product.addSelfOrder(params).then(res => {
this.$notify({
type: 'success',
title: '操作成功'
})
this.goBack()
})
})
} else {
this.$apis.product.addSelfOrder(params).then(res => {
this.$notify({
type: 'success',
title: '操作成功'
})
this.goBack()
})
}
}
})
},
getData() {
this.$apis.purchaseShopping.selectByOrderCode({ orderCode: this.orderCode }).then(res => {
this.formdata.tableData = res
})
},
handleDelete(index) {
if (this.formdata.tableData.length == 1) return
this.formdata.tableData.splice(index, 1)
},
getfwsGoodsList() {
this.$apis.product.getfwsGoodsList({}).then(res => {
this.goodsList = res
})
},
getGoodsName(data, id) {
this.goodsList.forEach(item => {
if (item.upgradeGoodsId == id) {
data.type = item.type
data.goodsName = item.goodsCodeName
}
})
},
handleCalculate(data, key) {
if (key == 'goodsNumber') {
data[key] = data[key]?new BigNumber(data[key]).dp(0).toNumber():''
data.goodsTotalPrice = data.upgradePurchasePrice&&data.goodsNumber?new BigNumber(data.upgradePurchasePrice)
.times(data.goodsNumber)
.dp(2)
.toNumber():''
return
}
if (!data.goodsNumber) return
data[key] = data[key]?new BigNumber(data[key]).dp(2).toNumber():''
let params = {
upgradePurchasePrice: data => {
data.goodsTotalPrice = data.upgradePurchasePrice?new BigNumber(data.upgradePurchasePrice)
.times(data.goodsNumber)
.dp(2)
.toNumber():''
},
goodsTotalPrice: data => {
data.upgradePurchasePrice = data.goodsTotalPrice?new BigNumber(data.goodsTotalPrice)
.div(data.goodsNumber)
.dp(2)
.toNumber():''
}
}
params[key](data)
},
addLine() {
this.formdata.tableData.unshift({
upgradeGoodsId: '',
type: '',
goodsName: '',
goodsNumber: '',
upgradePurchasePrice: '',
goodsTotalPrice: ''
})
},
goBack() {
this.$router.go(-1)
}
}
}
</script>
<style lang="scss" scoped>
.container {
background: #fff;
padding: 20px;
.table-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 15px;
}
.title {
font-weight: 600;
font-size: 16px;
color: #333333;
margin-bottom: 15px;
}
/deep/ .el-form-item__error {
padding-top: 2px;
z-index: 9999999;
position: static;
}
/deep/ td.el-table__cell {
height: 64px;
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!