Commit 38af27f0 authored by huyf's avatar huyf

批量设置提单模板

parent 9dc1206e
...@@ -30,6 +30,10 @@ ...@@ -30,6 +30,10 @@
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading" <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['ecw:warehouse:export']">导出</el-button> v-hasPermi="['ecw:warehouse:export']">导出</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="templateClick('')"
v-hasPermi="['ecw:warehouse:create']">批量设置提单模板</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
...@@ -249,7 +253,7 @@ ...@@ -249,7 +253,7 @@
</el-dialog> </el-dialog>
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-dialog title="设置路线提单模板" :visible.sync="templateOpen" width="1000px" append-to-body> <el-dialog title="设置路线提单模板" :visible.sync="templateOpen" width="1000px" @close="ladingFormClose()" append-to-body>
<el-form ref="form" :model="ladingform" :rules="rules" label-width="80px"> <el-form ref="form" :model="ladingform" :rules="rules" label-width="80px">
<el-form-item label="货柜前缀" prop="prefixCounter"> <el-form-item label="货柜前缀" prop="prefixCounter">
<el-input v-model="ladingform.prefixCounter" placeholder="请输入货柜前缀" /> <el-input v-model="ladingform.prefixCounter" placeholder="请输入货柜前缀" />
...@@ -307,6 +311,10 @@ ...@@ -307,6 +311,10 @@
<el-form-item label="条款" prop="contentZh"> <el-form-item label="条款" prop="contentZh">
<editor v-model="ladingform.contentZh" :min-height="192"/> <editor v-model="ladingform.contentZh" :min-height="192"/>
</el-form-item> </el-form-item>
<el-form-item v-if="showFlag">
<routers-selector v-model="ladingform.lineIds" />
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitTemplateForm">保 存</el-button> <el-button type="primary" @click="submitTemplateForm">保 存</el-button>
...@@ -326,6 +334,8 @@ import {CommonStatusEnum} from '@/utils/constants' ...@@ -326,6 +334,8 @@ import {CommonStatusEnum} from '@/utils/constants'
import { uploadFile } from "@/api/infra/file"; import { uploadFile } from "@/api/infra/file";
import { listDept } from "@/api/system/dept"; import { listDept } from "@/api/system/dept";
import Editor from '@/components/Editor'; import Editor from '@/components/Editor';
import {getDictData} from '@/utils/dict'
import RoutersSelector from '@/components/RoutersSelector';
import { has } from 'min-dash'; import { has } from 'min-dash';
import Template from "../../cms/template/index"; import Template from "../../cms/template/index";
...@@ -333,7 +343,8 @@ export default { ...@@ -333,7 +343,8 @@ export default {
name: "Warehouse", name: "Warehouse",
components: { components: {
Template, Template,
Editor Editor,
RoutersSelector
}, },
data() { data() {
...@@ -404,6 +415,7 @@ export default { ...@@ -404,6 +415,7 @@ export default {
id: null, id: null,
tradeType: null tradeType: null
}, },
showFlag:false,
arr:[], arr:[],
cols:[{prop:"detail",label:"详情"},{prop:"name",label:"名称"},{prop:"company",label:"公司"},{prop:"operate",label:"操作"}], cols:[{prop:"detail",label:"详情"},{prop:"name",label:"名称"},{prop:"company",label:"公司"},{prop:"operate",label:"操作"}],
// 查询参数 // 查询参数
...@@ -524,7 +536,9 @@ export default { ...@@ -524,7 +536,9 @@ export default {
delRow(index){ delRow(index){
this.arr.splice(index, 1); this.arr.splice(index, 1);
}, },
ladingFormClose(){
this.resetTemplate();
},
handleAddAccount(){ handleAddAccount(){
const obj = {"detail": "", const obj = {"detail": "",
"name": "", "name": "",
...@@ -642,6 +656,7 @@ export default { ...@@ -642,6 +656,7 @@ export default {
}, },
templateClick(row) { templateClick(row) {
if(row!=''){
getLadingTemplate(row.lineId).then(response => { getLadingTemplate(row.lineId).then(response => {
if(response.data!=null){ if(response.data!=null){
this.ladingform = response.data; this.ladingform = response.data;
...@@ -652,8 +667,11 @@ export default { ...@@ -652,8 +667,11 @@ export default {
} }
} }
}); });
this.ladingform.lineId = row.lineId;
}else {
this.showFlag = true;
}
this.templateOpen = true; this.templateOpen = true;
this.ladingform.lineId = row.lineId;
}, },
routeStatusClick(row) { routeStatusClick(row) {
...@@ -751,6 +769,8 @@ export default { ...@@ -751,6 +769,8 @@ export default {
this.reset(); this.reset();
}, },
resetTemplate(){ resetTemplate(){
this.arr=[];
this.showFlag = false;
this.ladingform={ this.ladingform={
prefixCounter:undefined, prefixCounter:undefined,
titleZh:undefined, titleZh:undefined,
...@@ -876,12 +896,19 @@ export default { ...@@ -876,12 +896,19 @@ export default {
}, },
submitTemplateForm(){ submitTemplateForm(){
console.log(this.arr); if(this.showFlag&&this.ladingform.lineIds!=null){
let lineId = '';
let lineArr = this.ladingform.lineIds;
lineArr.forEach((elem, index) => {
lineId = lineId + elem.lineId + ",";
});
this.ladingform.lineId=lineId.substr(0,lineId.length-1);
}
this.ladingform.account = JSON.stringify(this.arr); this.ladingform.account = JSON.stringify(this.arr);
createTemplate(this.ladingform).then(response => { createTemplate(this.ladingform).then(response => {
this.$modal.msgSuccess("设置路线提单模板成功"); this.$modal.msgSuccess("设置路线提单模板成功");
this.templateOpen = false; this.templateOpen = false;
this.arr = []; this.resetTemplate();
}); });
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment