Commit 172a22db authored by dragondean@qq.com's avatar dragondean@qq.com

完善路线列表和批量修改

parent 492ec523
...@@ -3,37 +3,55 @@ ...@@ -3,37 +3,55 @@
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="商品类型" prop="typeId"> <el-form-item label="商品类型" prop="typeId">
<el-input v-if="productDisabled && productType" :value="productType.titleZh" disabled /> <el-select v-model="form.productType" :disabled="!!$route.query.ids">
<el-select v-if="!productDisabled" v-model="form.productType">
<el-option v-for="type in productTypeList" :key="type.id" :label="type.titleZh" :value="type.id" /> <el-option v-for="type in productTypeList" :key="type.id" :label="type.titleZh" :value="type.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="商品名称" prop="titleZh"> <el-form-item label="商品名称" prop="titleZh">
<el-input v-if="productDisabled" :value="product ? product.titleZh : null" disabled /> <product-selector v-model="form.productId" :product-type="form.productType" @change="product = $event" :disabled="!!$route.query.ids" />
<product-selector v-else v-model="form.productId" :product-type="form.productType" @change="product = $event" />
</el-form-item> </el-form-item>
<el-form-item label="英文名称" prop="titleEn"> <el-form-item label="英文名称" prop="titleEn">
<el-input :value="product ? product.titleEn : ''" disabled /> <el-input :value="product ? product.titleEn : ''" disabled />
</el-form-item> </el-form-item>
<!--单条路线修改-->
<el-form-item label="路线" prop="lineChannelList" v-if="lineList && lineList.length == 1"> <!-- <el-form-item label="路线" prop="lineChannelList" v-if="!$route.query.ids">
<el-input v-for="item in lineList" <el-input
v-for="item in lineList"
:key="item.lineId"
:value="'【' + getDictDataLabel(DICT_TYPE.ECW_TRANSPORT_TYPE, item.warehouseLineDO.transportType) + '】从【' + item.warehouseLineDO.startTitleZh + '】发往【' + item.warehouseLineDO.destTitleZh + '】'" :value="'【' + getDictDataLabel(DICT_TYPE.ECW_TRANSPORT_TYPE, item.warehouseLineDO.transportType) + '】从【' + item.warehouseLineDO.startTitleZh + '】发往【' + item.warehouseLineDO.destTitleZh + '】'"
disabled/>
</el-form-item>--
<!--多条路线批量修改-->
<el-form-item label="路线" prop="lineChannelList" v-if="lineList.length">
<template v-if="lineList.length == 1">
<el-input
v-for="item in lineList"
:key="item.id"
:value="!item.warehouseLineDO ? '数据异常,缺少warehouseLineDO字段' : '【' + getDictDataLabel(DICT_TYPE.ECW_TRANSPORT_TYPE, item.warehouseLineDO.transportType) + '】从【' + item.warehouseLineDO.startTitleZh + '】发往【' + item.warehouseLineDO.destTitleZh + '】'"
disabled /> disabled />
</el-form-item> </template>
<el-form-item label="路线" prop="lineChannelList" v-else> <el-checkbox-group v-else v-model="checkList">
<el-checkbox-group v-model="checkList"> <el-checkbox
<el-checkbox v-for="item in lineList" :label="item.id"> v-for="item in lineList"
{{ '' + getDictDataLabel(DICT_TYPE.ECW_TRANSPORT_TYPE, item.warehouseLineDO.transportType) + '】从【' + :key="item.id"
:label="item.id"
:disabled="!item.warehouseLineDO"
style="display:block"
>
{{
!item.warehouseLineDO ? '数据异常,缺少warehouseLineDO字段' :
'【' + getDictDataLabel(DICT_TYPE.ECW_TRANSPORT_TYPE, item.warehouseLineDO.transportType) + '】从【' +
item.warehouseLineDO.startTitleZh + '】发往【' + item.warehouseLineDO.destTitleZh + '】' item.warehouseLineDO.startTitleZh + '】发往【' + item.warehouseLineDO.destTitleZh + '】'
}} }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<routers-selector v-if="!form.id" v-model="selectedRoutes" />
<routers-selector v-if="!$route.query.ids" v-model="selectedRoutes" />
<el-card style="margin-bottom: 10px"> <el-card style="margin-bottom: 10px">
<div slot="header" style="font-size:20px;"> <div slot="header" style="font-size:20px;">
价格设置 价格设置
...@@ -41,11 +59,7 @@ ...@@ -41,11 +59,7 @@
<el-form-item label="默认运费" prop="transportPrice"> <el-form-item label="默认运费" prop="transportPrice">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="4"> <el-col :span="4">
<selector v-model="form.transportPriceUnit" :options="currencyList" label-field="titleZh" value-field="id" <selector v-model="form.transportPriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
defaultable style="width:100px" />
<!-- <el-select v-model="form.transportPriceUnit">
<el-option v-for="currency in currencyList" :key="currency.id" :label="currency.titleZh" :value="currency.id" />
</el-select> -->
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
...@@ -54,22 +68,14 @@ ...@@ -54,22 +68,14 @@
<el-col :span="4"> <el-col :span="4">
/ /
<selector v-model="form.transportVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" <selector v-model="form.transportVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
defaultable style="width:100px" />
<!-- <el-select v-model="form.transportVolumeUnit">
<el-option v-for="unit in unitList" :key="unit.id" :label="unit.titleZh" :value="unit.id" />
</el-select> -->
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item label="默认清关费" prop="clearancePrice"> <el-form-item label="默认清关费" prop="clearancePrice">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="4"> <el-col :span="4">
<selector v-model="form.clearancePriceUnit" :options="currencyList" label-field="titleZh" value-field="id" <selector v-model="form.clearancePriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
defaultable style="width:100px" />
<!-- <el-select v-model="form.clearancePriceUnit">
<el-option v-for="currency in currencyList" :key="currency.id" :label="currency.titleZh" :value="currency.id" />
</el-select> -->
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
...@@ -78,26 +84,19 @@ ...@@ -78,26 +84,19 @@
<el-col :span="4"> <el-col :span="4">
/ /
<selector v-model="form.clearanceVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" <selector v-model="form.clearanceVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
defaultable style="width:100px" />
<!-- <el-select v-model="form.clearanceVolumeUnit">
<el-option v-for="unit in unitList" :key="unit.id" :label="unit.titleZh" :value="unit.id" />
</el-select> -->
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
<!--特需-->
<template v-for="(special, specialIndex) in this.specialProducts"> <template v-for="(special, specialIndex) in this.specialProducts">
<el-form-item <el-form-item
:label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + '运费'" :label="getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + '运费'"
:key="specialIndex + 'transport'"> :key="specialIndex + 'transport'">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="4"> <el-col :span="4">
<selector v-model="special.transportPriceUnit" :options="currencyList" label-field="titleZh" <selector v-model="special.transportPriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
value-field="id" defaultable style="width:100px" />
<!-- <el-select v-model="special.transportPriceUnit">
<el-option v-for="currency in currencyList" :key="currency.id" :label="currency.titleZh" :value="currency.id" />
</el-select> -->
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
...@@ -105,13 +104,7 @@ ...@@ -105,13 +104,7 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
/ / <selector v-model="special.transportVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<selector v-model="special.transportVolumeUnit" :options="unitList" label-field="titleZh"
value-field="id" defaultable style="width:100px" />
<!-- <el-select v-model="special.transportVolumeUnit">
<el-option v-for="unit in unitList" :key="unit.id" :label="unit.titleZh" :value="unit.id" />
</el-select> -->
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
...@@ -120,11 +113,7 @@ ...@@ -120,11 +113,7 @@
:key="specialIndex + 'clearance'"> :key="specialIndex + 'clearance'">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="4"> <el-col :span="4">
<selector v-model="special.clearancePriceUnit" :options="currencyList" label-field="titleZh" <selector v-model="special.clearancePriceUnit" :options="currencyList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
value-field="id" defaultable style="width:100px" />
<!-- <el-select v-model="special.clearancePriceUnit">
<el-option v-for="currency in currencyList" :key="currency.id" :label="currency.titleZh" :value="currency.id" />
</el-select> -->
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
...@@ -132,12 +121,7 @@ ...@@ -132,12 +121,7 @@
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
/ / <selector v-model="special.clearanceVolumeUnit" :options="unitList" label-field="titleZh" value-field="id" defaultable style="width:100px" />
<selector v-model="special.clearanceVolumeUnit" :options="unitList" label-field="titleZh"
value-field="id" defaultable style="width:100px" />
<!-- <el-select v-model="special.clearanceVolumeUnit">
<el-option v-for="unit in unitList" :key="unit.id" :label="unit.titleZh" :value="unit.id" />
</el-select> -->
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
...@@ -146,9 +130,6 @@ ...@@ -146,9 +130,6 @@
<el-form-item label="是否预付" prop="advanceStatus"> <el-form-item label="是否预付" prop="advanceStatus">
<dict-selector form-type="radio" :type="DICT_TYPE.ADVANCE_STATUS" v-model="form.advanceStatus" /> <dict-selector form-type="radio" :type="DICT_TYPE.ADVANCE_STATUS" v-model="form.advanceStatus" />
<!-- <el-radio-group v-model="form.advanceStatus">
<el-radio v-for="advanceDict in advanceStatusDictDatas" :key="advanceDict.value" :label="parseInt(advanceDict.value)">{{advanceDict.label}}</el-radio>
</el-radio-group> -->
</el-form-item> </el-form-item>
</el-card> </el-card>
...@@ -168,9 +149,6 @@ ...@@ -168,9 +149,6 @@
</el-form-item> </el-form-item>
<el-form-item label="货柜位置" prop="containerLocation"> <el-form-item label="货柜位置" prop="containerLocation">
<!-- <el-select v-model="form.containerLocation" placeholder="选择货柜位置" clearable>
<el-option v-for="locationItem in locationList" :key="locationItem.value" :label="locationItem.label" :value="locationItem.value"/>
</el-select> -->
<dict-selector :type="DICT_TYPE.ECW_CONTAINER_LOCATION" v-model="form.containerLocation" /> <dict-selector :type="DICT_TYPE.ECW_CONTAINER_LOCATION" v-model="form.containerLocation" />
</el-form-item> </el-form-item>
...@@ -178,8 +156,6 @@ ...@@ -178,8 +156,6 @@
<el-input v-model.number="form.square" type="number" style="width:200px" /> <el-input v-model.number="form.square" type="number" style="width:200px" />
</el-form-item> </el-form-item>
</el-card> </el-card>
</el-form> </el-form>
<div style="margin: 20px 0"> <div style="margin: 20px 0">
...@@ -191,7 +167,6 @@ ...@@ -191,7 +167,6 @@
<script> <script>
import RoutersSelector from '@/components/RoutersSelector' import RoutersSelector from '@/components/RoutersSelector'
import { createProductPrice, updateProductPrice, batchUpdateProductPrice, deleteProductPrice, getProductPrice, getProductPriceList, getProductPricePage, exportProductPriceExcel } from "@/api/ecw/productPrice"; import { createProductPrice, updateProductPrice, batchUpdateProductPrice, deleteProductPrice, getProductPrice, getProductPriceList, getProductPricePage, exportProductPriceExcel } from "@/api/ecw/productPrice";
import { getProduct } from '@/api/ecw/product'
import { getProductType, getProductTypeList } from '@/api/ecw/productType' import { getProductType, getProductTypeList } from '@/api/ecw/productType'
import { getCurrencyList } from '@/api/ecw/currency'; import { getCurrencyList } from '@/api/ecw/currency';
import { getUnitList } from '@/api/ecw/unit'; import { getUnitList } from '@/api/ecw/unit';
...@@ -262,14 +237,6 @@ export default { ...@@ -262,14 +237,6 @@ export default {
} }
} }
} }
/* clearancePric
clearancePriceUnit,
clearanceVolumeUnit,
specialDictType,
transportPrice,
transportPriceUnit,
transportVolumeUnit, */
}) })
} }
}, },
...@@ -281,36 +248,30 @@ export default { ...@@ -281,36 +248,30 @@ export default {
}, },
async created() { async created() {
// 修改回显 // 修改回显
if (this.$route.query.id) { if (this.$route.query.ids) {
getProductPrice(12).then(res => {
this.form = res.data
this.product = res.data.productDO
/* getProduct(res.data.productId).then(res => {
this.product = res.data
}) */
})
let query = { let query = {
ids: this.$route.query.id ids: this.$route.query.ids
} }
getProductPriceList(query).then(res => { getProductPriceList(query).then(res => {
this.form = res.data[0] this.form = {
productId: res.data[0].productId,
productType: res.data[0].productType,
specialList: res.data[0].specialList,
advanceStatus: res.data[0].advanceStatus,
needBook: res.data[0].needBook,
dayLimit: res.data[0].dayLimit,
containerLocation: res.data[0].containerLocation,
square: res.data[0].square
}
this.lineList = res.data this.lineList = res.data
}) })
// this.form =newdata[newdata.length-1]
// this.product = newdata[newdata.length-1].productDO
} }
// 指定产品 /* // 指定产品
else if (this.$route.query.product_id) { else if (this.$route.query.product_id) {
getProduct(this.$route.query.product_id).then(res => { getProduct(this.$route.query.product_id).then(res => {
this.product = res.data this.product = res.data
}) })
} } */
// 获取类型列表 // 获取类型列表
else { else {
this.productDisabled = false this.productDisabled = false
...@@ -333,7 +294,6 @@ export default { ...@@ -333,7 +294,6 @@ export default {
}) })
}, },
methods: { methods: {
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (!valid) { if (!valid) {
...@@ -341,28 +301,42 @@ export default { ...@@ -341,28 +301,42 @@ export default {
} }
// 只有新增的时候做判断 // 只有新增的时候做判断
if (!this.form.id && (!this.selectedRoutes || !this.selectedRoutes.length)) { if (!this.$route.query.ids && (!this.selectedRoutes || !this.selectedRoutes.length)) {
this.$message.error('请选择线路'); this.$message.error('请选择线路');
return; return;
} }
let data = Object.assign({}, this.form, { let data = Object.assign({}, this.form, {
lineChannelList: this.selectedRoutes, // lineChannelList: this.selectedRoutes,
specialList: this.specialProducts specialList: this.specialProducts
}) })
// 修改的提交 // 修改的提交
if (this.form.id != null) { if (this.$route.query.ids) {
if (this.lineList.length > 1) {//批量修改 if(this.lineList.length == 1){
batchUpdateProductPrice(data).then(response => { data.lineChannelList = {
this.$modal.msgSuccess("修改成功"); lineId: this.lineList[0].warehouseLineId,
this.$router.replace('/product/product-price') shippingChannelId: this.lineList[0].shippingChannelId || 0
}) }
} else { }else{
updateProductPrice(data).then(response => { data.lineChannelList = []
this.$modal.msgSuccess("修改成功"); this.lineList.forEach(item => {
this.$router.replace('/product/product-price') console.log(item.id, this.checkList.indexOf(item.id) > -1)
if(this.checkList.indexOf(item.id) > -1){
data.lineChannelList.push({
lineId: item.warehouseLineId,
shippingChannelId: item.shippingChannelId || 0
}
)
}
}) })
} }
if(data.lineChannelList.length < 1){
return this.$message.error('请选择需要修改的路线')
}
batchUpdateProductPrice(data).then(response => {
this.$modal.msgSuccess("修改成功");
this.$router.replace('/product/product-price')
})
return; return;
} }
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['ecw:product-price:create']">新增</el-button> <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['ecw:product-price:create']">新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-setting" size="mini" @click="handleEdit" :disabled="multiple" v-hasPermi="['ecw:product:attr']">批量设置路线</el-button> <el-button type="primary" plain icon="el-icon-setting" size="mini" @click="handleBatchEdit" :disabled="multiple" v-hasPermi="['ecw:product:attr']">批量设置路线</el-button>
</el-col> </el-col>
<!-- <el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
...@@ -78,31 +78,31 @@ ...@@ -78,31 +78,31 @@
<el-table-column label="序号" prop="id" width="50" /> <el-table-column label="序号" prop="id" width="50" />
<el-table-column label="商品编码" align="center" prop="productCode" > <el-table-column label="商品编码" align="center" prop="productCode" >
<template slot-scope="scope"> <template slot-scope="{row}">
<div> <div>
{{ scope.row.productDO.productCode }} {{ row.productDO ? row.productDO.productCode : '无productDO字段' }}
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="海关编码" align="center" prop="customsCode" > <el-table-column label="海关编码" align="center" prop="customsCode" >
<template slot-scope="scope"> <template slot-scope="{row}">
<div> <div>
{{ scope.row.productDO.customsCode }} {{ row.productDO ? row.productDO.customsCode : '无productDO字段' }}
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="商品类型" align="center" prop="typeId"> <el-table-column label="商品类型" align="center" prop="typeId">
<template slot-scope="scope"> <template slot-scope="{row}">
<span>{{ getTypeName(scope.row.productDO.typeId) }}</span> <span>{{ row.productDO ? getTypeName(row.productDO.typeId) : '无productDO字段' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="商品名称" align="center" prop="productName" > <el-table-column label="商品名称" align="center" prop="productName" >
<template slot-scope="scope"> <template slot-scope="{row}">
<div> <div>
{{ scope.row.productDO.titleZh }} {{ row.productDO ? row.productDO.titleZh : '无productDO字段' }}
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
...@@ -547,12 +547,12 @@ export default { ...@@ -547,12 +547,12 @@ export default {
}, },
// 批量设置路线 // 批量设置路线
handleEdit() { handleBatchEdit() {
this.$router.push('product-price/edit?id=' + this.ids) this.$router.push('../../lineProject/product-price/edit?ids=' + this.ids)
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
return this.$router.push('../../lineProject/product-price/edit?id=' + row.id) return this.$router.push('../../lineProject/product-price/edit?ids=' + row.id)
}, },
updateStatus(row, type) { updateStatus(row, type) {
......
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