|
@@ -1,67 +1,27 @@
|
|
|
<template>
|
|
|
+ <!-- 新增请作业页面 -->
|
|
|
<div class="contractDetails">
|
|
|
<page-title>返回</page-title>
|
|
|
-
|
|
|
- <div class="form">
|
|
|
- <div class="form_box">
|
|
|
- <dil-form :formId="117" v-model="form1"></dil-form>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="fromOther">
|
|
|
- <el-form :inline="true" class="demo-form-inline" label-width="80px">
|
|
|
- <el-form-item label="发货单位">
|
|
|
- <el-autocomplete
|
|
|
- class="inline-input"
|
|
|
- v-model="stateSupplier"
|
|
|
- :fetch-suggestions="querySearchSupplier"
|
|
|
- placeholder="请输入发货单位名称"
|
|
|
- :trigger-on-focus="false"
|
|
|
- @select="handleSelectSupplier"
|
|
|
- >
|
|
|
- <template slot-scope="{ item }">
|
|
|
- <div class="name">{{ item.supplierName }}</div>
|
|
|
- </template>
|
|
|
- </el-autocomplete>
|
|
|
+ <div>
|
|
|
+ <el-form label-width="80px" style="margin-left:35%;">
|
|
|
+ <el-form-item label="批复车数">
|
|
|
+ <el-input v-model="form.resultApproveNumber" type="number" style="width:240px"></el-input>
|
|
|
</el-form-item>
|
|
|
- </el-form>
|
|
|
- <el-form :inline="true" class="demo-form-inline" label-width="80px" >
|
|
|
- <el-form-item label="发站:">
|
|
|
- <el-autocomplete
|
|
|
- class="inline-input"
|
|
|
- v-model="sendStation"
|
|
|
- :fetch-suggestions="querySearchSendStation"
|
|
|
- placeholder="请输入发站名称"
|
|
|
- :trigger-on-focus="false"
|
|
|
- @select="handleSelectSendStation"
|
|
|
- >
|
|
|
- <template slot-scope="{ item }">
|
|
|
- <div class="name">{{ item.arrivalName }}</div>
|
|
|
- </template>
|
|
|
- </el-autocomplete>
|
|
|
+ <el-form-item label="落空车数">
|
|
|
+ <el-input v-model="form.resultVoidNumber" type="number" style="width:240px"></el-input>
|
|
|
</el-form-item>
|
|
|
- </el-form>
|
|
|
- <el-form :inline="true" class="demo-form-inline" label-width="80px" >
|
|
|
- <el-form-item label="到站:">
|
|
|
- <el-autocomplete
|
|
|
- class="inline-input"
|
|
|
- v-model="toTheStation"
|
|
|
- :fetch-suggestions="querySearchToTheStation"
|
|
|
- placeholder="请输入到站名称"
|
|
|
- :trigger-on-focus="false"
|
|
|
- @select="handleSelectToTheStation"
|
|
|
- >
|
|
|
- <template slot-scope="{ item }">
|
|
|
- <div class="name">{{ item.arrivalName }}</div>
|
|
|
- </template>
|
|
|
- </el-autocomplete>
|
|
|
+ <el-form-item label="实装车数">
|
|
|
+ <el-input v-model="form.resultRealNumber" type="number" style="width:240px"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="日期">
|
|
|
+ <el-date-picker v-model="form.resultDate" type="datetime" placeholder="日期" @change="getRealNumber"></el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 确定和取消 -->
|
|
|
- <div class="button_box">
|
|
|
- <el-button @click="onClickCancel">返回</el-button>
|
|
|
- <el-button type="primary" @click="onClickConfirm">确认</el-button>
|
|
|
+ <!-- 确定和取消 -->
|
|
|
+ <div style="margin-left:40%">
|
|
|
+ <el-button @click="cancel">返回</el-button>
|
|
|
+ <el-button type="primary" @click="makeSure">确认</el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -69,18 +29,12 @@
|
|
|
<script>
|
|
|
import PageTitle from "@/components/Page/Title";
|
|
|
import { sjTime } from "@/utils/sharedJsFile";
|
|
|
+import { getCookie } from "@/utils/util.js";
|
|
|
export default {
|
|
|
components: { PageTitle },
|
|
|
data() {
|
|
|
return {
|
|
|
- form1: {},
|
|
|
- supplierId: null,
|
|
|
- supplierName: "",
|
|
|
- stateSupplier: "",
|
|
|
- sendStationId:null,
|
|
|
- toTheStationId:null,
|
|
|
- sendStation:"",
|
|
|
- toTheStation:""
|
|
|
+ form:null,
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -90,204 +44,50 @@ export default {
|
|
|
information() {
|
|
|
//编辑请车作业
|
|
|
this.axios
|
|
|
- .post("/api/v1/tms/getWagonPleaseById/" + this.$route.params.resultId)
|
|
|
+ .post("/api/v1/tms/getPleaseResult/" + this.$route.params.resultId)
|
|
|
.then((res) => {
|
|
|
- res.data.data.forEach((e) => {
|
|
|
- this.form1 = e;
|
|
|
- console.log(e)
|
|
|
- this.toTheStationId = e.toTheStationId
|
|
|
- this.sendStationId = e.sendStationId
|
|
|
- this.sendStation = e.sendName
|
|
|
- this.toTheStation = e.arrivalName
|
|
|
- });
|
|
|
-
|
|
|
- this.stateSupplier = res.data.data[0].supplierName;
|
|
|
- this.supplierId = res.data.data[0].supplierId;
|
|
|
+ this.form=res.data.data;
|
|
|
});
|
|
|
},
|
|
|
- // 返回
|
|
|
- onClickCancel() {
|
|
|
+ cancel() {
|
|
|
this.$router.go(-1);
|
|
|
},
|
|
|
- //发货单位弹出层
|
|
|
- handleSelectSupplier(item){
|
|
|
- this.supplierId = item.supplierId
|
|
|
- item.supplierName = this.supplierName
|
|
|
- },
|
|
|
- //以下是发货单位边输边查搜索
|
|
|
- querySearchSupplier(queryString, cb) {
|
|
|
- this.axios.post('/api/v1/uc/getSupplierMesByLike?index='+this.stateSupplier).then((res)=>{
|
|
|
- if(res.data.code == "200"){
|
|
|
- var restaurantsSupplier = res.data.data
|
|
|
- var results = queryString ? restaurantsSupplier.filter(this.createFilterSupplier(queryString)) :restaurantsSupplier;
|
|
|
- // 调用 callback 返回建议列表的数据
|
|
|
- cb(results);
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- createFilterSupplier(queryString) {
|
|
|
- return (restaurantsSupplier) => {
|
|
|
- return (restaurantsSupplier.value.toLowerCase().indexOf(queryString.toLowerCase()) > -1);
|
|
|
- };
|
|
|
- },
|
|
|
- //发站弹出层
|
|
|
- handleSelectSendStation(item) {
|
|
|
- this.sendStationId = item.arrivalId;
|
|
|
- this.sendStation = item.arrivalName;
|
|
|
- },
|
|
|
- //以下是发站边输边查搜索
|
|
|
- querySearchSendStation(queryString, cb) {
|
|
|
- this.axios
|
|
|
- .get("/api/v1/uc/getArrivalByLike?index=" + this.sendStation)
|
|
|
- .then((res) => {
|
|
|
- if (res.data.code == "200") {
|
|
|
- var restaurantsSupplier = res.data.data;
|
|
|
- console.log(restaurantsSupplier)
|
|
|
- var results = queryString
|
|
|
- ? restaurantsSupplier.filter(
|
|
|
- this.createFilterSendStation(queryString)
|
|
|
- )
|
|
|
- : restaurantsSupplier;
|
|
|
- // 调用 callback 返回建议列表的数据
|
|
|
- cb(results);
|
|
|
- }
|
|
|
+ makeSure() {
|
|
|
+ if(!this.form.resultDate ||
|
|
|
+ !this.form.resultApproveNumber||
|
|
|
+ !this.form.resultVoidNumber||
|
|
|
+ !this.form.resultRealNumber){
|
|
|
+ this.$message.warning("存在空值!");
|
|
|
+ return;
|
|
|
+ }else if(this.form.resultVoidNumber-this.form.resultApproveNumber>0){
|
|
|
+ this.$message.warning("落空车数不能超过批复车数!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.form.resultDate= sjTime(this.form.resultDate);
|
|
|
+ this.form.resultSurplusNumber=this.form.resultApproveNumber-this.form.resultVoidNumber;
|
|
|
+ this.form.userId= getCookie("userId");
|
|
|
+ this.axios.post("/api/v1/tms/editPleaseResult", this.form).then(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "修改成功!",
|
|
|
+ });
|
|
|
+ this.$router.go(-1);
|
|
|
});
|
|
|
},
|
|
|
- //发站
|
|
|
- createFilterSendStation(queryString) {
|
|
|
- return (restaurantsSupplier) => {
|
|
|
- return (
|
|
|
- restaurantsSupplier.arrivalName
|
|
|
- .toLowerCase()
|
|
|
- .indexOf(queryString.toLowerCase()) > -1
|
|
|
- );
|
|
|
- };
|
|
|
- },
|
|
|
- //到站弹出层
|
|
|
- handleSelectToTheStation(item) {
|
|
|
- this.toTheStationId = item.arrivalId;
|
|
|
- this.toTheStation = item.arrivalName;
|
|
|
- },
|
|
|
- //以下是到站边输边查搜索
|
|
|
- querySearchToTheStation(queryString, cb) {
|
|
|
- this.axios
|
|
|
- .get("/api/v1/uc/getArrivalByLike?index=" + this.toTheStation)
|
|
|
- .then((res) => {
|
|
|
- if (res.data.code == "200") {
|
|
|
- var restaurantsSupplier = res.data.data;
|
|
|
- console.log(restaurantsSupplier)
|
|
|
- var results = queryString
|
|
|
- ? restaurantsSupplier.filter(
|
|
|
- this.createFilterToTheStation(queryString)
|
|
|
- )
|
|
|
- : restaurantsSupplier;
|
|
|
- // 调用 callback 返回建议列表的数据
|
|
|
- cb(results);
|
|
|
- }
|
|
|
+ //获取当天车皮数量
|
|
|
+ getRealNumber(){
|
|
|
+ if(this.form.resultDate){
|
|
|
+ this.form.resultDate=sjTime(this.form.resultDate);
|
|
|
+ this.axios.post("/api/v1/tms/getRealNumber",this.form).then((res)=>{
|
|
|
+ console.log("res",res);
|
|
|
+ this.form.resultRealNumber=res.data.data;
|
|
|
+ console.log("form",this.form);
|
|
|
});
|
|
|
- },
|
|
|
- //到站
|
|
|
- createFilterToTheStation(queryString) {
|
|
|
- return (restaurantsSupplier) => {
|
|
|
- return (
|
|
|
- restaurantsSupplier.arrivalName
|
|
|
- .toLowerCase()
|
|
|
- .indexOf(queryString.toLowerCase()) > -1
|
|
|
- );
|
|
|
- };
|
|
|
- },
|
|
|
-
|
|
|
- // 确认
|
|
|
- onClickConfirm() {
|
|
|
- let tmstrainPleaseApproveResult = {
|
|
|
- resultId: this.$route.params.resultId,
|
|
|
- resultPlanDate: sjTime(this.form1.resultPlanDate),
|
|
|
- resultCategory: this.form1.resultCategory,
|
|
|
- supplierId: this.supplierId,
|
|
|
- sendStationId: this.sendStationId,
|
|
|
- toTheStationId: this.toTheStationId,
|
|
|
- resultPleaseNumber: this.form1.resultPleaseNumber,
|
|
|
- };
|
|
|
- console.log(tmstrainPleaseApproveResult)
|
|
|
- function isNumber() {
|
|
|
- var value = tmstrainPleaseApproveResult.resultPleaseNumber;
|
|
|
- //验证是否为数字
|
|
|
- var patrn = /^(-)?\d+(\.\d+)?$/;
|
|
|
- if (patrn.exec(value) == null || value == "") {
|
|
|
- return false;
|
|
|
- } else {
|
|
|
- return true;
|
|
|
- }
|
|
|
}
|
|
|
- var val = this.value;
|
|
|
- if (
|
|
|
- tmstrainPleaseApproveResult.resultPlanDate == null ||
|
|
|
- tmstrainPleaseApproveResult.resultCategory == null ||
|
|
|
- tmstrainPleaseApproveResult.supplierId == null ||
|
|
|
- tmstrainPleaseApproveResult.sendStationId == null ||
|
|
|
- tmstrainPleaseApproveResult.toTheStationId == null ||
|
|
|
- tmstrainPleaseApproveResult.resultPleaseNumber == null
|
|
|
- )
|
|
|
- this.$message.error("存在空值!");
|
|
|
- else if (!isNumber(val)) this.$message.error("请车数必须是数字!");
|
|
|
- else
|
|
|
- this.axios
|
|
|
- .post(
|
|
|
- "/api/v1/tms/updateApproveWagonPlease",
|
|
|
- tmstrainPleaseApproveResult
|
|
|
- )
|
|
|
- .then(() => {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "修改成功!",
|
|
|
- });
|
|
|
- this.$router.go(-1);
|
|
|
- });
|
|
|
- },
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
-.contractDetails {
|
|
|
- .form {
|
|
|
- display: flex;
|
|
|
- .form_box {
|
|
|
- width: 340px;
|
|
|
- margin-left: 35%;
|
|
|
- margin-top: 30px;
|
|
|
- margin-right: 20px;
|
|
|
- .el-form {
|
|
|
- .preview-group {
|
|
|
- .el-form-item {
|
|
|
- .el-form-item__label {
|
|
|
- display: inline-block;
|
|
|
- width: 70px !important;
|
|
|
- }
|
|
|
- .el-form-item__content {
|
|
|
- .el-select {
|
|
|
- width: 250px;
|
|
|
- }
|
|
|
- .el-input {
|
|
|
- width: 250px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .button_box {
|
|
|
- margin-left: 42%;
|
|
|
- margin-top: 55px;
|
|
|
- }
|
|
|
- .fromOther {
|
|
|
- margin-left: 34.5%;
|
|
|
- width: 50%;
|
|
|
- .el-input__inner{
|
|
|
- width: 250px;
|
|
|
-
|
|
|
- }
|
|
|
-}
|
|
|
-}
|
|
|
|
|
|
</style>
|