Commit 53394ffa authored by huyf's avatar huyf

提单模板

parent 01c9cb0c
...@@ -9,6 +9,16 @@ export function createWarehouse(data) { ...@@ -9,6 +9,16 @@ export function createWarehouse(data) {
}) })
} }
//创建提单模板
export function createTemplate(data) {
console.log(data);
return request({
url: '/ecw/lading-template/create',
method: 'post',
data: data
})
}
// 更新仓库 // 更新仓库
export function updateWarehouse(data) { export function updateWarehouse(data) {
return request({ return request({
...@@ -80,6 +90,14 @@ export function changeRouteStatus(data) { ...@@ -80,6 +90,14 @@ export function changeRouteStatus(data) {
}) })
} }
export function getLadingTemplate(data) {
console.log(data);
return request({
url: '/ecw/lading-template/getByLineId?lineId='+data,
method: 'get'
})
}
/**查看已开通线路列表 */ /**查看已开通线路列表 */
export function openedRouterList(data = {}) { export function openedRouterList(data = {}) {
return request({ return request({
......
...@@ -108,6 +108,8 @@ ...@@ -108,6 +108,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" @click="routeStatusClick(scope.row)" <el-button size="mini" type="text" @click="routeStatusClick(scope.row)"
v-hasPermi="['ecw:warehouse:routerQuery']">{{scope.row.lineId ? '关闭线路' : '开通线路'}}</el-button> v-hasPermi="['ecw:warehouse:routerQuery']">{{scope.row.lineId ? '关闭线路' : '开通线路'}}</el-button>
<el-button size="mini" type="primary" @click="templateClick(scope.row)" v-if="scope.row.lineId != null"
v-hasPermi="['ecw:warehouse:routerQuery']">设置路线提单模板</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -245,11 +247,77 @@ ...@@ -245,11 +247,77 @@
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 对话框(添加 / 修改) -->
<el-dialog title="设置路线提单模板" :visible.sync="templateOpen" width="1000px" 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="请输入货柜前缀" />
</el-form-item>
<el-form-item label="抬头" prop="titleZh">
<editor v-model="ladingform.titleZh" :min-height="192"/>
</el-form-item>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>账户详情</span>
<el-button style="float: right;" size="small" type="primary" @click="handleAddAccount">添加账户+</el-button>
</div>
<el-table
:data="arr"
style="width: 100%"
>
<el-table-column
prop="detail"
label="详情"
width=""
>
<template v-slot="{ row, column, $index }">
<el-input v-model="row.detail" placeholder="请输入详情" size="mini"/>
</template>
</el-table-column>
<el-table-column
prop="name"
label="名称"
width=""
>
<template v-slot="{row}">
<el-input v-model="row.name" placeholder="请输入名称" size="mini"/>
</template>
</el-table-column>
<el-table-column
prop="company"
label="公司"
>
<template v-slot="{row}">
<el-input v-model="row.company" placeholder="请输入公司" size="mini"/>
</template>
</el-table-column>
<el-table-column
prop="operate"
label="操作"
>
<template slot-scope="scope">
<el-button type="danger" @click="delRow(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-form-item label="条款" prop="contentZh">
<editor v-model="ladingform.contentZh" :min-height="192"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitTemplateForm">保 存</el-button>
<el-button @click="resetTemplate()">重 置</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { createWarehouse, updateWarehouse, deleteWarehouse, getWarehouse, getWarehousePage, import { createWarehouse, updateWarehouse, deleteWarehouse, getWarehouse, getWarehousePage,createTemplate,getLadingTemplate,
exportWarehouseExcel,routerList,changeRouteStatus,deptBind,deptList } from "@/api/ecw/warehouse"; exportWarehouseExcel,routerList,changeRouteStatus,deptBind,deptList } from "@/api/ecw/warehouse";
import { getNodePage } from "@/api/ecw/node"; import { getNodePage } from "@/api/ecw/node";
import { getListTree } from "@/api/ecw/region"; import { getListTree } from "@/api/ecw/region";
...@@ -257,11 +325,15 @@ import { getDictDatas, DICT_TYPE } from '@/utils/dict' ...@@ -257,11 +325,15 @@ import { getDictDatas, DICT_TYPE } from '@/utils/dict'
import {CommonStatusEnum} from '@/utils/constants' 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 { has } from 'min-dash'; import { has } from 'min-dash';
import Template from "../../cms/template/index";
export default { export default {
name: "Warehouse", name: "Warehouse",
components: { components: {
Template,
Editor
}, },
data() { data() {
...@@ -315,6 +387,7 @@ export default { ...@@ -315,6 +387,7 @@ export default {
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
templateOpen:false,
dateRangeCreateTime: [], dateRangeCreateTime: [],
isUpdate: false, isUpdate: false,
...@@ -331,7 +404,8 @@ export default { ...@@ -331,7 +404,8 @@ export default {
id: null, id: null,
tradeType: null tradeType: null
}, },
arr:[],
cols:[{prop:"detail",label:"详情"},{prop:"name",label:"名称"},{prop:"company",label:"公司"},{prop:"operate",label:"操作"}],
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
...@@ -356,6 +430,7 @@ export default { ...@@ -356,6 +430,7 @@ export default {
}, },
// 表单参数 // 表单参数
form: {checkList:[],}, form: {checkList:[],},
ladingform: {prefixCounter:null,titleZh:null,contentZh:null,account:null,acctArr:[]},
// 表单校验 // 表单校验
rules: { rules: {
nodeId: [{ required: true, message: "服务网点不能为空", trigger: "blur" }], nodeId: [{ required: true, message: "服务网点不能为空", trigger: "blur" }],
...@@ -446,6 +521,16 @@ export default { ...@@ -446,6 +521,16 @@ export default {
}); });
}, },
delRow(index){
this.arr.splice(index, 1);
},
handleAddAccount(){
const obj = {"detail": "",
"name": "",
"company": ""};
this.arr.push(obj)
},
/** 查询部门列表 */ /** 查询部门列表 */
getDeptList() { getDeptList() {
listDept(this.queryParams).then(response => { listDept(this.queryParams).then(response => {
...@@ -556,6 +641,21 @@ export default { ...@@ -556,6 +641,21 @@ export default {
}); });
}, },
templateClick(row) {
getLadingTemplate(row.lineId).then(response => {
if(response.data!=null){
this.ladingform = response.data;
var jsonArr = JSON.parse(response.data.account);
for (var i in jsonArr) {
this.arr.push(jsonArr[i]);
}
}
});
this.templateOpen = true;
this.ladingform.lineId = row.lineId;
},
routeStatusClick(row) { routeStatusClick(row) {
this.routeQueryParam.transportType = row.transportType; this.routeQueryParam.transportType = row.transportType;
this.routeQueryParam.warehouseId = row.id; this.routeQueryParam.warehouseId = row.id;
...@@ -650,6 +750,14 @@ export default { ...@@ -650,6 +750,14 @@ export default {
this.open = false; this.open = false;
this.reset(); this.reset();
}, },
resetTemplate(){
this.ladingform={
prefixCounter:undefined,
titleZh:undefined,
account:undefined,
contentZh:undefined
}
},
/** 表单重置 */ /** 表单重置 */
reset() { reset() {
this.form = { this.form = {
...@@ -766,6 +874,16 @@ export default { ...@@ -766,6 +874,16 @@ export default {
}); });
}); });
}, },
submitTemplateForm(){
console.log(this.arr);
this.ladingform.account = JSON.stringify(this.arr);
createTemplate(this.ladingform).then(response => {
this.$modal.msgSuccess("设置路线提单模板成功");
this.templateOpen = false;
this.arr = [];
});
},
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const id = row.id; const id = row.id;
......
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