|
@@ -1,19 +1,24 @@
|
|
<template>
|
|
<template>
|
|
- <!-- 修改门岗信息 -->
|
|
|
|
- <div id="contractDetails">
|
|
|
|
- <page-title>编辑</page-title>
|
|
|
|
- <div class="main">
|
|
|
|
- <span class="text">门岗信息</span>
|
|
|
|
|
|
+ <!-- 门岗规则信息页面 -->
|
|
|
|
+ <div class="homeworkPath">
|
|
|
|
+ <page-title>门岗规则信息</page-title>
|
|
|
|
+ <div class="form box">
|
|
|
|
+ <el-form>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <label class="el-form-item__label" style="width: auto;">门岗名称</label>
|
|
|
|
+ <el-input
|
|
|
|
+ placeholder=""
|
|
|
|
+ v-model="gatepostName"
|
|
|
|
+ :disabled="true">
|
|
|
|
+ </el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="form">
|
|
|
|
+ <dil-form :formId="358" v-model="form"></dil-form>
|
|
</div>
|
|
</div>
|
|
- <div class="contractTitle"> -->
|
|
|
|
- <div class="form-box">
|
|
|
|
- <div class="form-one">
|
|
|
|
- <dil-form :formId="358" v-model="form1"></dil-form>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <!-- 时间点 -->
|
|
|
|
- <div class="form-box f2" >
|
|
|
|
|
|
+ <!-- 时间点 -->
|
|
|
|
+ <div class="form-box f1" >
|
|
门岗开门时间
|
|
门岗开门时间
|
|
<el-time-select
|
|
<el-time-select
|
|
v-model="rulesGatepostStartTime"
|
|
v-model="rulesGatepostStartTime"
|
|
@@ -26,7 +31,7 @@
|
|
>
|
|
>
|
|
</el-time-select>
|
|
</el-time-select>
|
|
</div>
|
|
</div>
|
|
- <div class="form-box f3">
|
|
|
|
|
|
+ <div class="form-box f1">
|
|
门岗关门时间
|
|
门岗关门时间
|
|
<el-time-select
|
|
<el-time-select
|
|
v-model="rulesGatepostEndTime"
|
|
v-model="rulesGatepostEndTime"
|
|
@@ -40,25 +45,17 @@
|
|
</div>
|
|
</div>
|
|
<!-- 原料模态窗口显示 -->
|
|
<!-- 原料模态窗口显示 -->
|
|
<div class="form-box f1">
|
|
<div class="form-box f1">
|
|
- <el-form :inline="true" :model="formInline" class="demo-form-inline">
|
|
|
|
- <el-form-item label="物资名称">
|
|
|
|
- <el-input v-model="materialTypeName" disabled>
|
|
|
|
- </el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <el-form :inline="true" class="demo-form-inline">
|
|
|
|
+
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-button type="primary" @click="drawer = true">增加物资种类</el-button>
|
|
|
|
|
|
+ <el-button type="primary" @click="drawer = true">增加物资</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
- <div>
|
|
|
|
- <div class="form-box" style="margin-left: 5rem">
|
|
|
|
- <el-button type="primary" @click="makeSure">新增规则</el-button>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
<el-drawer
|
|
<el-drawer
|
|
:visible.sync="drawer"
|
|
:visible.sync="drawer"
|
|
:direction="direction"
|
|
:direction="direction"
|
|
- :before-close="handleClose">
|
|
|
|
|
|
+ >
|
|
<el-input
|
|
<el-input
|
|
placeholder="请输入内容"
|
|
placeholder="请输入内容"
|
|
v-model="inputText"
|
|
v-model="inputText"
|
|
@@ -67,19 +64,20 @@
|
|
<el-button type="primary" class="btn" @click="onclick">
|
|
<el-button type="primary" class="btn" @click="onclick">
|
|
<i class="el-icon-search"></i>查询
|
|
<i class="el-icon-search"></i>查询
|
|
</el-button>
|
|
</el-button>
|
|
- <div><dilTable v-bind.sync="options2" @radio-change="currentRadioChange" ></dilTable></div>
|
|
|
|
- <div class="button-box">
|
|
|
|
- <el-button type="primary" @click="makeSure">确定</el-button>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div><dilTable v-bind.sync="options2" @selection-change="currentRadioChange" ></dilTable></div>
|
|
</el-drawer>
|
|
</el-drawer>
|
|
- <!-- 规则展示窗口 -->
|
|
|
|
- <dilTable v-bind.sync="options1">
|
|
|
|
- <el-table-column fixed="right" label="操作" align="center" width="200">
|
|
|
|
|
|
+ <div class="btn2">
|
|
|
|
+ <el-button type="primary" @click="makeSure">新增规则</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <dilTable v-bind.sync="option">
|
|
|
|
+ <el-table-column fixed="right" label="操作" align="center" width="150">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
<el-button
|
|
type="text"
|
|
type="text"
|
|
size="mini"
|
|
size="mini"
|
|
- @click="deleteclick(scope)">删除</el-button>
|
|
|
|
|
|
+ @click="deleteclick(scope)"
|
|
|
|
+ >删除</el-button
|
|
|
|
+ >
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</dilTable>
|
|
</dilTable>
|
|
@@ -88,234 +86,171 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import PageTitle from "@/components/Page/Title";
|
|
import PageTitle from "@/components/Page/Title";
|
|
-//import { sjTime } from "@/js/sharedJsFile";
|
|
|
|
|
|
+
|
|
export default {
|
|
export default {
|
|
components: { PageTitle },
|
|
components: { PageTitle },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- form1: {},
|
|
|
|
- value: undefined,
|
|
|
|
- drawer: false,
|
|
|
|
- direction: 'rtl',
|
|
|
|
- materialName:"",
|
|
|
|
- gatepostRules:"",
|
|
|
|
|
|
+ drawer:false,
|
|
|
|
+ form: {},
|
|
rulesGatepostStartTime:"",
|
|
rulesGatepostStartTime:"",
|
|
rulesGatepostEndTime:"",
|
|
rulesGatepostEndTime:"",
|
|
|
|
+ rulesGatepostEntityOutTypeList:{},
|
|
|
|
+ materialNameList:{},
|
|
|
|
+ direction: 'rtl',
|
|
inputText:"",
|
|
inputText:"",
|
|
- options1:{
|
|
|
|
- // first请求数据的地址
|
|
|
|
- requestUrl: "/api/v1/rms/getGatepostRulesById/"+this.$route.params.gatepostId+"?apiId=349",
|
|
|
|
- selectionType: "radiio",
|
|
|
|
- materialList:[]
|
|
|
|
|
|
+ gatepostName:"",
|
|
|
|
+ option: {
|
|
|
|
+ // 表格请求数据的地址
|
|
|
|
+ requestUrl:
|
|
|
|
+ "/api/v1/rms/getGatepostRulesById/"+this.$route.params.gatepostId+"?apiId=349",
|
|
},
|
|
},
|
|
options2:{
|
|
options2:{
|
|
|
|
+ // 获取原料
|
|
requestUrl: "/api/v1/rms/getMaterialList?apiId=351",
|
|
requestUrl: "/api/v1/rms/getMaterialList?apiId=351",
|
|
selectionType:"select",
|
|
selectionType:"select",
|
|
- mapList:[]
|
|
|
|
- },
|
|
|
|
- form1: {},
|
|
|
|
|
|
+ materialList:[]
|
|
|
|
+ }
|
|
};
|
|
};
|
|
},
|
|
},
|
|
-
|
|
|
|
mounted() {
|
|
mounted() {
|
|
- console.log(this.$route)
|
|
|
|
|
|
+ console.log(this.$route)
|
|
this.information();
|
|
this.information();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- deleteclick(scope){
|
|
|
|
- this.$confirm("是否删除", "提示", {
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
- type: "warning",
|
|
|
|
- center: true,
|
|
|
|
- })
|
|
|
|
- .then(() => {
|
|
|
|
- this.axios
|
|
|
|
- .post("/api/v1/rms/deleteGatepostRules/" + scope.row.rulesId)
|
|
|
|
- .then((res) => {
|
|
|
|
- if (res.data.code == 200) {
|
|
|
|
- this.$message({
|
|
|
|
- type: "success",
|
|
|
|
- message: "删除成功!",
|
|
|
|
- });
|
|
|
|
- this.$router.go(0);
|
|
|
|
- } else {
|
|
|
|
- this.$message({
|
|
|
|
- message: "删除失败",
|
|
|
|
- type: "warning",
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- })
|
|
|
|
- .catch(() => {
|
|
|
|
- this.$message({
|
|
|
|
- type: "info",
|
|
|
|
- message: "删除操作已取消!",
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- addRules(){
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
currentRadioChange(selection){
|
|
currentRadioChange(selection){
|
|
- this.mapList=selection,
|
|
|
|
- console.log(this.mapList)
|
|
|
|
- this.materialName=this.mapList.materialName
|
|
|
|
- },
|
|
|
|
- makeSure() {
|
|
|
|
- console.log(this.form1)
|
|
|
|
- let gatepost={
|
|
|
|
- rulesId:this.form1.rulesId,
|
|
|
|
- gatepostName:this.form1.gatepostName,
|
|
|
|
- gatepostLongitude:this.form1.gatepostLongitude,
|
|
|
|
- gatepostLatitude:this.form1.gatepostLatitude,
|
|
|
|
- gatepostPriority:this.form1.gatepostPriority,
|
|
|
|
- rulesGatepostStartTime:this.rulesGatepostStartTime,
|
|
|
|
- rulesGatepostEndTime:this.rulesGatepostEndTime,
|
|
|
|
- vehicleTypeId:this.form1.vehicleTypeId
|
|
|
|
- }
|
|
|
|
- let entityOutTypeLists={
|
|
|
|
- rulesGatepostEntityOutType:this.form1.rulesGatepostEntityOutTypeStr
|
|
|
|
- }
|
|
|
|
- let material={
|
|
|
|
- materialId:this.materialList.materialId,
|
|
|
|
- materialName:this.materialList.materialName
|
|
|
|
- }
|
|
|
|
- let mapValue={
|
|
|
|
- gatepost:gatepost,
|
|
|
|
- entityOutTypeLists:entityOutTypeLists,
|
|
|
|
- material:this.materialList
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- onclick(){
|
|
|
|
- this.options2.requestUrl =
|
|
|
|
- "/api/v1/rms/getMaterialList?apiId=349&con=" +this.inputText;
|
|
|
|
|
|
+ this.materialNameList=selection
|
|
|
|
+ console.log("materialNameList",this.materialNameList);
|
|
|
|
+ // materialName=this.materialNameList.materialName
|
|
},
|
|
},
|
|
- information() {
|
|
|
|
|
|
+ // 触发事件,渲染页面
|
|
|
|
+ information(){
|
|
//编辑
|
|
//编辑
|
|
this.axios
|
|
this.axios
|
|
.post(
|
|
.post(
|
|
- "/api/v1/rms/getGatepostById/" +
|
|
|
|
- this.$route.params.rulesId
|
|
|
|
|
|
+ "/api/v1/rms/getGatepostName/" +
|
|
|
|
+ this.$route.params.gatepostId
|
|
)
|
|
)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- console.log("res111111111111",res)
|
|
|
|
- res.data.data.forEach((e) => {
|
|
|
|
- this.form1 = e;
|
|
|
|
- });
|
|
|
|
|
|
+ this.gatepostName=res.data.data.gatepostName
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- // 返回
|
|
|
|
- onClickCancel() {
|
|
|
|
- this.$router.go(-1);
|
|
|
|
|
|
+ onclick(){
|
|
|
|
+ this.option2.requestUrl="/api/v1/rms/getMaterialList?apiId=351&con=" +this.inputText;
|
|
},
|
|
},
|
|
- // 确认
|
|
|
|
- onClickConfirm() {
|
|
|
|
- console.log(this.form1)
|
|
|
|
- let gatepost={
|
|
|
|
- gatepostName:this.form1.gatepostName,
|
|
|
|
- gatepostLongitude:this.form1.gatepostLongitude,
|
|
|
|
- gatepostLatitude:this.form1.gatepostLatitude,
|
|
|
|
- gatepostPriority:this.form1.gatepostPriority,
|
|
|
|
- rulesGatepostStartTime:this.rulesGatepostStartTime,
|
|
|
|
- rulesGatepostEndTime:this.rulesGatepostEndTime,
|
|
|
|
- vehicleTypeId:this.form1.vehicleTypeId,
|
|
|
|
- rulesId:this.form1.rulesId
|
|
|
|
- }
|
|
|
|
- let entityOutTypeLists={
|
|
|
|
- rulesGatepostEntityOutType:this.form1.rulesGatepostEntityOutType
|
|
|
|
- }
|
|
|
|
- let material={
|
|
|
|
- materialId:this.materialList.materialId
|
|
|
|
- }
|
|
|
|
|
|
+ // 新增
|
|
|
|
+ makeSure() {
|
|
|
|
+ let rmsGatepostRules = {
|
|
|
|
+ gatepostId:this.$route.params.gatepostId,
|
|
|
|
+ rulesGatepostStartTime:this.rulesGatepostStartTime,
|
|
|
|
+ rulesGatepostEndTime:this.rulesGatepostEndTime,
|
|
|
|
+ vehicleTypeId:this.form.vehicleTypeId,
|
|
|
|
+ };
|
|
|
|
+ var materialIds=[];
|
|
|
|
+ this.materialNameList.forEach((item,index) => {
|
|
|
|
+ var materialId=item.materialId;
|
|
|
|
+ materialIds.push(materialId);
|
|
|
|
+ });
|
|
|
|
+ let rulesGatepostEntityOutTypeList={
|
|
|
|
+ rulesGatepostEntityOutTypeStr:this.form.rulesGatepostEntityOutTypeStr
|
|
|
|
+ }
|
|
|
|
+ // = this.materialNameList;
|
|
|
|
+ // console.log("materialIds",materialIds);
|
|
let mapValue={
|
|
let mapValue={
|
|
- gatepost:gatepost,
|
|
|
|
- entityOutTypeLists:entityOutTypeLists,
|
|
|
|
- material:this.materialList
|
|
|
|
- }
|
|
|
|
- this.axios
|
|
|
|
|
|
+ rmsGatepostRules:rmsGatepostRules,
|
|
|
|
+ materialIds:materialIds,
|
|
|
|
+ rulesGatepostEntityOutTypeList:rulesGatepostEntityOutTypeList
|
|
|
|
+ }
|
|
|
|
+ if (
|
|
|
|
+ rmsGatepostRules.rulesGatepostStartTime == null ||
|
|
|
|
+ rmsGatepostRules.rulesGatepostEndTime == null ||
|
|
|
|
+ rmsGatepostRules.vehicleTypeId == null ||
|
|
|
|
+ rulesGatepostEntityOutTypeList.rulesGatepostEntityOutTypeStr == null ||
|
|
|
|
+ materialIds[0] == null
|
|
|
|
+ )
|
|
|
|
+ this.$message.error("存在空值!");
|
|
|
|
+
|
|
|
|
+ else
|
|
|
|
+ this.axios
|
|
.post(
|
|
.post(
|
|
- "/api/v1/rms/updateGatepost",
|
|
|
|
|
|
+ "/api/v1/rms/insertGatepostRule",
|
|
mapValue
|
|
mapValue
|
|
)
|
|
)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- if (res.data.code == "200") {
|
|
|
|
- this.$router.go(-1);
|
|
|
|
- }
|
|
|
|
|
|
+ if (res.data.code == 200) {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "success",
|
|
|
|
+ message: "新增成功!",
|
|
|
|
+ });
|
|
|
|
+ // this.$refs.table.refreshData();
|
|
|
|
+ this.$router.go(0);
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error("新增失败!");
|
|
|
|
+ }
|
|
|
|
+ this.$refs["table"].resetField();
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ deleteclick(scope) {
|
|
|
|
+ this.$confirm("是否删除", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ center: true,
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.axios
|
|
|
|
+ .post("/api/v1/rms/deleteGatepostRules/"+scope.row.rulesId)
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "success",
|
|
|
|
+ message: "删除成功!",
|
|
|
|
+ });
|
|
|
|
+ this.$router.go(0);
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "info",
|
|
|
|
+ message: "取消删除!",
|
|
|
|
+ });
|
|
});
|
|
});
|
|
- },
|
|
|
|
- // 取消
|
|
|
|
- cancel() {
|
|
|
|
- this.$router.go(-1);
|
|
|
|
},
|
|
},
|
|
- handleClose(done) {
|
|
|
|
- done();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
-<style lang="scss" scoped>
|
|
|
|
-
|
|
|
|
-</style>
|
|
|
|
-<style lang='scss' scoped>
|
|
|
|
|
|
+<style lang='scss'>
|
|
|
|
+.homeworkPath {
|
|
|
|
+ .shipName{
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ margin-top: 1.25rem;
|
|
|
|
+ .text{
|
|
|
|
+ width: 6.25rem;
|
|
|
|
+ text-align: right;
|
|
|
|
+ padding-right: 0.9375rem;
|
|
|
|
+ font-size: 0.9375rem;
|
|
|
|
+ font-weight: 600;
|
|
|
|
+ color: #606266;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .form {
|
|
|
|
+ margin-top: 1.25rem;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ }
|
|
|
|
+}
|
|
.form-box {
|
|
.form-box {
|
|
padding: 20px 30px;
|
|
padding: 20px 30px;
|
|
margin-left: 330px;
|
|
margin-left: 330px;
|
|
}
|
|
}
|
|
-.button-box {
|
|
|
|
- padding: 20px 30px;
|
|
|
|
- margin-left: 460px;
|
|
|
|
-}
|
|
|
|
-.btn-left {
|
|
|
|
- margin-left: 470px;
|
|
|
|
-}
|
|
|
|
-.input {
|
|
|
|
- margin-left: 90px;
|
|
|
|
-}
|
|
|
|
-.label{
|
|
|
|
- margin-left: 445px;
|
|
|
|
- margin-bottom: -30px;
|
|
|
|
- font: bold;
|
|
|
|
- font-size: 1rem;
|
|
|
|
- padding-left: -30px;
|
|
|
|
- font-family:Arial, Helvetica, sans-serif;
|
|
|
|
- margin-bottom:20px;
|
|
|
|
-}
|
|
|
|
-.label2{
|
|
|
|
- margin-left: 425px;
|
|
|
|
- margin-bottom: -30px;
|
|
|
|
- font: bold;
|
|
|
|
- font-size: 1rem;
|
|
|
|
- font-family:Arial, Helvetica, sans-serif
|
|
|
|
-}
|
|
|
|
-.label1{
|
|
|
|
- margin-left: 345px;
|
|
|
|
- margin-bottom: -30px;
|
|
|
|
- font: bold;
|
|
|
|
-}
|
|
|
|
-.common{
|
|
|
|
- font-weight: 700;
|
|
|
|
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
|
|
|
|
- Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
|
|
|
|
- font-size: 1rem;
|
|
|
|
- cursor: default;
|
|
|
|
- color: #2c3e50;
|
|
|
|
-}
|
|
|
|
.f1{
|
|
.f1{
|
|
margin-top: -2.5rem;
|
|
margin-top: -2.5rem;
|
|
- margin-left: 17.5rem;
|
|
|
|
|
|
+ margin-left: 40rem;
|
|
}
|
|
}
|
|
-.f11{
|
|
|
|
- margin-top: -3rem;
|
|
|
|
-
|
|
|
|
- // margin-left: 29rem;
|
|
|
|
-}
|
|
|
|
-.f2{
|
|
|
|
- margin-top: -2.5rem;
|
|
|
|
- margin-left: 20.0rem;
|
|
|
|
-}
|
|
|
|
-.f3{
|
|
|
|
- margin-top: -2.5rem;
|
|
|
|
- margin-left: 20.0rem;
|
|
|
|
|
|
+.btn2{
|
|
|
|
+ margin-top: 2.5rem;
|
|
|
|
+ margin-left: 40rem;
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+</style>
|