Commit e53f94513801d0f8f19e33f9a338fb48b2034586

Authored by xiaochaoqun
1 parent ba7a93c2

月台管理删除增加锁定校验,月台详情增加锁定与释放功能,修改月台详情状态前先校验释放锁定

ant-design-vue-jeecg/src/api/api.js
... ... @@ -113,8 +113,9 @@ export const searchTimePeriod = (params)=>postAction("/reservationsubmission/res
113 113 export const Platform = (params)=>postAction("/platformmanagement/platformManagement/Platform");
114 114  
115 115 //释放月台
116   -export const Release = (params)=>postAction("/platformmanagement/platformManagement/releasePlatform?id="+params);
117   -
  116 +export const releasePlatform = (params)=>postAction("/platformmanagement/platformManagement/releasePlatform?id="+params);
  117 +//锁定月台
  118 +export const bindPlatform = (params)=>postAction("/platformmanagement/platformManagement/bindPlatform?id="+params);
118 119  
119 120 // 中转HTTP请求
120 121 export const transitRESTful = {
... ...
ant-design-vue-jeecg/src/views/basics/platformmanagement/PlatformDetailsList.vue
... ... @@ -73,15 +73,21 @@
73 73 </template>
74 74  
75 75 <span slot="action" slot-scope="text, record">
76   - <a @click="release(record.id)">释放</a>
77   - <a-divider type="vertical" />
  76 + <div>
  77 + <a-popconfirm title="确定释放该月台吗?" @confirm="() => releaseClick(record.id)" v-if="record.state=='lock' || record.state=='reserve'">
  78 + <a>释放</a>
  79 + </a-popconfirm>
  80 + <a-popconfirm title="确定绑定该月台吗?" @confirm="() => bindClcik(record.id)" v-if="record.state=='empty' ">
  81 + <a>绑定</a>
  82 + </a-popconfirm>
  83 + <a-divider type="vertical" />
  84 + <a @click="handleEdit(record)">编辑</a>
  85 + <a-divider type="vertical" />
  86 + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  87 + <a>删除</a>
  88 + </a-popconfirm>
  89 + </div>
78 90  
79   - <a @click="handleEdit(record)">编辑</a>
80   - <a-divider type="vertical" />
81   -
82   - <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
83   - <a>删除</a>
84   - </a-popconfirm>
85 91 </span>
86 92  
87 93 </a-table>
... ... @@ -95,7 +101,7 @@
95 101  
96 102 import { JeecgListMixin } from '@/mixins/JeecgListMixin'
97 103 import PlatformDetailsModal from './modules/PlatformDetailsModal'
98   - import {Release} from "../../../api/api";
  104 + import { releasePlatform, bindPlatform } from '../../../api/api'
99 105  
100 106  
101 107 function routeReload() {
... ... @@ -146,11 +152,11 @@
146 152 return parseInt(index)+1;
147 153 }
148 154 },
149   - // {
150   - // title:'编码',
151   - // align:"center",
152   - // dataIndex: 'code'
153   - // },
  155 + {
  156 + title:'编码',
  157 + align:"center",
  158 + dataIndex: 'code'
  159 + },
154 160 {
155 161 title:'名称',
156 162 align:"center",
... ... @@ -216,22 +222,31 @@
216 222 this.selectedRowKeys=[]
217 223 this.ipagination.current = 1
218 224 },
219   - release(id) {
220   - Release(id).then((res) => {
  225 + releaseClick(id) {
  226 + releasePlatform(id).then((res) => {
221 227 if (res.success) {
222   - alert("释放成功");
223   - this.loadData(1);
224   -
  228 + this.$message.success(res.message);
  229 + this.searchReset();
225 230 } else {
226   - alert("释放失败");
227   - this.loadData(1);
  231 + this.$message.error(res.message);
  232 + this.searchReset();
  233 + }
  234 + })
  235 + },
  236 + bindClcik(id){
  237 + bindPlatform(id).then((res) => {
  238 + if (res.success) {
  239 + this.$message.success(res.message);
  240 + this.searchReset();
  241 + } else {
  242 + this.$message.error(res.message);
228 243 }
229 244 })
230   -
231 245 },
232 246 getSuperFieldList(){
233 247 let fieldList=[];
234 248 fieldList.push({type:'string',value:'name',text:'名称',dictCode:''})
  249 + fieldList.push({type:'string',value:'code',text:'编码',dictCode:''})
235 250 fieldList.push({type:'string',value:'boxtYpe',text:'箱型',dictCode:''})
236 251 fieldList.push({type:'string',value:'high',text:'高',dictCode:''})
237 252 fieldList.push({type:'string',value:'state',text:'状态',dictCode:'platformstatus'})
... ...
ant-design-vue-jeecg/src/views/basics/platformmanagement/PlatformManagementList.vue
... ... @@ -74,16 +74,10 @@
74 74 <a @click="handleEdit(record)">编辑</a>
75 75  
76 76 <a-divider type="vertical" />
77   - <a-dropdown>
78   - <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
79   - <a-menu slot="overlay">
80   - <a-menu-item>
81   - <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  77 + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
82 78 <a>删除</a>
83 79 </a-popconfirm>
84   - </a-menu-item>
85   - </a-menu>
86   - </a-dropdown>
  80 +
87 81 </span>
88 82  
89 83 </a-table>
... ...
ant-design-vue-jeecg/src/views/basics/platformmanagement/modules/PlatformDetailsModal.vue
... ... @@ -12,6 +12,11 @@
12 12 <a-form-model ref="form" :model="model" :rules="validatorRules">
13 13 <a-row>
14 14 <a-col :span="24">
  15 + <a-form-model-item v-if="model.code==null" label="编码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code">
  16 + <a-input v-model="model.code"placeholder="请输入编码"></a-input>
  17 + </a-form-model-item>
  18 + </a-col>
  19 + <a-col :span="24">
15 20 <a-form-model-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
16 21 <a-input v-model="model.name"placeholder="请输入名称" ></a-input>
17 22 </a-form-model-item>
... ... @@ -27,7 +32,7 @@
27 32 </a-form-model-item>
28 33 </a-col>
29 34 <a-col :span="24">
30   - <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="state">
  35 + <a-form-model-item v-if="model.state== null" label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="state">
31 36 <j-dict-select-tag type="list" v-model="model.state" dictCode="platformstatus" placeholder="请选择状态" />
32 37 </a-form-model-item>
33 38 </a-col>
... ... @@ -71,6 +76,9 @@
71 76  
72 77 confirmLoading: false,
73 78 validatorRules: {
  79 + code: [
  80 + { required: true, message: '请输入编码!'},
  81 + ],
74 82 name: [
75 83 { required: true, message: '请输入名称!'},
76 84 ],
... ...
ant-design-vue-jeecg/src/views/basics/platformmanagement/modules/PlatformManagementModal.vue
... ... @@ -12,6 +12,11 @@
12 12 <a-form-model ref="form" :model="model" :rules="validatorRules">
13 13 <a-row>
14 14 <a-col :span="24">
  15 + <a-form-model-item label="编码" v-if="model.code == null" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code">
  16 + <a-input v-model="model.code" placeholder="请输入编码" ></a-input>
  17 + </a-form-model-item>
  18 + </a-col>
  19 + <a-col :span="24">
15 20 <a-form-model-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
16 21 <a-input v-model="model.name" placeholder="请输入名称" ></a-input>
17 22 </a-form-model-item>
... ... @@ -74,6 +79,9 @@
74 79  
75 80 confirmLoading: false,
76 81 validatorRules: {
  82 + code: [
  83 + { required: true, message: '请输入编码!'},
  84 + ],
77 85 name: [
78 86 { required: true, message: '请输入名称!'},
79 87 ],
... ...