This commit is contained in:
KangKang0928 2024-08-22 17:40:02 +08:00
parent 5d4ce160ea
commit 9931ae862f
4 changed files with 215 additions and 182 deletions

View File

@ -54,7 +54,7 @@
"jsencrypt": "3.0.0-rc.1", "jsencrypt": "3.0.0-rc.1",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"obj-modal": "^1.2.0", "obj-modal": "^1.2.2",
"obj-table-plus": "^2.4.0", "obj-table-plus": "^2.4.0",
"quill": "1.3.7", "quill": "1.3.7",
"screenfull": "5.0.2", "screenfull": "5.0.2",

View File

@ -16,6 +16,7 @@ module.exports = {
"checkbox-config": { labelField: "", checkRowKeys: [10053, 23666] }, "checkbox-config": { labelField: "", checkRowKeys: [10053, 23666] },
"highlight-current-row": true, "highlight-current-row": true,
"show-overflow": true, "show-overflow": true,
"scroll-y":{enabled:true},
"tree-config": { childrenField: "children" }, "tree-config": { childrenField: "children" },
"header-cell-class-name":"obj-table-header-cell" "header-cell-class-name":"obj-table-header-cell"
}, },

View File

@ -177,7 +177,8 @@ export default {
// //
const openPreview = (str) => { const openPreview = (str) => {
this.$confirm(str, "详情", { this.$confirm(str, "详情", {
showCancel: false, showCancelButton: false,
confirmButtonText:"好的"
}); });
}; };
return ( return (

View File

@ -9,13 +9,6 @@
:modalData="modalData" :modalData="modalData"
:modalHandles="modalHandles" :modalHandles="modalHandles"
> >
<template slot="dialog__before">
<!-- <el-tabs v-model="currentPanel">
<el-tab-pane label="基础信息" name="基础信息"></el-tab-pane>
<el-tab-pane label="销售信息" name="销售信息"></el-tab-pane>
<el-tab-pane label="其他信息" name="其他信息"></el-tab-pane>
</el-tabs> -->
</template>
</obj-modal> </obj-modal>
</div> </div>
</template> </template>
@ -70,6 +63,16 @@ export default {
return "还有未保存的数据,确定离开此页吗?"; return "还有未保存的数据,确定离开此页吗?";
}; };
}, },
watch: {
"modalConfig.show"(newVal) {
if (newVal) {
//
setTimeout(() => {
this.$refs.modal.clearValidate();
});
}
},
},
methods: { methods: {
computedCityOptions() { computedCityOptions() {
function filterTree(tree, filterArray) { function filterTree(tree, filterArray) {
@ -121,7 +124,7 @@ export default {
// //
_data.shippingTemplatesRegionList = _data.shippingTemplatesRegionList =
_data.shippingTemplatesRegionResultList?.slice(0,1)|| _data.shippingTemplatesRegionResultList?.slice(0, 1) ||
cloneDeep(BASE_DATA.shippingTemplatesRegionList); cloneDeep(BASE_DATA.shippingTemplatesRegionList);
// //
_data.shippingTemplatesRegionListAppend = _data.shippingTemplatesRegionListAppend =
@ -181,8 +184,8 @@ export default {
this.isAdd = true; this.isAdd = true;
refillData(e); refillData(e);
this.modalConfig.title = "添加运费模板"; this.modalConfig.title = "添加运费模板";
console.log("this.modalData",this.modalData); console.log("this.modalData", this.modalData);
this.modalData.templateName += "(复制)"; this.modalData.templateName += "(复制)";
}, },
}; };
@ -217,8 +220,12 @@ export default {
render: () => { render: () => {
return ( return (
<el-radio-group v-model={this.modalData.calculateMethod}> <el-radio-group v-model={this.modalData.calculateMethod}>
<el-radio label="按重量">按重量</el-radio> <el-radio border label="按重量">
<el-radio label="按件数">按件数</el-radio> 按重量
</el-radio>
<el-radio border label="按件数">
按件数
</el-radio>
</el-radio-group> </el-radio-group>
); );
}, },
@ -236,8 +243,12 @@ export default {
render: () => { render: () => {
return ( return (
<el-radio-group v-model={this.modalData.fareConfig}> <el-radio-group v-model={this.modalData.fareConfig}>
<el-radio label="全国包邮">全国包邮</el-radio> <el-radio border label="全国包邮">
<el-radio label="自定义运费">自定义运费</el-radio> 全国包邮
</el-radio>
<el-radio border label="自定义运费">
自定义运费
</el-radio>
</el-radio-group> </el-radio-group>
); );
}, },
@ -436,137 +447,141 @@ export default {
}); });
}; };
return ( return (
<div> <transition name="el-fade-in">
<div class="d-flex no-warp justify-start items-center">
<el-form-item
prop="shippingTemplatesRegionList[0].first"
rules={{
required: true,
message: "请填写默认运费",
trigger: "change",
}}
label="默认运费"
>
<el-input-number
v-model={
this.modalData.shippingTemplatesRegionList[0].first
}
min={0}
controls={false}
precision={
this.modalData.calculateMethod == "按重量" ? 2 : 0
}
></el-input-number>
</el-form-item>
<span style="transform:translateY(-12px);">
&nbsp;
{this.modalData.calculateMethod == "按重量"
? "kg内"
: "件内"}
&nbsp;
</span>
<el-form-item
label-width="0"
prop="shippingTemplatesRegionList[0].firstPrice"
rules={{
required: true,
message: "请填写默认运费",
trigger: "change",
}}
label=""
>
<el-input-number
v-model={
this.modalData.shippingTemplatesRegionList[0].firstPrice
}
min={0}
controls={false}
precision={2}
></el-input-number>
</el-form-item>
<span style="transform:translateY(-12px);">
&nbsp;每增加&nbsp;
</span>
<el-form-item
label-width="0"
prop="shippingTemplatesRegionList[0].renewal"
rules={{
required: true,
message: "请填写默认运费",
trigger: "change",
}}
label=""
>
<el-input-number
v-model={
this.modalData.shippingTemplatesRegionList[0].renewal
}
min={0}
controls={false}
precision={
this.modalData.calculateMethod == "按重量" ? 2 : 0
}
></el-input-number>
</el-form-item>
<span style="transform:translateY(-12px);">
&nbsp;
{this.modalData.calculateMethod == "按重量" ? "kg" : "件"}
增加运费&nbsp;
</span>
<el-form-item
label-width="0"
prop="shippingTemplatesRegionList[0].renewalPrice"
rules={{
required: true,
message: "请填写默认运费",
trigger: "change",
}}
label=""
>
<el-input-number
min={0}
max={Number(
this.modalData.shippingTemplatesRegionList[0].firstPrice
)}
controls={false}
precision={2}
v-model={
this.modalData.shippingTemplatesRegionList[0]
.renewalPrice
}
></el-input-number>
</el-form-item>
<span style="transform:translateY(-12px);">
&nbsp;&nbsp;
</span>
</div>
<div> <div>
<obj-table-plus <div class="d-flex no-warp justify-start items-center">
tableProp={{ <el-form-item
"scroll-y": { prop="shippingTemplatesRegionList[0].first"
enabled: true, rules={{
gt: 5, required: true,
}, message: "请填写默认运费",
"show-overflow": true, trigger: "change",
}} }}
style="height:50vh;" label="默认运费"
enable-auto-query={false} >
v-model={this.modalData.shippingTemplatesRegionListAppend} <el-input-number
tableCols={tableCols} v-model={
isPagination={false} this.modalData.shippingTemplatesRegionList[0].first
> }
<template slot="empty"> min={0}
<el-button controls={false}
onClick={addAreaFare} precision={
type="text" this.modalData.calculateMethod == "按重量" ? 2 : 0
icon="el-icon-plus" }
> ></el-input-number>
为指定地区城市设置运费除指定地区外其余地区的运费按照默认运费 </el-form-item>
</el-button> <span style="transform:translateY(-12px);">
</template> &nbsp;
</obj-table-plus> {this.modalData.calculateMethod == "按重量"
? "kg内"
: "件内"}
&nbsp;
</span>
<el-form-item
label-width="0"
prop="shippingTemplatesRegionList[0].firstPrice"
rules={{
required: true,
message: "请填写默认运费",
trigger: "change",
}}
label=""
>
<el-input-number
v-model={
this.modalData.shippingTemplatesRegionList[0]
.firstPrice
}
min={0}
controls={false}
precision={2}
></el-input-number>
</el-form-item>
<span style="transform:translateY(-12px);">
&nbsp;每增加&nbsp;
</span>
<el-form-item
label-width="0"
prop="shippingTemplatesRegionList[0].renewal"
rules={{
required: true,
message: "请填写默认运费",
trigger: "change",
}}
label=""
>
<el-input-number
v-model={
this.modalData.shippingTemplatesRegionList[0].renewal
}
min={0}
controls={false}
precision={
this.modalData.calculateMethod == "按重量" ? 2 : 0
}
></el-input-number>
</el-form-item>
<span style="transform:translateY(-12px);">
&nbsp;
{this.modalData.calculateMethod == "按重量" ? "kg" : "件"}
增加运费&nbsp;
</span>
<el-form-item
label-width="0"
prop="shippingTemplatesRegionList[0].renewalPrice"
rules={{
required: true,
message: "请填写默认运费",
trigger: "change",
}}
label=""
>
<el-input-number
min={0}
max={Number(
this.modalData.shippingTemplatesRegionList[0]
.firstPrice
)}
controls={false}
precision={2}
v-model={
this.modalData.shippingTemplatesRegionList[0]
.renewalPrice
}
></el-input-number>
</el-form-item>
<span style="transform:translateY(-12px);">
&nbsp;&nbsp;
</span>
</div>
<div>
<obj-table-plus
tableProp={{
"scroll-y": {
enabled: true
},
"show-overflow": true,
height:"auto"
}}
style="height:50vh;"
enable-auto-query={false}
v-model={this.modalData.shippingTemplatesRegionListAppend}
tableCols={tableCols}
isPagination={false}
>
<template slot="empty">
<el-button
onClick={addAreaFare}
type="text"
icon="el-icon-plus"
>
为指定地区城市设置运费除指定地区外其余地区的运费按照默认运费
</el-button>
</template>
</obj-table-plus>
</div>
</div> </div>
</div> </transition>
); );
}, },
}, },
@ -583,30 +598,44 @@ export default {
width: "300px", width: "300px",
field: "cityCodes", field: "cityCodes",
type: "jsx", type: "jsx",
render: ({ row }) => { render: ({ row, $rowIndex }) => {
const change = (e) => { const change = (e) => {
console.log(e); console.log(e);
}; };
return ( return (
<el-cascader <el-form-item
style="width:100%;" label-width="0"
v-model={row.cityCodes} prop={
onChange={change} "shippingTemplatesConditionList." +
options={this.$api.mer_admin.getCityOptions()} $rowIndex +
show-all-levels={false} ".cityCodes"
collapse-tags={true} }
props={{ rules={{
props: { required: true,
multiple: true, message: "请选择运送城市",
checkStrictly: false,
emitPath: false,
label: "name",
value: "code",
},
}} }}
clearable >
filterable <el-cascader
></el-cascader> style="width:100%;"
v-model={row.cityCodes}
onChange={change}
options={this.$api.mer_admin.getCityOptions()}
show-all-levels={false}
placeholder="点击选择运送城市"
collapse-tags={true}
props={{
props: {
multiple: true,
checkStrictly: false,
emitPath: false,
label: "name",
value: "code",
},
}}
clearable
filterable
></el-cascader>
</el-form-item>
); );
}, },
}, },
@ -727,24 +756,26 @@ export default {
}); });
}; };
return ( return (
<obj-table-plus <transition name="el-fade-in">
class="mt-5" <obj-table-plus
style="height:50vh;" class="mt-5"
enable-auto-query={false} style="height:50vh;"
v-model={this.modalData.shippingTemplatesConditionList} enable-auto-query={false}
tableCols={tableCols} v-model={this.modalData.shippingTemplatesConditionList}
isPagination={false} tableCols={tableCols}
> isPagination={false}
<template slot="empty"> >
<el-button <template slot="empty">
onClick={addAreaFare} <el-button
type="text" onClick={addAreaFare}
icon="el-icon-plus" type="text"
> icon="el-icon-plus"
添加其他地区/其他包邮条件 >
</el-button> 添加其他地区/其他包邮条件
</template> </el-button>
</obj-table-plus> </template>
</obj-table-plus>
</transition>
); );
}, },
}, },