Commit 9997c6b6 by 前端

Merge branch 'v4.22.0' into 'master'

V4.22.0

See merge request !2
2 parents 325b20d9 b736e7ac
...@@ -10,7 +10,6 @@ html { ...@@ -10,7 +10,6 @@ html {
.container { .container {
background: #ffffff; background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px; padding: 20px;
} }
...@@ -21,7 +20,8 @@ html { ...@@ -21,7 +20,8 @@ html {
} }
.commodity .edit-container { .commodity .edit-container {
margin-bottom: 32px; margin-bottom: 16px;
} }
// form-start // form-start
...@@ -30,7 +30,7 @@ html { ...@@ -30,7 +30,7 @@ html {
} }
.commodity .edit-form-container { .commodity .edit-form-container {
margin-top: 20px; margin:20px 20px 0 0;
} }
.commodity .edit-title { .commodity .edit-title {
...@@ -73,7 +73,18 @@ html { ...@@ -73,7 +73,18 @@ html {
width: 36px; width: 36px;
height: 36px; height: 36px;
} }
.text-6{
color: #666666;
}
.text-3{
color: #333333;
}
.font-12{
font-size: 12px;
}
.weight-6 {
font-weight: 600;
}
.carIcon { .carIcon {
display: inline-block; display: inline-block;
width: 22px; width: 22px;
...@@ -82,3 +93,17 @@ html { ...@@ -82,3 +93,17 @@ html {
background-size: 100% 100%; background-size: 100% 100%;
margin-right: 4px; margin-right: 4px;
} }
.el-tooltip__popper.is-light {
background: #ffffff;
box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.08);
border: 1px solid #e4e7ed !important;
width: 177px;
box-sizing: border-box;
}
.el-tooltip__popper[x-placement^='top'] .popper__arrow {
border-color: #e4e7ed !important;
}
.el-tooltip__popper[x-placement^='top'] .popper__arrow:after {
border-bottom-color: #e4e7ed !important;
}
...@@ -27,7 +27,7 @@ function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, max ...@@ -27,7 +27,7 @@ function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, max
} }
return newValue return newValue
} else { } else {
return newValue ? oldValue : '' return newValue ? oldValue : newValue
} }
} }
......
<!-- 订单详情 --> <!-- 订单详情 -->
<template> <template>
<div class="order-detail marketing"> <div class="order-detail marketing">
<div class="edit-box"> <div class="edit-box ">
<div class="container m-b-20"> <div class="m-b-20 bgf">
<p class="edit-title">基础信息</p> <p class="edit-title">基础信息</p>
<el-form label-width="120px" :inline="true"> <el-form label-width="120px" :inline="true" class="context-wrap">
<el-row v-for="(item, index) in detailFormDataRow" :key="index"> <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 v-for="(subItem, subIndex) in item.rowList" :key="subIndex">
<template v-if="detailForm[subItem.name] != '-'">
<el-form-item :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> <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-form-item>
</template>
</span>
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
<div class="container edit-container"> <div class="edit-container bgf">
<p class="edit-title">使用门店</p> <p class="edit-title">使用门店</p>
<GLTable ref="warehousListRef" :hasPage="false" :tableParams="tableParams" :tableData="detailForm.merchantList"></GLTable> <GLTable ref="warehousListRef" class="context-wrap" :hasPage="false" :tableParams="tableParams" :tableData="detailForm.merchantList"></GLTable>
</div> </div>
</div> </div>
<GLFooter> <!-- <GLFooter>
<el-button @click="handleCancel" size="medium">取消</el-button> <el-button @click="handleCancel" size="medium">取消</el-button>
</GLFooter> </GLFooter> -->
</div> </div>
</template> </template>
...@@ -81,11 +86,16 @@ export default { ...@@ -81,11 +86,16 @@ export default {
isNum: true isNum: true
}, },
{ {
label: '库存预警', label: '库存下限预警',
name: 'warningValue', name: 'warningValue',
isNum: true isNum: true
}, },
{ {
label: '库存预警上限',
name: 'warningValueMax',
isNum: true
},
{
label: '质保年限', label: '质保年限',
name: 'warrantyPeriod', name: 'warrantyPeriod',
isNum: true isNum: true
...@@ -103,7 +113,7 @@ export default { ...@@ -103,7 +113,7 @@ export default {
prop: 'merchantId' prop: 'merchantId'
} }
] ]
}, }
} }
}, },
...@@ -141,13 +151,14 @@ export default { ...@@ -141,13 +151,14 @@ export default {
this.detailForm.baseProductFlag == 'Y' ? list.push('基础产品') : '' this.detailForm.baseProductFlag == 'Y' ? list.push('基础产品') : ''
this.detailForm.upgradeProductFlag == 'Y' ? list.push('升级产品') : '' this.detailForm.upgradeProductFlag == 'Y' ? list.push('升级产品') : ''
this.detailForm.typeTxt = list.join(',') this.detailForm.typeTxt = list.join(',')
if(list.length != 2 && this.detailForm.baseProductFlag == 'Y'){ if (list.length != 2 && this.detailForm.baseProductFlag == 'Y') {
this.detailForm.sellPrice = '-'; this.detailForm.sellPrice = '-'
this.detailForm.minSellPrice = '-' this.detailForm.minSellPrice = '-'
this.detailForm.productCost = '-' this.detailForm.productCost = '-'
} }
if(this.detailForm.goodsCodeName != '太阳膜') { if (this.detailForm.goodsCodeName != '太阳膜') {
this.detailForm.warrantyPeriod = '-' this.detailForm.warrantyPeriod = '-'
this.detailForm.giftCost = '-'
} else { } else {
this.detailForm.warrantyPeriod = (this.detailForm.warrantyPeriod || 0) + '年' this.detailForm.warrantyPeriod = (this.detailForm.warrantyPeriod || 0) + '年'
} }
...@@ -192,4 +203,17 @@ export default { ...@@ -192,4 +203,17 @@ export default {
margin-top: 10px; margin-top: 10px;
margin-right: 20px; margin-right: 20px;
} }
.edit-title {
height: 56px;
background: #ffffff;
line-height: 56px;
border-bottom: 1px solid #f0f1f7;
padding-left: 20px;
}
.bgf {
background: #ffffff;
}
.context-wrap {
padding: 20px;
}
</style> </style>
...@@ -51,7 +51,8 @@ const editCommodityObj = { ...@@ -51,7 +51,8 @@ const editCommodityObj = {
minSellPrice: [{ required: true, message: '请输入最低售价', trigger: 'change' }], minSellPrice: [{ required: true, message: '请输入最低售价', trigger: 'change' }],
giftCost: [{ required: true, message: '请输入赠送成本', trigger: 'change' }], giftCost: [{ required: true, message: '请输入赠送成本', trigger: 'change' }],
productCost: [{ required: true, message: '请输入产品成本', trigger: 'change' }], productCost: [{ required: true, message: '请输入产品成本', trigger: 'change' }],
warningValue: [{ required: true, message: '请输入库存预警', trigger: 'change' }], // warningValue: [{ required: true, message: '请输入库存预警下限', trigger: 'change' }],
// warningValueMax: [{ required: true, message: '请输入库存预警上限', trigger: 'change' }],
merchantList: [{ required: true, message: '请选择门店', trigger: 'change' }], merchantList: [{ required: true, message: '请选择门店', trigger: 'change' }],
warrantyPeriod: [{ required: true, message: '请输入质保年限', trigger: 'change' }] warrantyPeriod: [{ required: true, message: '请输入质保年限', trigger: 'change' }]
}, },
...@@ -77,7 +78,6 @@ const editCommodityObj = { ...@@ -77,7 +78,6 @@ const editCommodityObj = {
optionLabel: 'goodsName', optionLabel: 'goodsName',
optionsName: 'goodsSeriesList', optionsName: 'goodsSeriesList',
changeAttr: function(val, targetItem, that) { changeAttr: function(val, targetItem, that) {
console.log(val, targetItem, that)
let labeList = ['产品类型','质保年限'] let labeList = ['产品类型','质保年限']
let txt = targetItem.optionList.find(k => k.goodsCode == val)?.goodsName || '' let txt = targetItem.optionList.find(k => k.goodsCode == val)?.goodsName || ''
that.changeFormAttr('editFormData', 'isHide', labeList, txt != '太阳膜') that.changeFormAttr('editFormData', 'isHide', labeList, txt != '太阳膜')
...@@ -85,6 +85,7 @@ const editCommodityObj = { ...@@ -85,6 +85,7 @@ const editCommodityObj = {
that.editForm.baseProductFlag = 'N' that.editForm.baseProductFlag = 'N'
that.editForm.upgradeProductFlag = 'Y' that.editForm.upgradeProductFlag = 'Y'
that.handleCheckChange('Y', 'upgradeProductFlag') that.handleCheckChange('Y', 'upgradeProductFlag')
that.handleCheckChange('N', 'baseProductFlag')
} }
} }
}, },
...@@ -121,11 +122,16 @@ const editCommodityObj = { ...@@ -121,11 +122,16 @@ const editCommodityObj = {
isHide: true isHide: true
}, },
{ {
label: '库存预警', label: '库存下限预警/件',
name: 'warningValue', name: 'warningValue',
type: 'input' type: 'input'
}, },
{ {
label: '库存上限预警/件',
name: 'warningValueMax',
type: 'input'
},
{
label: '质保年限', label: '质保年限',
name: 'warrantyPeriod', name: 'warrantyPeriod',
type: 'input', type: 'input',
......
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
</div> </div>
<div class="container edit-container"> <div class="container edit-container">
<p class="edit-title">使用门店</p> <p class="edit-title">使用门店</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormMerchantRef" :isEdit="isEdit" :labelWidth="defaultLabelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="merchantEditFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container" ref="editFormMerchantRef" :isEdit="isEdit" :labelWidth="defaultLabelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="merchantEditFormData" :formRules="editRule">
<div slot="merchantTable" class="merchant-table" :style="{ width: `calc(100% - ${defaultLabelWidth} )` }"> <div slot="merchantTable" :style="{ width: `calc(100% - ${defaultLabelWidth} )` }">
<div class="table-title"> <div class="table-title">
使用门店列表 使用门店列表
<el-button type="default" @click="handleRelateStoreClose(scope)">{{ editForm.merchantList.length ? '更换门店' : '选择门店' }}</el-button> <el-button type="primary" plain @click="handleRelateStoreClose(scope)">{{ editForm.merchantList.length ? '更换门店' : '选择门店' }}</el-button>
</div> </div>
<GLTable ref="warehousListRef" :hasPage="false" :tableParams="tableParams" :tableData="editForm.merchantList"> <GLTable ref="warehousListRef" :hasPage="false" :tableParams="tableParams" :tableData="editForm.merchantList">
<span slot="customBtn" slot-scope="scope"> <span slot="customBtn" slot-scope="scope">
...@@ -109,7 +109,7 @@ export default { ...@@ -109,7 +109,7 @@ export default {
}, },
// 售价 // 售价
'editForm.sellPrice'(newValue, oldValue) { 'editForm.sellPrice'(newValue, oldValue) {
this.editForm.sellPrice = limitPrice(newValue, oldValue, 6, 2,) this.editForm.sellPrice = limitPrice(newValue, oldValue, 6, 2)
}, },
// 最低售价 // 最低售价
'editForm.minSellPrice'(newValue, oldValue) { 'editForm.minSellPrice'(newValue, oldValue) {
...@@ -117,16 +117,20 @@ export default { ...@@ -117,16 +117,20 @@ export default {
}, },
// 赠送成本 // 赠送成本
'editForm.giftCost'(newValue, oldValue) { 'editForm.giftCost'(newValue, oldValue) {
this.editForm.giftCost = limitPrice(newValue, oldValue, 6, 2) this.editForm.giftCost = limitPrice(newValue, oldValue, 6, 2) ? limitPrice(newValue, oldValue, 6, 2) : this.editForm.giftCost
}, },
// 产品成本 // 产品成本
'editForm.productCost'(newValue, oldValue) { 'editForm.productCost'(newValue, oldValue) {
this.editForm.productCost = limitPrice(newValue, oldValue, 6, 2) this.editForm.productCost = limitPrice(newValue, oldValue, 6, 2)
}, },
// 库存预警 // 库存下限预警
'editForm.warningValue'(newValue, oldValue) { 'editForm.warningValue'(newValue, oldValue) {
this.editForm.warningValue = limitPrice(newValue, oldValue, 6, 2) this.editForm.warningValue = limitPrice(newValue, oldValue, 6, 2)
}, },
// 库存预警上限
'editForm.warningValueMax'(newValue, oldValue) {
this.editForm.warningValueMax = limitPrice(newValue, oldValue, 6, 2)
},
// 年限 // 年限
'editForm.warrantyPeriod'(newValue, oldValue) { 'editForm.warrantyPeriod'(newValue, oldValue) {
this.editForm.warrantyPeriod = limitPrice(newValue, oldValue, 2, 0) this.editForm.warrantyPeriod = limitPrice(newValue, oldValue, 2, 0)
...@@ -144,7 +148,7 @@ export default { ...@@ -144,7 +148,7 @@ export default {
methods: { methods: {
keyDown() { keyDown() {
document.onkeydown = function () { document.onkeydown = function() {
var evt = window.event || arguments[0] var evt = window.event || arguments[0]
if (evt && evt.keyCode == 13) { if (evt && evt.keyCode == 13) {
if (typeof evt.cancelBubble != 'undefined') evt.cancelBubble = true if (typeof evt.cancelBubble != 'undefined') evt.cancelBubble = true
...@@ -164,6 +168,7 @@ export default { ...@@ -164,6 +168,7 @@ export default {
this.handleCheckChange(res.baseProductFlag, 'baseProductFlag') this.handleCheckChange(res.baseProductFlag, 'baseProductFlag')
this.handleCheckChange(res.upgradeProductFlag, 'upgradeProductFlag') this.handleCheckChange(res.upgradeProductFlag, 'upgradeProductFlag')
} }
this.editForm = res this.editForm = res
this.$nextTick(() => { this.$nextTick(() => {
this.editStatus = false this.editStatus = false
...@@ -191,8 +196,7 @@ export default { ...@@ -191,8 +196,7 @@ export default {
}, },
// 产品类型改变 // 产品类型改变
handleCheckChange(val, attr) { handleCheckChange(val, attr) {
console.log(val, attr) let baseAttrList = ['赠送成本/元']
let baseAttrList = ['赠送成本/元',]
let upAttrList = ['售价/元', '最低售价/元', '产品成本/元'] let upAttrList = ['售价/元', '最低售价/元', '产品成本/元']
switch (attr) { switch (attr) {
case 'baseProductFlag': case 'baseProductFlag':
...@@ -211,17 +215,14 @@ export default { ...@@ -211,17 +215,14 @@ export default {
minSellPrice: '', minSellPrice: '',
productCost: '', productCost: '',
warningValue: '', warningValue: '',
warningValueMax: '',
giftCost: '', giftCost: '',
warrantyPeriod: '' warrantyPeriod: ''
} }
}, },
changeFormAttr(formName, attrName, labelList, attrValue) { changeFormAttr(formName, attrName, labelList, attrValue) {
console.log(formName, attrName, labelList, attrValue)
console.log(this[formName])
labelList.forEach(item => { labelList.forEach(item => {
console.log(item)
let idx = this[formName]?.findIndex(k => { let idx = this[formName]?.findIndex(k => {
console.log(k)
return k.label == item return k.label == item
}) })
this[formName][idx][attrName] = attrValue this[formName][idx][attrName] = attrValue
...@@ -248,8 +249,8 @@ export default { ...@@ -248,8 +249,8 @@ export default {
type: 'warning', type: 'warning',
callback: action => { callback: action => {
if (action == 'confirm') { if (action == 'confirm') {
var idx = this.editForm.merchantList.findIndex(item => item.merchantNo == obj.scope.merchantNo) var idx = this.editForm.merchantList.findIndex(item => item.merchantId == obj.scope.merchantId)
this.editForm.merchantList.splice(idx, 1) this.editForm.merchantList.splice(idx--, 1)
} }
} }
}) })
...@@ -291,7 +292,7 @@ export default { ...@@ -291,7 +292,7 @@ export default {
.then(() => { .then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => { }) .catch(() => {})
} else { } else {
this.cancelJump() this.cancelJump()
} }
......
...@@ -3,12 +3,31 @@ ...@@ -3,12 +3,31 @@
<div class="container"> <div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="table-header"> <div class="table-header">
<GLButton type="primary" size="small" @click="handleEdit('add')" fn="新增">新增商品</GLButton> <h2>商品管理列表</h2>
<el-button type="primary" size="small" @click="handleExport">导出</el-button> <div>
<GLButton type="primary" plain size="small" @click="handleEdit('add')" fn="新增">新增商品</GLButton>
<el-button size="small" @click="handleExport">导出</el-button>
</div>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="commofityRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"> <GLTable ref="commofityRef" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="merchantName" slot-scope="scope">
<el-tooltip v-if="scope.scope.merchantList.length > 0" placement="top" effect="light">
<div slot="content">
<div class="text-3 font-12 weight-6" style="line-height:24px">上家门店</div>
<div class="merchant-wrap">
<div class="text-6 font-12" style="line-height:24px" v-for="item in scope.scope.merchantList" :key="item">{{ item.merchantName }}</div>
</div>
</div>
<div class="use-store">
<img src="@/assets/store.png" />
x {{ scope.scope.merchantList.length }}
</div>
</el-tooltip>
<span v-else>--</span>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton> <GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div> </div>
...@@ -50,12 +69,14 @@ export default { ...@@ -50,12 +69,14 @@ export default {
{ {
label: '商品名称', label: '商品名称',
prop: 'goodsName', prop: 'goodsName',
width: '200' width: '150',
line: 1
}, },
{ {
label: '商品编码', label: '商品编码',
prop: 'type', prop: 'type',
width: '110' width: '110',
line: 1
}, },
{ {
label: '所属系列', label: '所属系列',
...@@ -78,7 +99,8 @@ export default { ...@@ -78,7 +99,8 @@ export default {
}, },
{ {
label: '最低售价/元', label: '最低售价/元',
prop: 'minSellPrice' prop: 'minSellPrice',
width: 120
}, },
{ {
label: '赠送成本', label: '赠送成本',
...@@ -89,13 +111,19 @@ export default { ...@@ -89,13 +111,19 @@ export default {
prop: 'productCost' prop: 'productCost'
}, },
{ {
label: '质保年限/年',
prop: 'warrantyPeriod',
width: 120
},
{
label: '使用门店', label: '使用门店',
prop: '', prop: '',
formatter: cellValue => { addHtml: 'merchantName',
return cellValue.merchantList?.map(item => item.merchantName).join(',') // formatter: cellValue => {
}, // return cellValue.merchantList.length==1?cellValue.merchantList?.map(item => item.merchantName).join(','):cellValue.merchantList.length
width: 200, // },
line: 1 width: 150
// line: 1
}, },
{ {
label: '创建日期', label: '创建日期',
...@@ -249,4 +277,35 @@ export default { ...@@ -249,4 +277,35 @@ export default {
} }
} }
</script> </script>
<style scoped></style> <style scoped lang="scss">
.container{
padding:20px;
}
.use-store {
display: flex;
font-size: 14px;
color: #5850ff;
align-items: center;
img {
width: 14px;
height: 12.98px;
margin-right: 8px;
}
}
.table-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
margin-top: 20px;
h2 {
font-weight: 600;
font-size: 16px;
color: #333;
}
}
.merchant-wrap{
max-height:200px;
overflow: scroll;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!