123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <template>
- <!-- 修改请车作业页面 -->
- <div id="contractDetails">
- <page-title>请车作业</page-title>
- <div class="main">
- <span class="text">修改请车作业</span>
- <span class="a"></span>
- </div>
- <div class="contractTitle">
- <div class="form-box">
- <div class="form-one">
- <dil-form :formId="117" v-model="form1"></dil-form>
- </div>
- </div>
- </div>
-
- <div class="button-box">
- <el-button @click="onClickCancel">返回</el-button>
- <el-button type="primary" @click="onClickConfirm">确认</el-button>
- </div>
- </div>
- </template>
- <script>
- import PageTitle from "@/components/Page/Title";
- export default {
- components: { PageTitle },
- data(){
- return {
- form1: {},
- }
- },
- mounted() {
- this.information();
- },
- methods: {
- information() {
- //编辑请车作业
- this.axios
- .post("/api/v1/tms/getWagonPleaseById/" + this.$route.params.resultId)
- .then((res) => {
- res.data.data.forEach((e) => {
- this.form1 = e;
- });
- });
- },
- // 返回
- onClickCancel() {
- this.$router.go(-1);
- },
- // 确认
- onClickConfirm() {
- let tmstrainPleaseApproveResult = {
- resultId: this.$route.params.resultId,
- resultPlanDate: sjTime(this.form1.resultPlanDate),
- resultCategory: this.form1.resultCategory,
- shipperId: this.form1.shipperId,
- sendStationId: this.form1.sendStationId,
- toTheStationId: this.form1.toTheStationId,
- resultPleaseNumber: this.form1.resultPleaseNumber
- };
- 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.shipperId==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" scoped>
- //@import "@/styles/appoint/contract/ContractInsert.scss";
- </style>
|