作者 王勇

Merge remote-tracking branch 'origin/master'

@@ -39,6 +39,8 @@ @@ -39,6 +39,8 @@
39 </el-table-column> 39 </el-table-column>
40 <el-table-column prop="customsRegCode" label="海关备案代码" min-width="150" > 40 <el-table-column prop="customsRegCode" label="海关备案代码" min-width="150" >
41 </el-table-column> 41 </el-table-column>
  42 + <el-table-column prop="mqcode" label="海关通道编号" min-width="150" >
  43 + </el-table-column>
42 <el-table-column label="操作" min-width="260"> 44 <el-table-column label="操作" min-width="260">
43 <template slot-scope="scope"> 45 <template slot-scope="scope">
44 <el-button type="primary" size="small" @click="handleAdd(scope.$index, scope.row)">新增下级</el-button> 46 <el-button type="primary" size="small" @click="handleAdd(scope.$index, scope.row)">新增下级</el-button>
@@ -55,37 +57,8 @@ @@ -55,37 +57,8 @@
55 </el-pagination> 57 </el-pagination>
56 </el-col> 58 </el-col>
57 59
58 - <!--编辑界面-->  
59 - <el-dialog title="编辑" :visible.sync="editFormVisible" :close-on-click-modal="false">  
60 - <el-form :model="editForm" label-width="80px" :rules="editFormRules" ref="editForm">  
61 - <el-form-item label="ID">  
62 - <span>{{editForm.roleId}}</span>  
63 - </el-form-item>  
64 - <el-form-item label="岗位名称">  
65 - <el-input v-model="editForm.roleName" auto-complete="off" placeholder="请输入岗位/角色名称:例如:ROLE_name"></el-input>  
66 - </el-form-item>  
67 - <el-form-item label="岗位描述">  
68 - <el-input v-model="editForm.description" auto-complete="off" placeholder="请输入岗位/角色描述:例如:用户管理员"></el-input>  
69 - </el-form-item>  
70 - <el-form-item label="部门名称">  
71 - <el-select v-model="editForm.departmentId" placeholder="请选择">  
72 - <el-option  
73 - v-for="item in departmentNameList"  
74 - :key="item.departmentId"  
75 - :label="item.departmentName"  
76 - :value="item.departmentId">  
77 - </el-option>  
78 - </el-select>  
79 - </el-form-item>  
80 - </el-form>  
81 - <div slot="footer" class="dialog-footer">  
82 - <el-button @click.native="editFormVisible = false">取消</el-button>  
83 - <el-button type="primary" @click.native="editSubmit" :loading="editLoading">提交</el-button>  
84 - </div>  
85 - </el-dialog>  
86 -  
87 <!--新增界面--> 60 <!--新增界面-->
88 - <el-dialog title="新增" :visible.sync="addFormVisible" :close-on-click-modal="false"> 61 + <el-dialog :title="dialogMap[dialogStatus]" :visible.sync="addFormVisible" :close-on-click-modal="false">
89 <el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm"> 62 <el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm">
90 <el-form-item label="上级组织机构"> 63 <el-form-item label="上级组织机构">
91 <span>{{addForm.parentName}}</span> 64 <span>{{addForm.parentName}}</span>
@@ -96,7 +69,7 @@ @@ -96,7 +69,7 @@
96 <el-form-item label="组织机构描述" prop="description"> 69 <el-form-item label="组织机构描述" prop="description">
97 <el-input v-model="addForm.description" auto-complete="off" placeholder="组织机构描述:例如:组织机构简介"></el-input> 70 <el-input v-model="addForm.description" auto-complete="off" placeholder="组织机构描述:例如:组织机构简介"></el-input>
98 </el-form-item> 71 </el-form-item>
99 - <el-form-item label="组织机构类型" prop="description"> 72 + <el-form-item label="组织机构类型" prop="type">
100 <el-select 73 <el-select
101 v-model="addForm.type" 74 v-model="addForm.type"
102 filterable 75 filterable
@@ -111,16 +84,19 @@ @@ -111,16 +84,19 @@
111 </el-option> 84 </el-option>
112 </el-select> 85 </el-select>
113 </el-form-item> 86 </el-form-item>
114 - <el-form-item label="工商企业代码" prop="description"> 87 + <el-form-item label="工商企业代码" prop="businessLicense">
115 <el-input v-model="addForm.businessLicense" auto-complete="off" placeholder="社会信用代码或者组织机构代码"></el-input> 88 <el-input v-model="addForm.businessLicense" auto-complete="off" placeholder="社会信用代码或者组织机构代码"></el-input>
116 </el-form-item> 89 </el-form-item>
117 - <el-form-item label="海关备案代码" prop="description"> 90 + <el-form-item label="海关备案代码" prop="customsRegCode">
118 <el-input v-model="addForm.customsRegCode" auto-complete="off" placeholder="海关备案后返回的备案代码"></el-input> 91 <el-input v-model="addForm.customsRegCode" auto-complete="off" placeholder="海关备案后返回的备案代码"></el-input>
119 </el-form-item> 92 </el-form-item>
  93 + <el-form-item label="海关通道编号" prop="mqcode">
  94 + <el-input v-model="addForm.mqcode" auto-complete="off" placeholder="海关通道编号"></el-input>
  95 + </el-form-item>
