Commit 38af27f0 authored by huyf's avatar huyf

批量设置提单模板

parent 9dc1206e
......@@ -30,6 +30,10 @@
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['ecw:warehouse:export']">导出</el-button>
</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>
</el-row>
......@@ -249,7 +253,7 @@
</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-item label="货柜前缀" prop="prefixCounter">
<el-input v-model="ladingform.prefixCounter" placeholder="请输入货柜前缀" />
......@@ -307,6 +311,10 @@
<el-form-item label="条款" prop="contentZh">
<editor v-model="ladingform.contentZh" :min-height="192"/>
</el-form-item>
<el-form-item v-if="showFlag">
<routers-selector v-model="ladingform.lineIds" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitTemplateForm">保 存</el-button>
......@@ -326,6 +334,8 @@ import {CommonStatusEnum} from '@/utils/constants'
import { uploadFile } from "@/api/infra/file";
import { listDept } from "@/api/system/dept";
import Editor from '@/components/Editor';
import {getDictData} from '@/utils/dict'
import RoutersSelector from '@/components/RoutersSelector';
import { has } from 'min-dash';
import Template from "../../cms/template/index";
......@@ -333,7 +343,8 @@ export default {
name: "Warehouse",
components: {
Template,
Editor
Editor,
RoutersSelector
},
data() {
......@@ -404,6 +415,7 @@ export default {
id: null,
tradeType: null
},
showFlag:false,
arr:[],
cols:[{prop:"detail",label:"详情"},{prop:"name",label:"名称"},{prop:"company",label:"公司"},{prop:"operate",label:"操作"}],
// 查询参数
......@@ -524,7 +536,9 @@ export default {
delRow(index){
this.arr.splice(index, 1);
},
ladingFormClose(){
this.resetTemplate();
},
handleAddAccount(){
const obj = {"detail": "",
"name": "",
......@@ -642,6 +656,7 @@ export default {
},
templateClick(row) {
if(row!=''){
getLadingTemplate(row.lineId).then(response => {
if(response.data!=null){
this.ladingform = response.data;
......@@ -652,8 +667,11 @@ export default {
}
}
});
this.ladingform.lineId = row.lineId;
}else {
this.showFlag = true;
}
this.templateOpen = true;
this.ladingform.lineId = row.lineId;
},
routeStatusClick(row) {
......@@ -751,6 +769,8 @@ export default {
this.reset();
},
resetTemplate(){
this.arr=[];
this.showFlag = false;
this.ladingform={
prefixCounter:undefined,
titleZh:undefined,
......@@ -876,12 +896,19 @@ export default {
},
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);
createTemplate(this.ladingform).then(response => {
this.$modal.msgSuccess("设置路线提单模板成功");
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