|
@@ -259,9 +259,9 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import PageTitle from "@/components/Page/Title";
|
|
|
-import { sjTime, isNumber } from "@/utils/sharedJsFile";
|
|
|
-import { getCookie } from "@/utils/util.js";
|
|
|
+import PageTitle from '@/components/Page/Title'
|
|
|
+import { sjTime, isNumber } from '@/utils/sharedJsFile'
|
|
|
+import { getCookie } from '@/utils/util.js'
|
|
|
export default {
|
|
|
components: { PageTitle },
|
|
|
data() {
|
|
@@ -272,8 +272,8 @@ export default {
|
|
|
disabled: false,
|
|
|
materialTimes: null,
|
|
|
options: [],
|
|
|
- value: "",
|
|
|
- receiveName: "",
|
|
|
+ value: '',
|
|
|
+ receiveName: '',
|
|
|
stateCarrier: null,
|
|
|
stateSupplier: null,
|
|
|
stateConsignee: null,
|
|
@@ -282,25 +282,25 @@ export default {
|
|
|
orderTypeList: [
|
|
|
{
|
|
|
value: 12,
|
|
|
- label: "进厂"
|
|
|
+ label: '进厂'
|
|
|
},
|
|
|
{
|
|
|
value: 13,
|
|
|
- label: "出厂"
|
|
|
+ label: '出厂'
|
|
|
},
|
|
|
{
|
|
|
value: 14,
|
|
|
- label: "中转"
|
|
|
+ label: '中转'
|
|
|
},
|
|
|
{
|
|
|
value: 19,
|
|
|
- label: "退货"
|
|
|
+ label: '退货'
|
|
|
}
|
|
|
],
|
|
|
orderType: null,
|
|
|
restaurantsCarrier: null,
|
|
|
// 线路名称
|
|
|
- lineName: "",
|
|
|
+ lineName: '',
|
|
|
//线路id
|
|
|
lineId: null,
|
|
|
// 件数与重量的开关
|
|
@@ -312,28 +312,28 @@ export default {
|
|
|
//物资表格表头
|
|
|
tableTop: [
|
|
|
{
|
|
|
- prop: "materialCode",
|
|
|
- label: "物资编码",
|
|
|
- width: "160"
|
|
|
+ prop: 'materialCode',
|
|
|
+ label: '物资编码',
|
|
|
+ width: '160'
|
|
|
},
|
|
|
{
|
|
|
- prop: "materialName",
|
|
|
- label: "物资名称",
|
|
|
- width: "140"
|
|
|
+ prop: 'materialName',
|
|
|
+ label: '物资名称',
|
|
|
+ width: '140'
|
|
|
},
|
|
|
{
|
|
|
- prop: "materialSpecification",
|
|
|
- label: "规格型号",
|
|
|
- width: "140"
|
|
|
+ prop: 'materialSpecification',
|
|
|
+ label: '规格型号',
|
|
|
+ width: '140'
|
|
|
},
|
|
|
{
|
|
|
- prop: "materialPriority",
|
|
|
- label: "装卸货优先级",
|
|
|
+ prop: 'materialPriority',
|
|
|
+ label: '装卸货优先级',
|
|
|
slot: true
|
|
|
},
|
|
|
{
|
|
|
- prop: "orderMaterialWeight",
|
|
|
- label: "重量",
|
|
|
+ prop: 'orderMaterialWeight',
|
|
|
+ label: '重量',
|
|
|
slot: true
|
|
|
}
|
|
|
],
|
|
@@ -346,9 +346,9 @@ export default {
|
|
|
selectionList1: [],
|
|
|
newsArr: [],
|
|
|
//物资名称
|
|
|
- materialName: "",
|
|
|
+ materialName: '',
|
|
|
//发货单位名称
|
|
|
- supplierName: "",
|
|
|
+ supplierName: '',
|
|
|
//发货单位id
|
|
|
supplierId: null,
|
|
|
//物资id
|
|
@@ -358,131 +358,133 @@ export default {
|
|
|
//是否需要打开模态窗口
|
|
|
drawer: false,
|
|
|
a: 1,
|
|
|
- direction: "rtl",
|
|
|
+ direction: 'rtl',
|
|
|
inputMaterial: null,
|
|
|
input: null,
|
|
|
//物资模态框
|
|
|
materialOptions: {
|
|
|
- requestUrl: "",
|
|
|
- selectionType: "select"
|
|
|
+ requestUrl: '',
|
|
|
+ selectionType: 'select'
|
|
|
},
|
|
|
line: {
|
|
|
- requestUrl: "",
|
|
|
- selectionType: "radio"
|
|
|
+ requestUrl: '',
|
|
|
+ selectionType: 'radio'
|
|
|
},
|
|
|
row: {}
|
|
|
- };
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
value() {
|
|
|
if (this.value) {
|
|
|
- console.log(this.value);
|
|
|
- console.log(this.tableTop.length);
|
|
|
- this.tableTop.splice(this.tableTop.length - 1, 1);
|
|
|
+ console.log(this.value)
|
|
|
+ console.log(this.tableTop.length)
|
|
|
+ this.tableTop.splice(this.tableTop.length - 1, 1)
|
|
|
this.tableTop.push({
|
|
|
- prop: "orderMaterialNumber",
|
|
|
- label: "件数",
|
|
|
+ prop: 'orderMaterialNumber',
|
|
|
+ label: '件数',
|
|
|
slot: true
|
|
|
- });
|
|
|
+ })
|
|
|
} else {
|
|
|
- this.tableTop.splice(this.tableTop.length - 1, 1);
|
|
|
+ this.tableTop.splice(this.tableTop.length - 1, 1)
|
|
|
this.tableTop.push({
|
|
|
- prop: "orderMaterialWeight",
|
|
|
- label: "重量",
|
|
|
+ prop: 'orderMaterialWeight',
|
|
|
+ label: '重量',
|
|
|
slot: true
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
//关闭运输线路
|
|
|
handleClose(done) {
|
|
|
- done();
|
|
|
- this.line.requestUrl = "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3";
|
|
|
+ done()
|
|
|
+ this.line.requestUrl = '/api/v1/rms/getAllLineDesk?apiId=249&lineType=3'
|
|
|
},
|
|
|
onclickMaterial() {
|
|
|
if (this.inputMaterial != null) {
|
|
|
this.materialOptions.requestUrl =
|
|
|
- "/api/v1/uc/selectAllMaterialName?apiId=395&index=" +
|
|
|
- this.inputMaterial;
|
|
|
+ '/api/v1/uc/selectAllMaterialName?apiId=395&index=' +
|
|
|
+ this.inputMaterial +
|
|
|
+ '&i=' +
|
|
|
+ new Date()
|
|
|
} else {
|
|
|
this.materialOptions.requestUrl =
|
|
|
- "/api/v1/uc/selectAllMaterialName?apiId=395";
|
|
|
+ '/api/v1/uc/selectAllMaterialName?apiId=395' + '&i=' + new Date()
|
|
|
}
|
|
|
},
|
|
|
onInputTimes() {
|
|
|
if (!isNumber(this.materialTimes)) {
|
|
|
- this.$message.warning("趟次请输入数字");
|
|
|
+ this.$message.warning('趟次请输入数字')
|
|
|
}
|
|
|
},
|
|
|
onblur() {
|
|
|
- this.isMoreTrips = false;
|
|
|
+ this.isMoreTrips = false
|
|
|
if (this.materaialTimes <= 0) {
|
|
|
- this.$message.warning("趟次必须大于0");
|
|
|
- this.materialTimes = null;
|
|
|
+ this.$message.warning('趟次必须大于0')
|
|
|
+ this.materialTimes = null
|
|
|
}
|
|
|
if (this.materialTimes > 1) {
|
|
|
- this.isMoreTrips = true;
|
|
|
+ this.isMoreTrips = true
|
|
|
}
|
|
|
},
|
|
|
onInputPriority(scope) {
|
|
|
if (!isNumber(scope)) {
|
|
|
- this.$message.warning("装卸货次序请输入数字");
|
|
|
+ this.$message.warning('装卸货次序请输入数字')
|
|
|
}
|
|
|
},
|
|
|
onInputWeight(scope) {
|
|
|
if (!isNumber(scope)) {
|
|
|
- this.$message.warning("重量请输入数字");
|
|
|
+ this.$message.warning('重量请输入数字')
|
|
|
}
|
|
|
},
|
|
|
onInputNumber(scope) {
|
|
|
if (!isNumber(scope)) {
|
|
|
- this.$message.warning("件数请输入数字");
|
|
|
+ this.$message.warning('件数请输入数字')
|
|
|
}
|
|
|
},
|
|
|
//流向选择框变动后
|
|
|
flowChange() {
|
|
|
if (this.orderType == 12) {
|
|
|
- this.inputLine = "零星进厂";
|
|
|
+ this.inputLine = '零星进厂'
|
|
|
}
|
|
|
if (this.orderType == 13) {
|
|
|
- this.inputLine = "零星出厂";
|
|
|
+ this.inputLine = '零星出厂'
|
|
|
}
|
|
|
if (this.orderType == 14) {
|
|
|
- this.inputLine = "零星中转";
|
|
|
+ this.inputLine = '零星中转'
|
|
|
}
|
|
|
if (this.orderType == 19) {
|
|
|
- this.inputLine = "退货";
|
|
|
+ this.inputLine = '退货'
|
|
|
}
|
|
|
},
|
|
|
drawTable() {
|
|
|
this.materialOptions.requestUrl =
|
|
|
- "/api/v1/uc/selectAllMaterialName?apiId=395" + "&test=" + new Date();
|
|
|
- this.selectionList1 = [];
|
|
|
- this.table = true;
|
|
|
+ '/api/v1/uc/selectAllMaterialName?apiId=395' + '&test=' + new Date()
|
|
|
+ this.selectionList1 = []
|
|
|
+ this.table = true
|
|
|
},
|
|
|
//收货单位弹出层
|
|
|
handleSelectConsignee(item) {
|
|
|
- this.consigneeId = item.consigneeId;
|
|
|
- item.consigneeCompanyName = this.consigneeCompanyName;
|
|
|
+ this.consigneeId = item.consigneeId
|
|
|
+ item.consigneeCompanyName = this.consigneeCompanyName
|
|
|
},
|
|
|
//以下是发货单位边输边查搜索
|
|
|
querySearchConsignee(queryString, cb) {
|
|
|
this.axios
|
|
|
- .post("/api/v1/uc/getConsigneeByLike?index=" + queryString)
|
|
|
+ .post('/api/v1/uc/getConsigneeByLike?index=' + queryString)
|
|
|
.then(res => {
|
|
|
- if (res.data.code == "200") {
|
|
|
- console.log(res);
|
|
|
- var restaurantsConsignee = res.data.data;
|
|
|
+ if (res.data.code == '200') {
|
|
|
+ console.log(res)
|
|
|
+ var restaurantsConsignee = res.data.data
|
|
|
var results = queryString
|
|
|
? restaurantsConsignee.filter(
|
|
|
this.createFilterConsignee(queryString)
|
|
|
)
|
|
|
- : restaurantsConsignee;
|
|
|
+ : restaurantsConsignee
|
|
|
// 调用 callback 返回建议列表的数据
|
|
|
- cb(results);
|
|
|
+ cb(results)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
createFilterConsignee(queryString) {
|
|
|
return restaurantsConsignee => {
|
|
@@ -490,31 +492,31 @@ export default {
|
|
|
restaurantsConsignee.value
|
|
|
.toLowerCase()
|
|
|
.indexOf(queryString.toLowerCase()) > -1
|
|
|
- );
|
|
|
- };
|
|
|
+ )
|
|
|
+ }
|
|
|
},
|
|
|
//以上是返回单位边输边查搜索
|
|
|
//发货单位弹出层
|
|
|
handleSelectSupplier(item) {
|
|
|
- this.supplierId = item.supplierId;
|
|
|
- item.supplierName = this.supplierName;
|
|
|
+ this.supplierId = item.supplierId
|
|
|
+ item.supplierName = this.supplierName
|
|
|
},
|
|
|
//以下是发货单位边输边查搜索
|
|
|
querySearchSupplier(queryString, cb) {
|
|
|
this.axios
|
|
|
- .post("/api/v1/uc/getSupplierMesByLike?index=" + this.stateSupplier)
|
|
|
+ .post('/api/v1/uc/getSupplierMesByLike?index=' + this.stateSupplier)
|
|
|
.then(res => {
|
|
|
- if (res.data.code == "200") {
|
|
|
- var restaurantsSupplier = res.data.data;
|
|
|
+ if (res.data.code == '200') {
|
|
|
+ var restaurantsSupplier = res.data.data
|
|
|
var results = queryString
|
|
|
? restaurantsSupplier.filter(
|
|
|
this.createFilterSupplier(queryString)
|
|
|
)
|
|
|
- : restaurantsSupplier;
|
|
|
+ : restaurantsSupplier
|
|
|
// 调用 callback 返回建议列表的数据
|
|
|
- cb(results);
|
|
|
+ cb(results)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
createFilterSupplier(queryString) {
|
|
|
return restaurantsSupplier => {
|
|
@@ -522,29 +524,29 @@ export default {
|
|
|
restaurantsSupplier.value
|
|
|
.toLowerCase()
|
|
|
.indexOf(queryString.toLowerCase()) > -1
|
|
|
- );
|
|
|
- };
|
|
|
+ )
|
|
|
+ }
|
|
|
},
|
|
|
//承运商弹出层
|
|
|
handleSelectCarrier(item) {
|
|
|
- this.carrierId = item.carrierId;
|
|
|
- item.carrierName = this.stateCarrier;
|
|
|
+ this.carrierId = item.carrierId
|
|
|
+ item.carrierName = this.stateCarrier
|
|
|
},
|
|
|
//以下是承运商边输边查搜索
|
|
|
querySearchCarrier(queryString, cb) {
|
|
|
this.axios
|
|
|
- .post("/api/v1/uc/getCarrierMesByLike?index=" + queryString)
|
|
|
+ .post('/api/v1/uc/getCarrierMesByLike?index=' + queryString)
|
|
|
.then(res => {
|
|
|
- if (res.data.code == "200") {
|
|
|
- var restaurantsCarrier = res.data.data;
|
|
|
- console.log(restaurantsCarrier, "restaurantsCarrier");
|
|
|
+ if (res.data.code == '200') {
|
|
|
+ var restaurantsCarrier = res.data.data
|
|
|
+ console.log(restaurantsCarrier, 'restaurantsCarrier')
|
|
|
var results = queryString
|
|
|
? restaurantsCarrier.filter(this.createFilterCarrier(queryString))
|
|
|
- : restaurantsCarrier;
|
|
|
+ : restaurantsCarrier
|
|
|
// 调用 callback 返回建议列表的数据
|
|
|
- cb(results);
|
|
|
+ cb(results)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
createFilterCarrier(queryString) {
|
|
|
return restaurantsCarrier => {
|
|
@@ -552,20 +554,20 @@ export default {
|
|
|
restaurantsCarrier.value
|
|
|
.toLowerCase()
|
|
|
.indexOf(queryString.toLowerCase()) > -1
|
|
|
- );
|
|
|
- };
|
|
|
+ )
|
|
|
+ }
|
|
|
},
|
|
|
//以上是承运商边输边查搜索
|
|
|
//删除行
|
|
|
deleteRow(index, rows) {
|
|
|
- rows.splice(index, 1);
|
|
|
+ rows.splice(index, 1)
|
|
|
},
|
|
|
// 返回主界面
|
|
|
makeSure1() {
|
|
|
- var arr = [];
|
|
|
+ var arr = []
|
|
|
for (let i = 0; i < this.newsArr.length; i++) {
|
|
|
if (arr.indexOf(this.newsArr[i]) === -1) {
|
|
|
- arr.push(this.newsArr[i]);
|
|
|
+ arr.push(this.newsArr[i])
|
|
|
}
|
|
|
}
|
|
|
arr.forEach(e => {
|
|
@@ -575,92 +577,92 @@ export default {
|
|
|
materialCode: e.materialCode,
|
|
|
materialId: e.materialId,
|
|
|
materialPriority: 1
|
|
|
- };
|
|
|
- this.tableData.push(addmap);
|
|
|
- });
|
|
|
- this.newsArr = [];
|
|
|
- this.table = false;
|
|
|
+ }
|
|
|
+ this.tableData.push(addmap)
|
|
|
+ })
|
|
|
+ this.newsArr = []
|
|
|
+ this.table = false
|
|
|
},
|
|
|
// 返回选中的物资信息
|
|
|
selectionChange(selection) {
|
|
|
- console.log(selection);
|
|
|
- this.selectionList1 = [];
|
|
|
- this.selectionList1 = selection;
|
|
|
- this.newsArr = [];
|
|
|
+ console.log(selection)
|
|
|
+ this.selectionList1 = []
|
|
|
+ this.selectionList1 = selection
|
|
|
+ this.newsArr = []
|
|
|
for (let i = 0; i < this.selectionList1.length; i++) {
|
|
|
if (this.newsArr.indexOf(this.selectionList1[i]) === -1) {
|
|
|
- this.newsArr.push(this.selectionList1[i]);
|
|
|
+ this.newsArr.push(this.selectionList1[i])
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
onclick(a) {
|
|
|
if (a == 5) {
|
|
|
this.line.requestUrl =
|
|
|
- "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&con=" + this.input;
|
|
|
+ '/api/v1/rms/getAllLineDesk?apiId=249&lineType=3&con=' + this.input
|
|
|
}
|
|
|
},
|
|
|
ondrawer(num) {
|
|
|
this.line.requestUrl =
|
|
|
- "/api/v1/rms/getAllLineDesk?apiId=249&lineType=3" +
|
|
|
- "&t=" +
|
|
|
+ '/api/v1/rms/getAllLineDesk?apiId=249&lineType=3' +
|
|
|
+ '&t=' +
|
|
|
new Date() +
|
|
|
- "&con=" +
|
|
|
- this.inputLine;
|
|
|
- this.drawer = true;
|
|
|
- this.a = num;
|
|
|
+ '&con=' +
|
|
|
+ this.inputLine
|
|
|
+ this.drawer = true
|
|
|
+ this.a = num
|
|
|
},
|
|
|
// 返回
|
|
|
onClickCancel() {
|
|
|
- this.$router.push("/oldSporadicAppoint");
|
|
|
+ this.$router.push('/oldSporadicAppoint')
|
|
|
},
|
|
|
currentRadioChange5(selection) {
|
|
|
if (selection.lineName == null && selection.lineDesk == null) {
|
|
|
- this.lineName = "";
|
|
|
+ this.lineName = ''
|
|
|
} else {
|
|
|
- this.lineName = selection.lineName + " " + selection.lineDesk;
|
|
|
- this.lineId = selection.lineId;
|
|
|
+ this.lineName = selection.lineName + ' ' + selection.lineDesk
|
|
|
+ this.lineId = selection.lineId
|
|
|
}
|
|
|
},
|
|
|
// 确认
|
|
|
makeSure() {
|
|
|
if (this.isMoreTrips == false) {
|
|
|
- this.materialTimes = 1;
|
|
|
+ this.materialTimes = 1
|
|
|
}
|
|
|
if (Number(this.materialTimes) != 0) {
|
|
|
- this.isMoreTrips = true;
|
|
|
+ this.isMoreTrips = true
|
|
|
}
|
|
|
- this.disabled = true;
|
|
|
+ this.disabled = true
|
|
|
if (
|
|
|
this.supplierId == null ||
|
|
|
this.lineId == null ||
|
|
|
this.consigneeId == null ||
|
|
|
this.carrierId == null
|
|
|
) {
|
|
|
- this.disabled = false;
|
|
|
- this.$message.warning("存在值未填写");
|
|
|
- return;
|
|
|
+ this.disabled = false
|
|
|
+ this.$message.warning('存在值未填写')
|
|
|
+ return
|
|
|
} else if (this.tableData.length == 0) {
|
|
|
- this.disabled = false;
|
|
|
- this.$message.warning("请点击浏览勾选物资");
|
|
|
- return;
|
|
|
+ this.disabled = false
|
|
|
+ this.$message.warning('请点击浏览勾选物资')
|
|
|
+ return
|
|
|
}
|
|
|
- var i = 0;
|
|
|
- var j = 0;
|
|
|
+ var i = 0
|
|
|
+ var j = 0
|
|
|
this.tableData.forEach(e => {
|
|
|
if (e.materialPriority == null) {
|
|
|
- i++;
|
|
|
+ i++
|
|
|
} else if (e.orderMaterialWeight == null) {
|
|
|
- j++;
|
|
|
+ j++
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
if (i != 0) {
|
|
|
- this.$message.warning("装卸货优先级未填写");
|
|
|
- this.disabled = false;
|
|
|
- return;
|
|
|
+ this.$message.warning('装卸货优先级未填写')
|
|
|
+ this.disabled = false
|
|
|
+ return
|
|
|
} else if (j != 0) {
|
|
|
- this.$message.warning("物资重量未填写");
|
|
|
- this.disabled = false;
|
|
|
- return;
|
|
|
+ this.$message.warning('物资重量未填写')
|
|
|
+ this.disabled = false
|
|
|
+ return
|
|
|
}
|
|
|
let amsOrder = {
|
|
|
supplierId: this.supplierId,
|
|
@@ -668,24 +670,24 @@ export default {
|
|
|
carrierId: this.carrierId,
|
|
|
orderType: this.orderType,
|
|
|
receiveId: this.consigneeId,
|
|
|
- userId: getCookie("orgCode"),
|
|
|
+ userId: getCookie('orgCode'),
|
|
|
orderTime: this.materialTimes,
|
|
|
mapList: this.tableData,
|
|
|
isMoreTrips: Number(this.isMoreTrips)
|
|
|
- };
|
|
|
- console.log(amsOrder);
|
|
|
- debugger;
|
|
|
- this.axios.post("/api/v1/ams/addSporadicOrders", amsOrder).then(res => {
|
|
|
- if (res.data.code == "200") {
|
|
|
- this.onClickCancel();
|
|
|
- this.disabled = false;
|
|
|
+ }
|
|
|
+ console.log(amsOrder)
|
|
|
+ debugger
|
|
|
+ this.axios.post('/api/v1/ams/addSporadicOrders', amsOrder).then(res => {
|
|
|
+ if (res.data.code == '200') {
|
|
|
+ this.onClickCancel()
|
|
|
+ this.disabled = false
|
|
|
} else {
|
|
|
- this.disabled = false;
|
|
|
+ this.disabled = false
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.addSporadic {
|