120 </el-form> 96 </el-form>
121 <div slot="footer" class="dialog-footer"> 97 <div slot="footer" class="dialog-footer">
122 <el-button @click.native="addFormVisible = false">取消</el-button> 98 <el-button @click.native="addFormVisible = false">取消</el-button>
123 - <el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button> 99 + <el-button type="primary" @click="dialogStatus==='create'?addSubmit():editSubmit()" :loading="addLoading" >提交</el-button>
124 </div> 100 </div>
125 </el-dialog> 101 </el-dialog>
126 102
@@ -177,23 +153,11 @@ @@ -177,23 +153,11 @@
177 pageSize: 5, 153 pageSize: 5,
178 listLoading: false, 154 listLoading: false,
179 sels: [],//列表选中列 155 sels: [],//列表选中列
180 - //编辑界面是否显示  
181 - editFormVisible: false,  
182 - editLoading: false,  
183 - editFormRules: {  
184 - roleName: [  
185 - { required: true, message: '请输入岗位/角色名称', trigger: 'blur' }  
186 - ]  
187 - },  
188 - //编辑界面数据  
189 - editForm: {  
190 - roleId: 1,  
191 - description: '',  
192 - roleName: '',  
193 - roleSign: 1,  
194 - departmentId:'' 156 + dialogMap: {
  157 + update: '编辑',
  158 + create: '新增',
195 }, 159 },
196 - 160 + dialogStatus: 'create',
197 //新增界面是否显示 161 //新增界面是否显示
198 addFormVisible: false, 162 addFormVisible: false,
199 //设置权限界面是否显示 163 //设置权限界面是否显示
@@ -216,7 +180,8 @@ @@ -216,7 +180,8 @@
216 type: '', 180 type: '',
217 businessLicense: '', 181 businessLicense: '',
218 customsRegCode: '', 182 customsRegCode: '',
219 - parentName: '' 183 + parentName: '',
  184 + mqcode: ''
220 185
221 }, 186 },
222 permForm: { 187 permForm: {
@@ -348,9 +313,10 @@ @@ -348,9 +313,10 @@
348 * @param row 为这行的数据对象 313 * @param row 为这行的数据对象
349 */ 314 */
350 handleEdit: function (index, row) { 315 handleEdit: function (index, row) {
351 - this.editFormVisible = true;  
352 - this.editForm = Object.assign({}, row);  
353 - this.getdepartmentNames(); 316 + this.addFormVisible = true;
  317 + this.dialogStatus= 'update',
  318 + this.addForm = Object.assign({}, row);
  319 + // this.getdepartmentNames();
354 }, 320 },
355 setPerm: function (index, row) { 321 setPerm: function (index, row) {
356 this.PermFormVisible = true; 322 this.PermFormVisible = true;
@@ -376,6 +342,7 @@ @@ -376,6 +342,7 @@
376 //显示新增界面,每次点开初始化数据 342 //显示新增界面,每次点开初始化数据
377 handleAdd: function (index,row) { 343 handleAdd: function (index,row) {
378 this.addFormVisible = true; 344 this.addFormVisible = true;
  345 + this.dialogStatus= 'create';
379 this.addForm = { 346 this.addForm = {
380 description: '', 347 description: '',
381 roleName: '', 348 roleName: '',
@@ -384,6 +351,7 @@ @@ -384,6 +351,7 @@
384 type: '', 351 type: '',
385 businessLicense: '', 352 businessLicense: '',
386 customsRegCode: '', 353 customsRegCode: '',
  354 + mqcode: '',
387 parentid: 0 355 parentid: 0
388 356
389 }; 357 };
@@ -399,12 +367,12 @@ @@ -399,12 +367,12 @@
399 }, 367 },
400 //编辑 368 //编辑
401 editSubmit: function () { 369 editSubmit: function () {
402 - this.$refs.editForm.validate((valid) => { 370 + this.$refs.addForm.validate((valid) => {
403 if (valid) { 371 if (valid) {
404 this.$confirm('确认提交吗?', '提示', {}).then(() => { 372 this.$confirm('确认提交吗?', '提示', {}).then(() => {
405 - this.editLoading = true; 373 + this.addLoading = true;
406 //NProgress.start(); 374 //NProgress.start();
407 - let para = Object.assign({}, this.editForm); 375 + let para = Object.assign({}, this.addForm);
408 //不需要提交的 去掉,后端不好接收 376 //不需要提交的 去掉,后端不好接收
409 para.authorities = null; 377 para.authorities = null;
410 para.permissions = null; 378 para.permissions = null;
@@ -417,8 +385,8 @@ @@ -417,8 +385,8 @@
417 式; 385 式;
418 */ 386 */
419 /*moment 安装 npm install moment --save*/ 387 /*moment 安装 npm install moment --save*/
420 - para.creattime = moment(para.creattime).format('YYYY-MM-DD HH:mm:ss');  
421 - this.editLoading = false; 388 + // para.creattime = moment(para.creattime).format('YYYY-MM-DD HH:mm:ss');
  389 + this.addLoading = false;
422 edit(para).then((res) => { 390 edit(para).then((res) => {
423 391
424 //NProgress.done(); 392 //NProgress.done();
@@ -426,8 +394,8 @@ @@ -426,8 +394,8 @@
426 message: '提交成功', 394 message: '提交成功',
427 type: 'success' 395 type: 'success'
428 }); 396 });
429 - this.$refs['editForm'].resetFields();  
430 - this.editFormVisible = false; 397 + this.$refs['addForm'].resetFields();
  398 + this.addFormVisible = false;
431 this.getRoles(); 399 this.getRoles();
432 }).catch(error => alert(error)); 400 }).catch(error => alert(error));
433 }); 401 });