Commit 52031a26 authored by honghy's avatar honghy

需求114 后台-集运-包裹列表-操作-特需

parent 4bde9e08
import request from '@/utils/request'
// 批量创建包裹特需
export function createConsSpecialNeed(data) {
return request({
url: '/ecw/cons-special-need/create',
method: 'post',
data: data
})
}
// 更新包裹特需
export function updateConsSpecialNeed(data) {
return request({
url: '/ecw/cons-special-need/update',
method: 'put',
data: data
})
}
// 删除包裹特需
export function deleteConsSpecialNeed(id) {
return request({
url: '/ecw/cons-special-need/delete?id=' + id,
method: 'delete'
})
}
// 获得包裹特需
export function getConsSpecialNeed(id) {
return request({
url: '/ecw/cons-special-need/get?id=' + id,
method: 'get'
})
}
// 根据包裹id特需列表
export function getSpecialListByConsId(id) {
return request({
url: '/ecw/cons-special-need/getSpecialListByConsId?consId=' + id,
method: 'get'
})
}
// 获得包裹特需分页
export function getConsSpecialNeedPage(query) {
return request({
url: '/ecw/cons-special-need/page',
method: 'get',
params: query
})
}
// 导出包裹特需 Excel
export function exportConsSpecialNeedExcel(query) {
return request({
url: '/ecw/cons-special-need/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
......@@ -13,13 +13,13 @@
</el-checkbox-group>
</el-form-item>
<el-form-item :label="$t('特殊要求备注')">
<el-input type="textarea" style="width: 300px;" v-model="todoDetail"></el-input>
<el-input type="textarea" style="width: 300px;" v-model="remarks"></el-input>
</el-form-item>
<el-form-item v-for="(item,index) in this.getDictDatas(this.DICT_TYPE.ORDER_SPECIAL_NEEDS)"
v-if="advanceType.indexOf(item.value) > -1" :key="item.value" :label="item.label + '预计金额'">
<el-input-number style="width: 300px;" v-model.number="specialNeedsList[index].transFee" type="number"
<el-input-number style="width: 300px;" v-model.number="specialNeedsList[index].expectedFee" type="number"
:min="0" step-strictly></el-input-number>
<el-select v-model="specialNeedsList[index].transCurrency">
<el-select v-model="specialNeedsList[index].expectedFeeCurrency">
<el-option v-for="item in JSON.parse(currency)" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
<div style="display: inline-block;margin-left: 20px;">
......@@ -40,7 +40,7 @@
<script>
import { getDictDatas, DICT_TYPE } from "@/utils/dict"
import { specialNeedCreate } from "@/api/ecw/order"
import { createConsSpecialNeed, getSpecialListByConsId } from "@/api/ecw/consSpecialNeed"
export default {
name: "specialNeedsCons",
......@@ -59,23 +59,29 @@ export default {
form: {},
advanceType: [],
specialNeedsList: [],
todoDetail: "",
remarks: "",
echoList: []
}
},
methods: {
submit() {
this.specialNeedsList.forEach(i => {
i.todoDetail = this.todoDetail
i.remarks = this.remarks
})
let p = this.specialNeedsList.filter(i => this.advanceType.indexOf(i.advanceType) > -1)
let p1 = []
console.log(111111111111111111111111111111111111)
console.log(this.echoList)
console.log(p)
console.log(this.specialNeedsList)
console.log(111111111111111111111111111111111111)
//获取新增的和修改的
p.forEach(item => {
if (this.echoList.find(i => item.id === i.id)) {
p1.push(item)
} else {
item.needStatus = 0
item.oper = "add"
p1.push(item)
}
......@@ -87,14 +93,13 @@ export default {
p1.push(item)
}
})
let p2 = p1.filter(i => Number(i.transFee) > 0)
let p2 = p1.filter(i => Number(i.expectedFee) >= 0)
if (p2.every(i => !!i.payType)) {
specialNeedCreate(p1).then(r => {
if (r.code === 0) {
this.$emit("update:showSpecialNeedsCons", false)
this.$emit("determine")
this.$message.success("提交成功")
}
console.log(p1)
createConsSpecialNeed(p1).then(r => {
this.$emit("update:showSpecialNeedsCons", false)
this.$emit("determine")
this.$message.success("提交成功")
})
} else {
let v = p2.map(i => i.advanceType)
......@@ -111,29 +116,30 @@ export default {
this.specialNeedsList.push({
advanceType: r.value,
consId: this.consId,
transFee: "",//预计金额
transCurrency: 1,//运输费币种
expectedFee: "",//预计金额
expectedFeeCurrency: 1,//运输费币种
payType: ""
})
})
//特需回显
// getSpecialListByOrderId(this.consId).then(r => {
// this.echoList = r.data;
// if(r.data.length){
// this.todoDetail = r.data[0].todoDetail
// }
// r.data.forEach(i => {
// this.advanceType.push(i.advanceType)
// let index = this.specialNeedsList.findIndex(item => i.advanceType == item.advanceType)
// this.specialNeedsList.splice(index,1, { advanceType:i.advanceType,
// consId:this.consId,
// id:i.id,
// transFee:i.transFee,//预计金额
// transCurrency:i.transCurrency,//运输费币种
// payType:i.payType})
// })
//
// })
getSpecialListByConsId(this.consId).then(r => {
this.echoList = r.data
if (r.data.length) {
this.remarks = r.data[0].remarks
}
r.data.forEach(i => {
this.advanceType.push(i.advanceType+'')
let index = this.specialNeedsList.findIndex(item => i.advanceType == item.advanceType)
this.specialNeedsList.splice(index, 1, {
advanceType: i.advanceType+'',
consId: this.consId,
id: i.id,
expectedFee: i.expectedFee,//预计金额
expectedFeeCurrency: i.expectedFeeCurrency,//运输费币种
payType: i.payType
})
})
})
} else {
this.specialNeedsList = []
this.advanceType = []
......
......@@ -64,6 +64,7 @@ export default {
}
createConsException(param).then(response => {
this.showException = false
this.$emit("determine")
this.$modal.msgSuccess("新增成功")
})
}
......
......@@ -249,8 +249,8 @@
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<Transmutation :showException.sync="showException" :id="id"></Transmutation>
<SpecialNeedsCons :showSpecialNeedsCons.sync="showSpecialNeedsCons" :currency="JSON.stringify(currencyList)" :consId="id" :consNum="consNum"></SpecialNeedsCons>
<Transmutation :showException.sync="showException" :id="id" @determine="getList"></Transmutation>
<SpecialNeedsCons :showSpecialNeedsCons.sync="showSpecialNeedsCons" :currency="JSON.stringify(currencyList)" :consId="id" :consNum="consNum" @determine="getList"></SpecialNeedsCons>
</div>
</template>
......
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