chc 2024-01-18 11:46:30 +08:00
commit 77732e766a
4 changed files with 65 additions and 39 deletions

View File

@ -30,7 +30,7 @@ export const orderStatusList = [
status: 'TAKE' status: 'TAKE'
}, },
{ {
name: '已取消', name: '已关闭',
status: 'CANCELLED' status: 'CANCELLED'
}, },
{ {

View File

@ -1,29 +1,29 @@
var BASE = { var BASE = {
/** /**
* @description api请求基础路径 * @description api请求基础路径
*/ */
API_DEV: { API_DEV: {
common: "https://common-api.pickmall.cn", common: "https://common-api.pickmall.cn",
buyer: "https://buyer-api.pickmall.cn", buyer: "https://buyer-api.pickmall.cn",
seller: "https://store-api.pickmall.cn", seller: "https://store-api.pickmall.cn",
manager: "https://admin-api.pickmall.cn" manager: "https://admin-api.pickmall.cn",
}, },
API_PROD: { API_PROD: {
common: "https://common-api.pickmall.cn", common: "https://common-api.pickmall.cn",
buyer: "https://buyer-api.pickmall.cn", buyer: "https://buyer-api.pickmall.cn",
seller: "https://store-api.pickmall.cn", seller: "https://store-api.pickmall.cn",
manager: "https://admin-api.pickmall.cn" manager: "https://admin-api.pickmall.cn"
}, },
/** /**
* @description // 跳转买家端地址 pc端 * @description // 跳转买家端地址 pc端
*/ */
PC_URL: "https://pc-b2b2c.pickmall.cn", PC_URL: "https://pc-b2b2c.pickmall.cn",
/** /**
* @description // 跳转买家端地址 wap端 * @description // 跳转买家端地址 wap端
*/ */
WAP_URL: "https://m-b2b2c.pickmall.cn", WAP_URL: "https://m-b2b2c.pickmall.cn",
/** /**
* @description api请求基础路径前缀 * @description api请求基础路径前缀
*/ */
PREFIX: "/manager" PREFIX: "/manager"
}; };

View File

@ -178,9 +178,9 @@
<FormItem v-for="(val, index) in item.spec_values" :key="index" <FormItem v-for="(val, index) in item.spec_values" :key="index"
class="sku-item-content-val flex" label="规格项"> class="sku-item-content-val flex" label="规格项">
<AutoComplete ref="input" v-model="val.value" :data="skuVal" :filter-method="filterMethod" <AutoComplete ref="input" v-model="val.value" :data="skuVal" :filter-method="filterMethod"
:maxlength="30" placeholder="请输入规格项" style="width: 150px" :maxlength="10" placeholder="请输入规格项" style="width: 150px"
@on-focus="changeSkuVals(val, item.name)" @on-blur="checkSkuVal(val, index)" @on-focus="changeSkuVals(val, item.name)" @on-blur="checkSkuVal(val, index)"
@on-change="skuValueChange(val, index, item)"> @on-change="skuValueChange(val, index, item, $index)">
</AutoComplete> </AutoComplete>
<Button size="small" style="margin-left: 10px" type="primary" <Button size="small" style="margin-left: 10px" type="primary"
@click="handleCloseSkuValue(val, index, item)"> @click="handleCloseSkuValue(val, index, item)">
@ -196,6 +196,7 @@
</Card> </Card>
</div> </div>
</Form> </Form>
<!--{{skuInfo}}-->
<Button class="add-sku-btn" size="small" type="primary" @click="addSkuItem"> <Button class="add-sku-btn" size="small" type="primary" @click="addSkuItem">
</Button> </Button>
&nbsp; &nbsp;
@ -1197,8 +1198,11 @@ export default {
return; return;
} }
if (this.zz(0, val) > 20) { if (this.zz(0, val) > 20) {
this.$Message.error("规格项最多十个字符长度!"); this.$Message.error("规格值最多十个字符长度!");
return; // val = val.toString().slice(0, 4);
this.skuInfo[index].name = this.countCharacters(val, 10);
this.$forceUpdate();//
// return;
} }
this.skuTableData = this.skuTableData.map((e) => { this.skuTableData = this.skuTableData.map((e) => {
e[val] = e[this.currentSkuItem]; e[val] = e[this.currentSkuItem];
@ -1220,8 +1224,28 @@ export default {
} }
return len; return len;
}, },
countCharacters (defaultStr, defaultNum) {
let str = '' + defaultStr || '',
num = + defaultNum || 0,
res = '',
length = 0;
if (!str || !num) {
return str;
}
//
for (const i in str) {
res += str[i];
//
length += /[\u4e00-\u9fa5]/.test(str[i]) ? 2 : 1;
//
if (length >= num || +i == str.length - 1) {
break;
}
}
return res;
},
// //
skuValueChange(val, index, item) { skuValueChange(val, index, item, $index) {
if (this.skuTableData.find((i) => i[val.name] === val.value)) { if (this.skuTableData.find((i) => i[val.name] === val.value)) {
this.$Message.error("已存在相同规格值!"); this.$Message.error("已存在相同规格值!");
return; return;
@ -1232,7 +1256,10 @@ export default {
} }
if (this.zz(0, val.value) > 20) { if (this.zz(0, val.value) > 20) {
this.$Message.error("规格值最多十个字符长度!"); this.$Message.error("规格值最多十个字符长度!");
return; // val.value = val.value.toString().slice(0, 4);
this.skuInfo[$index].spec_values[index].value = this.countCharacters(val.value, 10);
this.$forceUpdate();//
// return;
} }
let curVal = this.currentSkuVal; let curVal = this.currentSkuVal;
this.skuTableData = this.skuTableData.map((e) => { this.skuTableData = this.skuTableData.map((e) => {
@ -1437,7 +1464,6 @@ export default {
key: columnName, key: columnName,
}); });
}); });
// //
if (this.baseInfoForm.salesModel !== "WHOLESALE") { if (this.baseInfoForm.salesModel !== "WHOLESALE") {
pushData.push( pushData.push(

View File

@ -84,8 +84,8 @@ export default {
pageSize: 10, // pageSize: 10, //
sort: "createTime", // sort: "createTime", //
order: "desc", // order: "desc", //
startDate: "", // startTime: "", //
endDate: "", // endTime: "", //
}, },
selectDate: null, selectDate: null,
form: { form: {
@ -232,8 +232,8 @@ export default {
// //
selectDateRange(v) { selectDateRange(v) {
if (v) { if (v) {
this.searchForm.startDate = v[0]; this.searchForm.startTime = v[0];
this.searchForm.endDate = v[1]; this.searchForm.endTime = v[1];
} }
}, },
// //