|
@@ -197,10 +197,10 @@
|
|
|
style="width: 100%"
|
|
|
class="position"
|
|
|
v-for="(item, index) in deptBudgetList.tranProcessInfoList"
|
|
|
- :key="index"
|
|
|
+ :key="item.id"
|
|
|
>
|
|
|
<div class="driver">
|
|
|
- <span>运输阶段{{ index + 1 }} {{ item.processNo }}</span>
|
|
|
+ <span>运输阶段{{ item.key }} {{ item.processNo }}</span>
|
|
|
<img
|
|
|
v-if="!endflag"
|
|
|
width="22"
|
|
@@ -223,7 +223,7 @@
|
|
|
v-if="index == deptBudgetList.tranProcessInfoList.length - 1"
|
|
|
>最终阶段</span> -->
|
|
|
<el-checkbox
|
|
|
- @change="(val) => engflagchange(val,index)"
|
|
|
+ @change="(val) => engflagchange(val, index)"
|
|
|
class="endflag"
|
|
|
true-label="1"
|
|
|
false-label="0"
|
|
@@ -429,6 +429,7 @@ export default {
|
|
|
receiveDetailedAddress: '',
|
|
|
sender: '',
|
|
|
receiver: '',
|
|
|
+ key: 1,
|
|
|
senderPhone: '',
|
|
|
receiverPhone: '',
|
|
|
endFlag: '0',
|
|
@@ -648,7 +649,10 @@ export default {
|
|
|
},
|
|
|
add(index) {
|
|
|
this.deptBudgetList.tranProcessInfoList.push({
|
|
|
- processNo: this.deptBudgetList.taskNo + '-' + this.number,
|
|
|
+ processNo:
|
|
|
+ this.deptBudgetList.taskNo +
|
|
|
+ '-' +
|
|
|
+ (this.deptBudgetList.tranProcessInfoList.length + 1),
|
|
|
tranType: '汽运',
|
|
|
tranTypeKey: '1',
|
|
|
deliveryDateStart: '',
|
|
@@ -669,17 +673,25 @@ export default {
|
|
|
receiveDetailedAddress: '',
|
|
|
sender: '',
|
|
|
receiver: '',
|
|
|
+ key: this.deptBudgetList.tranProcessInfoList.length,
|
|
|
senderPhone: '',
|
|
|
receiverPhone: '',
|
|
|
endFlag: '0',
|
|
|
})
|
|
|
- this.number++
|
|
|
},
|
|
|
del(index) {
|
|
|
if (this.deptBudgetList.tranProcessInfoList.length > 1) {
|
|
|
this.deptBudgetList.tranProcessInfoList.splice(index, 1)
|
|
|
}
|
|
|
- this.number--
|
|
|
+ for (let i = 0; i < this.deptBudgetList.tranProcessInfoList.length; i++) {
|
|
|
+ this.$set(this.deptBudgetList.tranProcessInfoList[i], 'key', i + 1)
|
|
|
+ this.$set(
|
|
|
+ this.deptBudgetList.tranProcessInfoList[i],
|
|
|
+ 'processNo',
|
|
|
+ this.deptBudgetList.taskNo + '-' + (i + 1)
|
|
|
+ )
|
|
|
+ }
|
|
|
+ this.$forceUpdate()
|
|
|
},
|
|
|
handleChange(value) {
|
|
|
this.selectedOptions = value
|
|
@@ -931,96 +943,206 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
- this.$confirm(`运输任务提交成功后将派发到物流部门,是否确定提交?`, {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.$refs.deptBudgetList.validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- this.deptBudgetList.compId =
|
|
|
- sessionStorage.getItem('ws-pf_compId')
|
|
|
- this.deptBudgetList.tranType = this.checkList.toString()
|
|
|
- this.deptBudgetList.startPrivate =
|
|
|
- CodeToText[this.selectedOptions[0]]
|
|
|
- this.deptBudgetList.startCity =
|
|
|
- CodeToText[this.selectedOptions[1]]
|
|
|
- this.deptBudgetList.startArea =
|
|
|
- CodeToText[this.selectedOptions[2]]
|
|
|
- this.deptBudgetList.tranProcessInfoList[0].sendPrivate =
|
|
|
- CodeToText[this.selectedOptions[0]]
|
|
|
- this.deptBudgetList.tranProcessInfoList[0].sendCity =
|
|
|
- CodeToText[this.selectedOptions[1]]
|
|
|
- this.deptBudgetList.tranProcessInfoList[0].sendArea =
|
|
|
- CodeToText[this.selectedOptions[2]]
|
|
|
- if (this.endflag) {
|
|
|
- this.deptBudgetList.tranProcessInfoList[
|
|
|
- this.deptBudgetList.tranProcessInfoList.length - 1
|
|
|
- ].receivePrivate = CodeToText[this.selectedOptions1[0]]
|
|
|
- this.deptBudgetList.tranProcessInfoList[
|
|
|
- this.deptBudgetList.tranProcessInfoList.length - 1
|
|
|
- ].receiveCity = CodeToText[this.selectedOptions1[1]]
|
|
|
- this.deptBudgetList.tranProcessInfoList[
|
|
|
- this.deptBudgetList.tranProcessInfoList.length - 1
|
|
|
- ].receiveArea = CodeToText[this.selectedOptions1[2]]
|
|
|
- }
|
|
|
+ if (this.endflag) {
|
|
|
+ this.$confirm(`运输任务提交成功后将派发到物流部门,是否确定提交?`, {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$refs.deptBudgetList.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.deptBudgetList.compId =
|
|
|
+ sessionStorage.getItem('ws-pf_compId')
|
|
|
+ this.deptBudgetList.tranType = this.checkList.toString()
|
|
|
+ this.deptBudgetList.startPrivate =
|
|
|
+ CodeToText[this.selectedOptions[0]]
|
|
|
+ this.deptBudgetList.startCity =
|
|
|
+ CodeToText[this.selectedOptions[1]]
|
|
|
+ this.deptBudgetList.startArea =
|
|
|
+ CodeToText[this.selectedOptions[2]]
|
|
|
+ this.deptBudgetList.tranProcessInfoList[0].sendPrivate =
|
|
|
+ CodeToText[this.selectedOptions[0]]
|
|
|
+ this.deptBudgetList.tranProcessInfoList[0].sendCity =
|
|
|
+ CodeToText[this.selectedOptions[1]]
|
|
|
+ this.deptBudgetList.tranProcessInfoList[0].sendArea =
|
|
|
+ CodeToText[this.selectedOptions[2]]
|
|
|
+ if (this.endflag) {
|
|
|
+ this.deptBudgetList.tranProcessInfoList[
|
|
|
+ this.deptBudgetList.tranProcessInfoList.length - 1
|
|
|
+ ].receivePrivate = CodeToText[this.selectedOptions1[0]]
|
|
|
+ this.deptBudgetList.tranProcessInfoList[
|
|
|
+ this.deptBudgetList.tranProcessInfoList.length - 1
|
|
|
+ ].receiveCity = CodeToText[this.selectedOptions1[1]]
|
|
|
+ this.deptBudgetList.tranProcessInfoList[
|
|
|
+ this.deptBudgetList.tranProcessInfoList.length - 1
|
|
|
+ ].receiveArea = CodeToText[this.selectedOptions1[2]]
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.deptBudgetList.taskType != '销售出库' ||
|
|
|
+ this.deptBudgetList.taskType != '贸易服务出库' ||
|
|
|
+ this.deptBudgetList.taskType != '暂存出库'
|
|
|
+ ){
|
|
|
+ this.deptBudgetList.endPrivate = CodeToText[this.selectedOptions1[0]]
|
|
|
+ this.deptBudgetList.endCity = CodeToText[this.selectedOptions1[1]]
|
|
|
+ this.deptBudgetList.endArea = CodeToText[this.selectedOptions1[2]]
|
|
|
+ }
|
|
|
+ for (
|
|
|
+ var i = 0;
|
|
|
+ i < this.deptBudgetList.tranProcessInfoList.length;
|
|
|
+ i++
|
|
|
+ ) {
|
|
|
+ this.deptBudgetList.tranProcessInfoList[i].sort = i
|
|
|
+ }
|
|
|
|
|
|
- for (
|
|
|
- var i = 0;
|
|
|
- i < this.deptBudgetList.tranProcessInfoList.length;
|
|
|
- i++
|
|
|
- ) {
|
|
|
- this.deptBudgetList.tranProcessInfoList[i].sort = i
|
|
|
+ addtrantask(this.deptBudgetList)
|
|
|
+ .toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ this.$message.success('添加成功')
|
|
|
+ this.deptBudgetList = {
|
|
|
+ taskNo: '',
|
|
|
+ totalStorage: 0,
|
|
|
+ goodsName: '玉米',
|
|
|
+ goodsNameKey: 1,
|
|
|
+ warehouseType: '1',
|
|
|
+ tranProcessInfoList: [
|
|
|
+ {
|
|
|
+ processNo: '',
|
|
|
+ tranType: '汽运',
|
|
|
+ deliveryDateStart: '',
|
|
|
+ deliveryDateEnd: '',
|
|
|
+ weight: '',
|
|
|
+ selectedOptions: [],
|
|
|
+ selectedOptions1: [],
|
|
|
+ sendPrivate: '',
|
|
|
+ sendCity: '',
|
|
|
+ sendArea: '',
|
|
|
+ receivePrivate: '',
|
|
|
+ receiveCity: '',
|
|
|
+ receiveArea: '',
|
|
|
+ sendDetailedAddress: '',
|
|
|
+ receiveDetailedAddress: '',
|
|
|
+ sender: '',
|
|
|
+ receiver: '',
|
|
|
+ senderPhone: '',
|
|
|
+ receiverPhone: '',
|
|
|
+ contractNo: '',
|
|
|
+ receiveWarehouse: '',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ this.$router.push({ path: 'tranManagementTransport' })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
|
|
|
+ return false
|
|
|
}
|
|
|
-
|
|
|
- addtrantask(this.deptBudgetList)
|
|
|
- .toPromise()
|
|
|
- .then((response) => {
|
|
|
- this.$message.success('添加成功')
|
|
|
- this.deptBudgetList = {
|
|
|
- taskNo: '',
|
|
|
- totalStorage: 0,
|
|
|
- goodsName: '玉米',
|
|
|
- goodsNameKey: 1,
|
|
|
- warehouseType: '1',
|
|
|
- tranProcessInfoList: [
|
|
|
- {
|
|
|
- processNo: '',
|
|
|
- tranType: '汽运',
|
|
|
- deliveryDateStart: '',
|
|
|
- deliveryDateEnd: '',
|
|
|
- weight: '',
|
|
|
- selectedOptions: [],
|
|
|
- selectedOptions1: [],
|
|
|
- sendPrivate: '',
|
|
|
- sendCity: '',
|
|
|
- sendArea: '',
|
|
|
- receivePrivate: '',
|
|
|
- receiveCity: '',
|
|
|
- receiveArea: '',
|
|
|
- sendDetailedAddress: '',
|
|
|
- receiveDetailedAddress: '',
|
|
|
- sender: '',
|
|
|
- receiver: '',
|
|
|
- senderPhone: '',
|
|
|
- receiverPhone: '',
|
|
|
- contractNo: '',
|
|
|
- receiveWarehouse: '',
|
|
|
- },
|
|
|
- ],
|
|
|
- }
|
|
|
- this.$router.push({ path: 'tranManagementTransport' })
|
|
|
- })
|
|
|
- } else {
|
|
|
- EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
|
|
|
- return false
|
|
|
- }
|
|
|
+ })
|
|
|
})
|
|
|
+ .catch(() => {
|
|
|
+ return false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$confirm(`您还未选择最终阶段,是否确定提交??`, {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
})
|
|
|
- .catch(() => {
|
|
|
- return false
|
|
|
- })
|
|
|
+ .then(() => {
|
|
|
+ this.$refs.deptBudgetList.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.deptBudgetList.compId =
|
|
|
+ sessionStorage.getItem('ws-pf_compId')
|
|
|
+ this.deptBudgetList.tranType = this.checkList.toString()
|
|
|
+ this.deptBudgetList.startPrivate =
|
|
|
+ CodeToText[this.selectedOptions[0]]
|
|
|
+ this.deptBudgetList.startCity =
|
|
|
+ CodeToText[this.selectedOptions[1]]
|
|
|
+ this.deptBudgetList.startArea =
|
|
|
+ CodeToText[this.selectedOptions[2]]
|
|
|
+ this.deptBudgetList.tranProcessInfoList[0].sendPrivate =
|
|
|
+ CodeToText[this.selectedOptions[0]]
|
|
|
+ this.deptBudgetList.tranProcessInfoList[0].sendCity =
|
|
|
+ CodeToText[this.selectedOptions[1]]
|
|
|
+ this.deptBudgetList.tranProcessInfoList[0].sendArea =
|
|
|
+ CodeToText[this.selectedOptions[2]]
|
|
|
+ if (this.endflag) {
|
|
|
+ this.deptBudgetList.tranProcessInfoList[
|
|
|
+ this.deptBudgetList.tranProcessInfoList.length - 1
|
|
|
+ ].receivePrivate = CodeToText[this.selectedOptions1[0]]
|
|
|
+ this.deptBudgetList.tranProcessInfoList[
|
|
|
+ this.deptBudgetList.tranProcessInfoList.length - 1
|
|
|
+ ].receiveCity = CodeToText[this.selectedOptions1[1]]
|
|
|
+ this.deptBudgetList.tranProcessInfoList[
|
|
|
+ this.deptBudgetList.tranProcessInfoList.length - 1
|
|
|
+ ].receiveArea = CodeToText[this.selectedOptions1[2]]
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ this.deptBudgetList.taskType != '销售出库' ||
|
|
|
+ this.deptBudgetList.taskType != '贸易服务出库' ||
|
|
|
+ this.deptBudgetList.taskType != '暂存出库'
|
|
|
+ ){
|
|
|
+ this.deptBudgetList.endPrivate = CodeToText[this.selectedOptions1[0]]
|
|
|
+ this.deptBudgetList.endCity = CodeToText[this.selectedOptions1[1]]
|
|
|
+ this.deptBudgetList.endArea = CodeToText[this.selectedOptions1[2]]
|
|
|
+ }
|
|
|
+
|
|
|
+ for (
|
|
|
+ var i = 0;
|
|
|
+ i < this.deptBudgetList.tranProcessInfoList.length;
|
|
|
+ i++
|
|
|
+ ) {
|
|
|
+ this.deptBudgetList.tranProcessInfoList[i].sort = i
|
|
|
+ }
|
|
|
+
|
|
|
+ addtrantask(this.deptBudgetList)
|
|
|
+ .toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ this.$message.success('添加成功')
|
|
|
+ this.deptBudgetList = {
|
|
|
+ taskNo: '',
|
|
|
+ totalStorage: 0,
|
|
|
+ goodsName: '玉米',
|
|
|
+ goodsNameKey: 1,
|
|
|
+ warehouseType: '1',
|
|
|
+ tranProcessInfoList: [
|
|
|
+ {
|
|
|
+ processNo: '',
|
|
|
+ tranType: '汽运',
|
|
|
+ deliveryDateStart: '',
|
|
|
+ deliveryDateEnd: '',
|
|
|
+ weight: '',
|
|
|
+ selectedOptions: [],
|
|
|
+ selectedOptions1: [],
|
|
|
+ sendPrivate: '',
|
|
|
+ sendCity: '',
|
|
|
+ sendArea: '',
|
|
|
+ receivePrivate: '',
|
|
|
+ receiveCity: '',
|
|
|
+ receiveArea: '',
|
|
|
+ sendDetailedAddress: '',
|
|
|
+ receiveDetailedAddress: '',
|
|
|
+ sender: '',
|
|
|
+ receiver: '',
|
|
|
+ senderPhone: '',
|
|
|
+ receiverPhone: '',
|
|
|
+ contractNo: '',
|
|
|
+ receiveWarehouse: '',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ this.$router.push({ path: 'tranManagementTransport' })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ return false
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
resetForm(deptBudgetList) {
|
|
|
this.$refs[deptBudgetList].resetFields()
|