Commit e918ec48 authored by 我在何方's avatar 我在何方
parents 68adb514 8aa8236b
...@@ -76,7 +76,8 @@ ...@@ -76,7 +76,8 @@
"vuedraggable": "2.24.3", "vuedraggable": "2.24.3",
"vuex": "3.6.0", "vuex": "3.6.0",
"xlsx": "^0.18.5", "xlsx": "^0.18.5",
"xml-js": "^1.6.11" "xml-js": "^1.6.11",
"@vue/runtime-dom": "latest"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "4.4.6", "@vue/cli-plugin-babel": "4.4.6",
......
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
padding: 50px; padding: 50px;
text-align: center; text-align: center;
} }
$sizes: 0, 10,20,30,50,100,150,200,500,800,1000; $sizes: 0, 10,20,30,50,100,150,200,300,500,800,1000;
@for $i from 1 through length($sizes){ @for $i from 1 through length($sizes){
$item: nth($sizes, $i); $item: nth($sizes, $i);
.ml-#{$item}{ .ml-#{$item}{
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</div> </div>
<div class="line"> <div class="line">
<div class="label">电话:</div> <div class="label">电话:</div>
<div class="value">{{item.areaCode}} {{item.phoneNew}}</div> <div class="value">+{{item.areaCode}} {{item.phoneNew}}</div>
</div> </div>
<div class="line"> <div class="line">
<div class="label">邮箱:</div> <div class="label">邮箱:</div>
......
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
prop="brand" prop="brand"
v-if="form.type != 1" v-if="form.type != 1"
> >
<dict-selector form-type="checkbox" :type="DICT_TYPE.BRAND_REG_TYPE" v-model="form.brandArr" multiple /> <dict-selector form-type="checkbox" :type="DICT_TYPE.BOX_SHIPPING_BRAND_TYPE" v-model="form.brandArr" multiple />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label="$t('是否控货')" :label="$t('是否控货')"
......
...@@ -770,7 +770,7 @@ export default { ...@@ -770,7 +770,7 @@ export default {
"position": "", "position": "",
"social": undefined, "social": undefined,
"socialNumber": "", "socialNumber": "",
"userid": [], "userid": undefined,
// "username": "" // "username": ""
}) })
}, },
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<el-descriptions-item :label="$t('出货渠道')" :span="2">{{channelName}}</el-descriptions-item> <el-descriptions-item :label="$t('出货渠道')" :span="2">{{channelName}}</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<el-card class="card"> <el-card class="card">
<el-descriptions class="mr-10" border :title="$t('基础信息')" :column="2"> <el-descriptions class="mr-10" border :title="$t('基础信息')" :column="2">
<el-descriptions-item :label="$t('唛头')">{{order.marks}}</el-descriptions-item> <el-descriptions-item :label="$t('唛头')">{{order.marks}}</el-descriptions-item>
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="warehouseInInfoVO.quantityAll" :label="$t('数量') + '(个)'" width="90px"> <el-table-column prop="warehouseInInfoVO.quantityAll" :label="$t('数量') + '(个)'" width="90px">
<template slot-scope="{row}"> <template slot-scope="{row}">
{{order.inWarehouseState > 1 ? row.warehouseInInfoVO.quantityAll : row.quantity}} {{(order.inWarehouseState > 1 && row.warehouseInInfoVO) ? row.warehouseInInfoVO.quantityAll : row.quantity}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="" :label="$t('费用类型')"> <el-table-column prop="" :label="$t('费用类型')">
......
...@@ -363,8 +363,9 @@ ...@@ -363,8 +363,9 @@
:disabled="false" :disabled="false"
></area-selector> ></area-selector>
</el-form-item> </el-form-item>
<br/>
<el-form-item :label="$t('收货详细地址')" prop="consigneeAddress"> <el-form-item :label="$t('收货详细地址')" prop="consigneeAddress">
<el-input v-model="form.consigneeAddress" :disabled="false"></el-input> <el-input v-model="form.consigneeAddress" :disabled="false" class="w-300"></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div> <div>
...@@ -517,6 +518,7 @@ import {calculationPrice} from '@/api/ecw/product' ...@@ -517,6 +518,7 @@ import {calculationPrice} from '@/api/ecw/product'
import SupplierSelector from '@/components/SupplierSelector' import SupplierSelector from '@/components/SupplierSelector'
import Decimal from 'decimal.js' import Decimal from 'decimal.js'
import WorkFlow from '@/components/WorkFlow' import WorkFlow from '@/components/WorkFlow'
import { getCustomer } from "@/api/ecw/customer";
// 缓存默认的表单数据 // 缓存默认的表单数据
let defaultFormData = null let defaultFormData = null
...@@ -793,6 +795,16 @@ export default { ...@@ -793,6 +795,16 @@ export default {
this.$set(this.form, 'externalWarehouseDtoList', [{}]) this.$set(this.form, 'externalWarehouseDtoList', [{}])
} }
}, },
// 选择送货上门需要查询并填充默认地址
'form.harvestMethod'(harvestMethod){
if(harvestMethod == 2 && !this.form.address && this.form.consigneeId){
getCustomer(this.form.consigneeId).then(res => {
if(res.data.address){
this.$set(this.form, 'consigneeAddress', res.data.address)
}
})
}
},
/* 'form.orderItemVOList'(){ /* 'form.orderItemVOList'(){
console.log('form.orderItemVOList', this.form.orderItemVOList.length, this.form.orderItemVOList) console.log('form.orderItemVOList', this.form.orderItemVOList.length, this.form.orderItemVOList)
}, */ }, */
......
...@@ -256,10 +256,10 @@ ...@@ -256,10 +256,10 @@
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical" v-if="scope.row.status != 0"></el-divider>
<!--仓库相关的--> <!--仓库相关的-->
<el-dropdown> <el-dropdown v-if="scope.row.status != 0">
<el-button type="text">{{$t('仓库')}}</el-button> <el-button type="text">{{$t('仓库')}}</el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<!-- 入仓操作 --> <!-- 入仓操作 -->
...@@ -325,10 +325,10 @@ ...@@ -325,10 +325,10 @@
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical" v-if="scope.row.status != 0"></el-divider>
<!--打印相关的--> <!--打印相关的-->
<el-dropdown> <el-dropdown v-if="scope.row.status != 0">
<el-button type="text">{{$t('打印')}}</el-button> <el-button type="text">{{$t('打印')}}</el-button>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<!-- 打印标签 --> <!-- 打印标签 -->
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-form-item label="材质" style="margin-top: 20px"> <el-form-item label="材质" style="margin-top: 20px">
<dict-selector :type="DICT_TYPE.ECW_PRODUCT_MATERIAL" v-model="form.material"></dict-selector> <dict-selector :type="DICT_TYPE.ECW_PRODUCT_MATERIAL" v-model="form.material" clearable></dict-selector>
</el-form-item> </el-form-item>
<el-form-item label="入仓时间" v-if="!edit"> <el-form-item label="入仓时间" v-if="!edit">
<el-date-picker v-model="form.inTime" type="datetime" placeholder="请选择入仓时间" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker> <el-date-picker v-model="form.inTime" type="datetime" placeholder="请选择入仓时间" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
......
...@@ -67,9 +67,15 @@ ...@@ -67,9 +67,15 @@
prop="diffType" prop="diffType"
v-slot="{row}" v-slot="{row}"
:label="$t('状态')"> :label="$t('状态')">
<dict-tag v-if="row.warehouseInInfoVO && row.warehouseInInfoVO.diffType" :type="DICT_TYPE.ORDER_WAREHOUSE_IN_STATUS" :value="row.warehouseInInfoVO.diffType" class="red" :class="{green: row.warehouseInInfoVO.diffType === 4}"/> <dict-tag
<span class="red" v-else-if="row.warehouseInInfoVO && row.warehouseInInfoVO.cartonsNumDiff">{{ row.warehouseInInfoVO.cartonsNumDiff }}{{$t('箱')}}</span> v-if="row.warehouseInInfoVO && row.warehouseInInfoVO.diffType"
:type="DICT_TYPE.ORDER_WAREHOUSE_IN_STATUS"
:value="row.warehouseInInfoVO.diffType"
class="red"
:class="{green: row.warehouseInInfoVO.diffType === 4}"
/>
<span :class="{red: row.itemStatus === 3}" v-else>{{ row.itemStatus === 3 ? ($t('少了') + row.num + $t('箱')) : $t('待入仓') }}</span> <span :class="{red: row.itemStatus === 3}" v-else>{{ row.itemStatus === 3 ? ($t('少了') + row.num + $t('箱')) : $t('待入仓') }}</span>
<span class="red" v-if="row.warehouseInInfoVO && row.warehouseInInfoVO.cartonsNumDiff">{{ row.warehouseInInfoVO.cartonsNumDiff }}{{$t('箱')}}</span>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="address" prop="address"
......
...@@ -69,8 +69,8 @@ ...@@ -69,8 +69,8 @@
</div> </div>
<el-form-item :label="$t('预付')" prop="needPay" v-if="$route.query.action == 'batchUpdate'" > <el-form-item :label="$t('预付')" prop="needPay" v-if="$route.query.action == 'batchUpdate'" >
<el-radio-group v-model="form.needPay"> <el-radio-group v-model="form.needPay">
<el-radio :label="1">预付</el-radio> <el-radio :label="1">{{$t('预付')}}</el-radio>
<el-radio :label="0">均可</el-radio> <el-radio :label="0">{{$t('均可')}}</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item :label="$t('单价模式')" prop="priceType"> <el-form-item :label="$t('单价模式')" prop="priceType">
...@@ -78,13 +78,13 @@ ...@@ -78,13 +78,13 @@
</el-form-item> </el-form-item>
<!--阶梯定价--> <!--阶梯定价-->
<template v-if="form.stepPrice==1" > <template v-if="form.stepPrice==1" >
<div v-for="(item, index) in priceStepList" :key="index"> <div v-for="(item, index) in form.priceStepList" :key="index">
<div style="font-size:14px; margin:10px 0"> <div style="font-size:14px; margin:10px 0">
{{$t('第{index}阶梯定价方案', {index: index+1})}} {{$t('第{index}阶梯定价方案', {index: index+1})}}
<template v-if="index == priceStepList.length - 1"> <template v-if="index == form.priceStepList.length - 1">
<el-link type="primary" @click.native="priceStepList.push({})">{{$t('添加区间')}}</el-link> <el-link type="primary" @click.native="form.priceStepList.push({})">{{$t('添加区间')}}</el-link>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<el-link type="danger" @click.native="priceStepList.splice(index, 1)">{{$t('删除')}}</el-link> <el-link type="danger" @click.native="form.priceStepList.splice(index, 1)">{{$t('删除')}}</el-link>
</template> </template>
</div> </div>
<el-form-item :label="$t(`第{index}阶梯`, {index: index + 1})"> <el-form-item :label="$t(`第{index}阶梯`, {index: index + 1})">
...@@ -94,40 +94,45 @@ ...@@ -94,40 +94,45 @@
/ /
<selector v-model="form.weightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" /> <selector v-model="form.weightUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('默认运费')" v-if="form.priceType != 1"> <el-form-item :label="$t('默认运费')" v-if="form.priceType != 1" :prop="`priceStepList.${index}.transportPrice`" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<inputor default2="0" v-model.number="item.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" /> <inputor default2="0" v-model.number="item.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10"/>
<selector v-model="item.transportPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" /> <selector v-model="item.transportPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
/ <selector v-model="item.transportVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" /> / <selector v-model="item.transportVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('默认清关费')" v-if="form.priceType != 1"> <el-form-item :label="$t('默认清关费')" v-if="form.priceType != 1" :prop="`priceStepList.${index}.transportPrice`" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<inputor default2="0" v-model.number="item.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" /> <inputor default2="0" v-model.number="item.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"/>
<selector v-model="item.clearancePriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" /> <selector v-model="item.clearancePriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
/ <selector v-model="item.clearanceVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" /> / <selector v-model="item.clearanceVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('默认全包价')" v-if="form.priceType == 1"> <el-form-item
:label="$t('默认全包价')"
v-if="form.priceType == 1"
:prop="`priceStepList.${index}.allPrice`"
:rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"
>
<selector v-model="item.allPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" /> <selector v-model="item.allPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
<inputor default2="0" v-model.number="item.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" /> <inputor default2="0" v-model.number="item.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"/>
/ <selector v-model="item.allVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" /> / <selector v-model="item.allVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
</el-form-item> </el-form-item>
</div> </div>
</template> </template>
<template v-else> <template v-else>
<el-form-item :label="$t('默认全包价')" v-if="form.priceType == 1"> <el-form-item :label="$t('默认全包价')" v-if="form.priceType == 1" prop="allPrice" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<selector test="allPriceUnit" v-model="form.allPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100 mr-10 aaa" /> <selector test="allPriceUnit" v-model="form.allPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100 mr-10 aaa" />
<inputor default2="0" v-model.number="form.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr10" /> <inputor default2="0" v-model.number="form.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr10" />
<span class="mr-10">/</span> <span class="mr-10">/</span>
<selector v-model="form.allVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" /> <selector v-model="form.allVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item> </el-form-item>
<template v-else> <template v-else>
<el-form-item :label="$t('默认运费')" prop="transportPrice"> <el-form-item :label="$t('默认运费')" prop="transportPrice" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<selector v-model="form.transportPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100 mr-10" /> <selector v-model="form.transportPriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100 mr-10" />
<inputor default2="0" v-model.number="form.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" /> <inputor default2="0" v-model.number="form.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<span class="mr-10">/</span> <span class="mr-10">/</span>
<selector v-model="form.transportVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" /> <selector v-model="form.transportVolumeUnit" :options="unitList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('默认清关费')" prop="clearancePrice"> <el-form-item :label="$t('默认清关费')" prop="clearancePrice" :rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}">
<selector v-model="form.clearancePriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100 mr-10" /> <selector v-model="form.clearancePriceUnit" :options="currencyList" :label-field="$l('title')" value-field="id" defaultable2 class="w-100 mr-10" />
<inputor default2="0" v-model.number="form.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" /> <inputor default2="0" v-model.number="form.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<span class="mr-10">/</span> <span class="mr-10">/</span>
...@@ -135,23 +140,28 @@ ...@@ -135,23 +140,28 @@
</el-form-item> </el-form-item>
</template> </template>
<!--特需--> <!--特需-->
<template v-if="form.priceType==1"> <template v-if="form.priceType==1">
<el-form-item <el-form-item
v-for="(special, specialIndex) in this.specialProducts" v-for="(special, specialIndex) in this.form.specialList"
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('全包价')" :label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('全包价')"
:key="specialIndex + 'transport'"> :key="specialIndex + 'transport'"
:prop="`specialList.${specialIndex}`.allPrice"
:rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"
>
<selector v-model="special.allPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" /> <selector v-model="special.allPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" />
<inputor default2="0" v-model.number="special.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" /> <inputor default2="0" v-model.number="special.allPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<span class="mr-10">/</span> <span class="mr-10">/</span>
<selector v-model="special.allVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" /> <selector v-model="special.allVolumeUnit" :options="unitList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100" />
</el-form-item> </el-form-item>
</template> </template>
<template v-else v-for="(special, specialIndex) in this.specialProducts"> <template v-else v-for="(special, specialIndex) in this.form.specialList">
<el-form-item <el-form-item
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('运费')" :label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('运费')"
:key="specialIndex + 'transport'"> :key="specialIndex + 'transport'"
:prop="`specialList.${specialIndex}.transportPrice`"
:rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"
>
<selector v-model="special.transportPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" /> <selector v-model="special.transportPriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" />
<inputor default2="0" v-model.number="special.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" /> <inputor default2="0" v-model.number="special.transportPrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<span class="mr-10">/</span> <span class="mr-10">/</span>
...@@ -159,7 +169,10 @@ ...@@ -159,7 +169,10 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('清关费')" :label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('清关费')"
:key="specialIndex + 'clearance'"> :key="specialIndex + 'clearance'"
:prop="`specialList.${specialIndex}.clearancePrice`"
:rules="{validator: priceValidator, trigger: 'blur', message: '价格错误'}"
>
<selector v-model="special.clearancePriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" /> <selector v-model="special.clearancePriceUnit" :options="currencyList" :label-field="$l(null, 'title')" value-field="id" defaultable2 class="w-100 mr-10" />
<inputor default2="0" v-model.number="special.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" /> <inputor default2="0" v-model.number="special.clearancePrice" type="number" :placeholder="$t('整数或者两位小数')" class="w-100 mr-10" />
<span class="mr-10">/</span> <span class="mr-10">/</span>
...@@ -223,11 +236,14 @@ export default { ...@@ -223,11 +236,14 @@ export default {
return { return {
checkList: [], checkList: [],
selectedRoutes: [], // 勾选的路线渠道 selectedRoutes: [], // 勾选的路线渠道
form: {}, form: {
priceStepList: [{},{}], // 阶梯价格
specialList: []
},
needPay: false, // 是否需要预付 needPay: false, // 是否需要预付
stepPrice: false, // 是否阶梯订单 stepPrice: false, // 是否阶梯订单
specialProducts: [], // specialProducts: [],
priceStepList: [{},{}], // 阶梯价格 // priceStepList: [{},{}], // 阶梯价格
// specialList:[], // 特殊需求,默认四个 // specialList:[], // 特殊需求,默认四个
rules: { rules: {
transportPrice: [{ required: true, message: this.$t("海运费不能为空"), trigger: "blur" }], transportPrice: [{ required: true, message: this.$t("海运费不能为空"), trigger: "blur" }],
...@@ -277,20 +293,9 @@ export default { ...@@ -277,20 +293,9 @@ export default {
// 特殊需求回显 // 特殊需求回显
if (val.specialList) { if (val.specialList) {
val.specialList.forEach(item => { val.specialList.forEach(item => {
let index = this.specialProducts.findIndex(special => special.specialDictType == item.specialDictType) let index = this.form.specialList.findIndex(special => special.specialDictType == item.specialDictType)
if(index > -1)this.specialProducts[index] = item if(index > -1)this.form.specialList[index] = item
}) })
// this.specialProducts = val.specialList
/* let keyed = arrryToKeyedObjectBy(val.specialList, 'specialDictType')
this.specialProducts.map((item, index) => {
if (keyed[item.specialDictType]) {
for (let field in item) {
if (keyed[item.specialDictType][field]) {
item[field] = keyed[item.specialDictType][field]
}
}
}
}) */
} }
}, },
'form.priceType'(priceType){ 'form.priceType'(priceType){
...@@ -300,32 +305,32 @@ export default { ...@@ -300,32 +305,32 @@ export default {
} }
}, },
'form.transportVolumeUnit'(val){ 'form.transportVolumeUnit'(val){
this.specialProducts.forEach(item => { this.form.specialList.forEach(item => {
item.transportVolumeUnit = val item.transportVolumeUnit = val
}) })
}, },
'form.clearanceVolumeUnit'(val){ 'form.clearanceVolumeUnit'(val){
this.specialProducts.forEach(item => { this.form.specialList.forEach(item => {
item.clearanceVolumeUnit = val item.clearanceVolumeUnit = val
}) })
}, },
'form.transportPriceUnit'(val){ 'form.transportPriceUnit'(val){
this.specialProducts.forEach(item => { this.form.specialList.forEach(item => {
item.transportPriceUnit = val item.transportPriceUnit = val
}) })
}, },
'form.clearancePriceUnit'(val){ 'form.clearancePriceUnit'(val){
this.specialProducts.forEach(item => { this.form.specialList.forEach(item => {
item.clearancePriceUnit = val item.clearancePriceUnit = val
}) })
}, },
'form.allPriceUnit'(val){ 'form.allPriceUnit'(val){
this.specialProducts.forEach(item => { this.form.specialList.forEach(item => {
item.allPriceUnit = val item.allPriceUnit = val
}) })
}, },
'form.allVolumeUnit'(val){ 'form.allVolumeUnit'(val){
this.specialProducts.forEach(item => { this.form.specialList.forEach(item => {
item.allVolumeUnit = val item.allVolumeUnit = val
}) })
}, },
...@@ -333,6 +338,11 @@ export default { ...@@ -333,6 +338,11 @@ export default {
if(val) this.$set(this.form, 'dayLimit', 10000) if(val) this.$set(this.form, 'dayLimit', 10000)
else delete this.form.dayLimit else delete this.form.dayLimit
}, },
'form.stepPrice'(stepPrice){
if(stepPrice == 1 && (!this.form.priceStepList || !this.form.priceStepList.length)){
this.$set(this.form, 'priceStepList', [{},{}])
}
},
needPay(val){ needPay(val){
this.$set(this.form, 'needPay', val ? 1 : 0) this.$set(this.form, 'needPay', val ? 1 : 0)
}, },
...@@ -362,19 +372,18 @@ export default { ...@@ -362,19 +372,18 @@ export default {
// action=batchUpdate 表示批量修改单个商品的价格(一条或者多条),如果没有ids显示路线选择组件,否则不显示路线组件 // action=batchUpdate 表示批量修改单个商品的价格(一条或者多条),如果没有ids显示路线选择组件,否则不显示路线组件
// action=update 表示修改单个商品的单条路线价格,需要回显 // action=update 表示修改单个商品的单条路线价格,需要回显
if(this.$route.query.action == 'update'){ if(this.$route.query.action == 'update'){
getProductPrice(this.$route.query.id).then(res => { let res = await getProductPrice(this.$route.query.id)
this.$set(this, 'form', res.data) this.$set(this, 'form', res.data)
if(this.form.needPay){ if(this.form.needPay){
this.needPay = true this.needPay = true
} }
if(res.data.validateStartDate){ if(res.data.validateStartDate){
this.form.validateStartDate = parseTime(res.data.validateStartDate) this.form.validateStartDate = parseTime(res.data.validateStartDate)
} }
if(res.data.validateEndDate){ if(res.data.validateEndDate){
this.form.validateEndDate = parseTime(res.data.validateEndDate) this.form.validateEndDate = parseTime(res.data.validateEndDate)
} }
this.lineList = [res.data] this.lineList = [res.data]
})
} }
// action=batchUpdate且ids不为空 // action=batchUpdate且ids不为空
...@@ -434,8 +443,11 @@ export default { ...@@ -434,8 +443,11 @@ export default {
getCurrencyList().then(res => this.currencyList = res.data) getCurrencyList().then(res => this.currencyList = res.data)
getUnitList().then(res => this.unitList = res.data) getUnitList().then(res => this.unitList = res.data)
if(!this.form.specialList){
this.$set(this.form, 'specialList', [])
}
this.getDictDatas(this.DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS).forEach(item => { this.getDictDatas(this.DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS).forEach(item => {
this.specialProducts.push({ this.form.specialList.push({
"clearancePrice": !this.$route.query.action ? 0 : null, // 新建默认给0,否则默认是null "clearancePrice": !this.$route.query.action ? 0 : null, // 新建默认给0,否则默认是null
"clearancePriceUnit": null, "clearancePriceUnit": null,
"clearanceVolumeUnit": null, "clearanceVolumeUnit": null,
...@@ -447,6 +459,14 @@ export default { ...@@ -447,6 +459,14 @@ export default {
}) })
}, },
methods: { methods: {
priceValidator(rule, value, callback){
if(!value || value == '') return callback()
value = parseFloat(value)
if(!value || value < 0){
return callback(new Error('价格错误'))
}
callback()
},
setDefaultVolumeUnit(unit){ setDefaultVolumeUnit(unit){
this.$set(this.form, 'transportVolumeUnit', unit) this.$set(this.form, 'transportVolumeUnit', unit)
this.$set(this.form, 'clearanceVolumeUnit', unit) this.$set(this.form, 'clearanceVolumeUnit', unit)
...@@ -477,8 +497,9 @@ export default { ...@@ -477,8 +497,9 @@ export default {
specialList: this.specialProducts, specialList: this.specialProducts,
isAllProduct: 0 isAllProduct: 0
}) })
if(this.form.stepPrice == 1){ if(this.form.stepPrice != 1){
data.priceStepList = this.priceStepList // data.priceStepList = this.priceStepList
delete data.priceStepList
} }
// 修改单条路线 // 修改单条路线
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment