|
@@ -2,20 +2,30 @@
|
|
|
<!-- 添加销售订单排车 -->
|
|
|
<div class="addSalePlan">
|
|
|
<page-title>新增销售订单排车</page-title>
|
|
|
- <div class="table_form from">
|
|
|
+ <!-- 销售订单表的数据 -->
|
|
|
+ <div class="saleOrder">
|
|
|
+ <dilTable v-bind.sync="option" @selection-change="selectionChange">
|
|
|
+ </dilTable>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="button-box">
|
|
|
+ <el-button type="primary" @click="arragne">确定排车</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- <div class="table_form from">
|
|
|
<div class="materialId">
|
|
|
<span class="text"> 物资: </span>
|
|
|
<el-button type="primary" class="btn" @click="table = true">浏览</el-button>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<!-- 车序号表格 -->
|
|
|
<div class="switch" v-if="selectionList.length > 0">
|
|
|
<el-tooltip placement="top">
|
|
|
<div slot="content">下面表格已有数据,不能进行更改!!!</div>
|
|
|
<el-switch
|
|
|
v-model="value"
|
|
|
- active-text="重量"
|
|
|
- inactive-text="件数"
|
|
|
+ active-text="件数"
|
|
|
+ inactive-text="重量"
|
|
|
disabled
|
|
|
>
|
|
|
</el-switch>
|
|
@@ -24,11 +34,12 @@
|
|
|
<div class="switch" v-else>
|
|
|
<el-tooltip placement="top">
|
|
|
<div slot="content">当下面表格有数据之后,将不能进行更改!!!</div>
|
|
|
- <el-switch v-model="value" active-text="重量" inactive-text="件数">
|
|
|
+ <el-switch v-model="value" active-text="件数" inactive-text="重量">
|
|
|
</el-switch>
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
|
|
|
+ <!-- 排车表格 -->
|
|
|
<div class="selectionTable from">
|
|
|
<el-table
|
|
|
:data="selectionList"
|
|
@@ -36,6 +47,8 @@
|
|
|
style="width: 100%"
|
|
|
highlight-current-row
|
|
|
>
|
|
|
+ <el-table-column type="index" label="序号" width="50">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
v-for="(item, i) in tableTop"
|
|
|
:key="i"
|
|
@@ -45,7 +58,7 @@
|
|
|
align="center"
|
|
|
show-overflow-tooltip
|
|
|
>
|
|
|
- <template slot="scope" v-if="item.label !== '件数'">
|
|
|
+ <template slot="scope" v-if="item.label !== '重量'">
|
|
|
<span>{{ item.label }}</span>
|
|
|
</template>
|
|
|
<template slot="scope" v-if="item.label !== '车序号'">
|
|
@@ -54,7 +67,7 @@
|
|
|
<template slot="scope" v-if="item.label !== '收货地址'">
|
|
|
<span>{{ item.label }}</span>
|
|
|
</template>
|
|
|
- <template slot="scope" v-if="item.label !== '收货日期'">
|
|
|
+ <template slot="scope" v-if="item.label !== '截止日期'">
|
|
|
<span>{{ item.label }}</span>
|
|
|
</template>
|
|
|
<template slot="scope" v-if="item.label !== '收货姓名'">
|
|
@@ -70,6 +83,7 @@
|
|
|
<template v-if="item.prop == 'orderPlanWeight'">
|
|
|
<el-input
|
|
|
class="textinput"
|
|
|
+ placeholder="(必填)"
|
|
|
v-model.number="scope.row.orderPlanWeight"
|
|
|
></el-input>
|
|
|
</template>
|
|
@@ -77,20 +91,28 @@
|
|
|
<template v-if="item.prop == 'cxh'">
|
|
|
<el-input
|
|
|
class="textinput1"
|
|
|
+ placeholder="(必填)"
|
|
|
v-model.number="scope.row.cxh"
|
|
|
></el-input>
|
|
|
</template>
|
|
|
<!-- 收货地址id -->
|
|
|
- <template style="width: 400px" v-if="item.prop == 'saleShipperAddressName'">
|
|
|
- <el-input style="width: 200px" v-model="scope.row.saleShipperAddressName" disabled>
|
|
|
+ <template v-if="item.prop == 'saleShipperAddressName'" >
|
|
|
+ <el-input
|
|
|
+ style="width: 200px"
|
|
|
+ v-model="scope.row.saleShipperAddressName"
|
|
|
+ disabled
|
|
|
+ >
|
|
|
</el-input>
|
|
|
- <el-button type="primary" @click="ondrawer(scope.row,scope.$index)"
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ placeholder="(非必填)"
|
|
|
+ @click="select(scope.$index,3)"
|
|
|
>浏览</el-button
|
|
|
>
|
|
|
</template>
|
|
|
- <!-- 收货日期 -->
|
|
|
+ <!-- 截止日期 -->
|
|
|
<template v-if="item.prop == 'saleDateOfReceipt'">
|
|
|
- <el-date-picker
|
|
|
+ <el-date-picker
|
|
|
class="textinput3"
|
|
|
type="date"
|
|
|
v-model.number="scope.row.saleDateOfReceipt"
|
|
@@ -100,6 +122,7 @@
|
|
|
<template v-if="item.prop == 'saleOrderConsignee'">
|
|
|
<el-input
|
|
|
class="textinput4"
|
|
|
+ placeholder="(非必填)"
|
|
|
v-model.number="scope.row.saleOrderConsignee"
|
|
|
></el-input>
|
|
|
</template>
|
|
@@ -107,9 +130,17 @@
|
|
|
<template v-if="item.prop == 'saleOrderConsigneeTel'">
|
|
|
<el-input
|
|
|
class="textinput5"
|
|
|
+ placeholder="(非必填)"
|
|
|
v-model.number="scope.row.saleOrderConsigneeTel"
|
|
|
></el-input>
|
|
|
</template>
|
|
|
+ <!-- 排车数(不可见) -->
|
|
|
+ <template v-if="item.prop == 'arragneCount'">
|
|
|
+ <el-input
|
|
|
+ class="textinput6"
|
|
|
+ v-model.number="scope.row.arragneCount"
|
|
|
+ ></el-input>
|
|
|
+ </template>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<span>{{ scope.row[item.prop] }}</span>
|
|
@@ -117,10 +148,26 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<!-- 操作列 -->
|
|
|
- <el-table-column fixed="right" label="操作" width="100">
|
|
|
+ <el-table-column fixed="right" label="操作" width="200">
|
|
|
<template slot-scope="scope">
|
|
|
+
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ @click="copyRow(scope.$index,scope.row)"
|
|
|
+ type="text"
|
|
|
+ size="big"
|
|
|
+ >
|
|
|
+ 复制
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ <el-input
|
|
|
+ style="width: 50px;"
|
|
|
+ placeholder="(非必填)"
|
|
|
+ v-model.number="scope.row.arragneCount"
|
|
|
+ ></el-input>
|
|
|
+
|
|
|
<el-button
|
|
|
- @click.native.prevent="deleteRow(scope.$index, selectionList)"
|
|
|
+ @click="deleteRow(scope.$index)"
|
|
|
type="text"
|
|
|
icon="el-icon-close"
|
|
|
size="big"
|
|
@@ -129,54 +176,46 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
-
|
|
|
- <el-drawer
|
|
|
- :visible.sync="drawer"
|
|
|
- :direction="direction"
|
|
|
- :close-on-press-escape="true"
|
|
|
- :show-close="true"
|
|
|
- :wrapperClosable="true"
|
|
|
+ <!-- 收货地址的模态框 -->
|
|
|
+ <el-drawer
|
|
|
+ :visible.sync="addressDrawer"
|
|
|
+ :destroy-on-close="false"
|
|
|
+ direction="rtl"
|
|
|
+ size="40%"
|
|
|
+ :wrapperClosable="false"
|
|
|
modal
|
|
|
- size="30%"
|
|
|
+ close-on-press-escape
|
|
|
+
|
|
|
>
|
|
|
<el-input
|
|
|
placeholder="请输入内容"
|
|
|
- v-model="textInput"
|
|
|
- style="margin-top: 10px; margin-left: 20px;width: 200px"
|
|
|
+ v-model="addressText"
|
|
|
+ style="margin-top: 10px; margin-left: 20px; width: 250px"
|
|
|
clearable
|
|
|
>
|
|
|
</el-input>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
class="btn"
|
|
|
- @click="onclick1()"
|
|
|
- style="margin-bottom: 15px"
|
|
|
+ @click="selectAddressClick"
|
|
|
+ style="margin-left: 5px"
|
|
|
>
|
|
|
<i class="el-icon-search"></i>查询
|
|
|
</el-button>
|
|
|
- <dilTable
|
|
|
- v-bind.sync="frist"
|
|
|
- @radio-change="currentRadioChange1"
|
|
|
- ></dilTable>
|
|
|
- </el-drawer>
|
|
|
- <el-drawer
|
|
|
- title="选择物资信息"
|
|
|
- :visible.sync="table"
|
|
|
- direction="rtl"
|
|
|
- size="50%"
|
|
|
- :show-close="false"
|
|
|
- >
|
|
|
- <el-input placeholder="请输入内容" v-model="input"
|
|
|
- style="margin-top: 10px; margin-left: 20px;width:160px" clearable> </el-input
|
|
|
- ><el-button type="primary" class="btn" @click="onclick" style="margin-left: 4px;">
|
|
|
- <i class="el-icon-search"></i>查询
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ class="btn"
|
|
|
+ @click="addAddressClick"
|
|
|
+ style="margin-left: 5px"
|
|
|
+ >
|
|
|
+ <i class="el-icon-check"></i>确定
|
|
|
</el-button>
|
|
|
- <el-button @click="open">取消</el-button>
|
|
|
- <el-button type="primary" @click="makeSure1">确定</el-button>
|
|
|
<div class="tablecls">
|
|
|
- <!-- 查询所有的物资 -->
|
|
|
- <dilTable v-bind.sync="option" @selection-change="selectionChange">
|
|
|
- </dilTable>
|
|
|
+ <!-- 查询所有的收货地址 -->
|
|
|
+ <dilTable
|
|
|
+ v-bind.sync="Address"
|
|
|
+ @radio-change="currentRadioChange2"
|
|
|
+ ></dilTable>
|
|
|
</div>
|
|
|
</el-drawer>
|
|
|
|
|
@@ -195,12 +234,25 @@ export default {
|
|
|
return {
|
|
|
textInput: "",
|
|
|
input: "",
|
|
|
+ //排车数默认
|
|
|
+ arragneCount: 1,
|
|
|
+ //初始化车序号
|
|
|
+ arragneCxh: 1,
|
|
|
option: {
|
|
|
// 表格请求数据的地址
|
|
|
requestUrl: "/api/v1/ams/getSaleOrderAndMaterialById?apiId=410&saleOrderId=" + this.$route.params.saleOrderId,
|
|
|
// 控制显示多选列
|
|
|
selectionType: "select",
|
|
|
},
|
|
|
+ //是否打开收货地址的模态框
|
|
|
+ addressDrawer:false,
|
|
|
+ //收货地址的表格
|
|
|
+ addressText:null,
|
|
|
+ //线路表格的框计算输入的值
|
|
|
+ Address: {
|
|
|
+ requestUrl: "/api/v1/ams/getAddressDeliveryAddress?apiId=255",
|
|
|
+ selectionType: "radio",
|
|
|
+ },
|
|
|
table: false,
|
|
|
selectionList: [],
|
|
|
selectionList1: [],
|
|
@@ -225,14 +277,10 @@ export default {
|
|
|
],
|
|
|
values: "yes",
|
|
|
tableTop: [
|
|
|
- {
|
|
|
- prop: "materialCode",
|
|
|
- label: "物资编码",
|
|
|
- width: "120",
|
|
|
- },
|
|
|
{
|
|
|
prop: "cxh",
|
|
|
label: "车序号",
|
|
|
+ width: "80",
|
|
|
slot: true,
|
|
|
},
|
|
|
{
|
|
@@ -247,29 +295,38 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
prop: "orderPlanWeight",
|
|
|
- label: "件数",
|
|
|
+ label: "重量",
|
|
|
+ width: "80",
|
|
|
slot: true,
|
|
|
},
|
|
|
{
|
|
|
- prop: "saleShipperAddressName",
|
|
|
- label: "收货地址",
|
|
|
- width: "300",
|
|
|
+ prop: "saleDateOfReceipt",
|
|
|
+ label: "截止日期",
|
|
|
+ width: "230",
|
|
|
slot: true,
|
|
|
},
|
|
|
{
|
|
|
- prop: "saleDateOfReceipt",
|
|
|
- label: "收货日期",
|
|
|
- width: "110",
|
|
|
+ prop: "saleShipperAddressName",
|
|
|
+ label: "收货地址",
|
|
|
+ width: "300",
|
|
|
slot: true,
|
|
|
},
|
|
|
{
|
|
|
prop: "saleOrderConsignee",
|
|
|
label: "收货客户",
|
|
|
+ width: "150",
|
|
|
slot: true,
|
|
|
},
|
|
|
{
|
|
|
prop: "saleOrderConsigneeTel",
|
|
|
label: "收货客户电话号码",
|
|
|
+ width: "150",
|
|
|
+ slot: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: "arragneCount",
|
|
|
+ label: "复制数",
|
|
|
+ width: "80",
|
|
|
slot: true,
|
|
|
},
|
|
|
],
|
|
@@ -282,49 +339,107 @@ export default {
|
|
|
watch: {
|
|
|
value() {
|
|
|
if (this.value) {
|
|
|
- this.tableTop[4]={
|
|
|
+ this.tableTop[3]={
|
|
|
prop: "orderPlanWeight",
|
|
|
- label: "重量",
|
|
|
+ label: "件数",
|
|
|
slot: true,
|
|
|
};
|
|
|
} else {
|
|
|
- this.tableTop[4]={
|
|
|
+ this.tableTop[3]={
|
|
|
prop: "orderPlanWeight",
|
|
|
- label: "件数",
|
|
|
+ label: "重量",
|
|
|
slot: true,
|
|
|
};
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
- deleteRow(index, rows) {
|
|
|
- rows.splice(index, 1);
|
|
|
- },
|
|
|
//点击浏览事件
|
|
|
ondrawer(row,index) {
|
|
|
this.row = row;
|
|
|
this.row.index = index;
|
|
|
this.drawer = true;
|
|
|
},
|
|
|
+ //复制多条的方法
|
|
|
+ copyRow(index,row){
|
|
|
+ console.log("this.selectionList",this.selectionList)
|
|
|
+ console.log("row",row)
|
|
|
+ let arr = [];
|
|
|
+ for(var i = 0 ;i<this.selectionList.length; i++){
|
|
|
+ if(i == index){
|
|
|
+ arr.push(this.selectionList[i]);
|
|
|
+ for(var j = 0;j<this.selectionList[i].arragneCount; j++){
|
|
|
+ arr.push({
|
|
|
+ Specification:row.Specification,
|
|
|
+ arragneCount:this.arragneCount,
|
|
|
+ cxh:row.cxh,
|
|
|
+ materialName:row.materialName,
|
|
|
+ orderPlanWeight:row.orderPlanWeight,
|
|
|
+ saleDateOfReceipt:row.saleDateOfReceipt,
|
|
|
+ saleMaterialId:row.saleMaterialId,
|
|
|
+ saleOrderConsignee:row.saleOrderConsignee,
|
|
|
+ saleDateOfReceipt:row.saleDateOfReceipt,
|
|
|
+ saleOrderConsigneeTel:row.saleOrderConsigneeTel,
|
|
|
+ saleShipperAddressId:row.saleShipperAddressId,
|
|
|
+ saleShipperAddressName:row.saleShipperAddressName,
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ arr.push(this.selectionList[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.selectionList = [];
|
|
|
+ this.selectionList = arr;
|
|
|
+ },
|
|
|
+ //点击删除按钮删除当前点击的对象
|
|
|
+ deleteRow(index){
|
|
|
+ this.selectionList.splice(index,1)
|
|
|
+ },
|
|
|
//监听模态框点击事件
|
|
|
currentRadioChange1(radioList) {
|
|
|
this.selectionList[this.row.index].saleShipperAddressId = radioList.addressId;
|
|
|
this.selectionList[this.row.index].saleShipperAddressName = radioList.address;
|
|
|
},
|
|
|
- //收货地址模态框查询
|
|
|
- onclick1() {
|
|
|
- this.option.requestUrl =
|
|
|
- "/api/v1/ams/getAddressDeliveryAddress?apiId=255&con=" + this.textInput;
|
|
|
+ //收货地址模态窗口的框计算
|
|
|
+ selectAddressClick(){
|
|
|
+ this.Address.requestUrl = '/api/v1/ams/getAddressDeliveryAddress?apiId=255&con='+this.addressText;
|
|
|
+ },
|
|
|
+ //收货地址模态窗口的点击事件
|
|
|
+ addAddressClick(){
|
|
|
+ this.selectionList[this.addressIndex].saleShipperAddressName = this.addressMap.address
|
|
|
+ this.selectionList[this.addressIndex].saleShippingAddressId = this.addressMap.addressId
|
|
|
+ this.addressDrawer = false;
|
|
|
+ let arr = this.selectionList;
|
|
|
+ this.selectionList = [];
|
|
|
+ arr.forEach((e)=>{
|
|
|
+ this.selectionList.push({
|
|
|
+ //销售订单与物资表主键
|
|
|
+ Specification:e.Specification,
|
|
|
+ arragneCount:e.arragneCount,
|
|
|
+ cxh:e.cxh,
|
|
|
+ materialName:e.materialName,
|
|
|
+ orderPlanWeight:e.orderPlanWeight,
|
|
|
+ saleDateOfReceipt:e.saleDateOfReceipt,
|
|
|
+ saleMaterialId:e.saleMaterialId,
|
|
|
+ saleOrderConsignee:e.saleOrderConsignee,
|
|
|
+ saleDateOfReceipt:e.saleDateOfReceipt,
|
|
|
+ saleOrderConsigneeTel:e.saleOrderConsigneeTel,
|
|
|
+ saleShipperAddressId:e.saleShipperAddressId,
|
|
|
+ saleShipperAddressName:e.saleShipperAddressName,
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //收货地址点击浏览的事件
|
|
|
+ select(index){
|
|
|
+ this.addressDrawer = true;
|
|
|
+ this.addressIndex = index ;
|
|
|
+ },
|
|
|
+ //收货地址模态框单选选中的事件
|
|
|
+ currentRadioChange2(val){
|
|
|
+ this.addressMap = {};
|
|
|
+ this.addressMap = val;
|
|
|
},
|
|
|
- // dianji() {
|
|
|
- // this.axios.get("/api/v1/ams/getAddressDeliveryAddress").then((res) => {
|
|
|
- // if (res.data.code == "200") {
|
|
|
- // console.log(res);
|
|
|
- // this.options1 = res.data.data;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // },
|
|
|
- //物资模态框查询
|
|
|
// 框计算
|
|
|
onclick() {
|
|
|
this.option.requestUrl =
|
|
@@ -347,12 +462,12 @@ export default {
|
|
|
this.table = false;
|
|
|
}
|
|
|
},
|
|
|
- // 返回主界面
|
|
|
- makeSure1() {
|
|
|
+ // 进行排车
|
|
|
+ arragne() {
|
|
|
this.selectionList1.forEach((e) => {
|
|
|
var addmap = {
|
|
|
- materialCode: e.materialCode,
|
|
|
- cxh: null,
|
|
|
+ // materialCode: e.materialCode,
|
|
|
+ cxh: this.arragneCxh,
|
|
|
materialName: e.materialName,
|
|
|
Specification: e.specificationModel,
|
|
|
orderPlanWeight: null,
|
|
@@ -362,12 +477,17 @@ export default {
|
|
|
saleOrderConsignee: null,
|
|
|
saleOrderConsigneeTel: null,
|
|
|
saleMaterialId: e.saleMaterialId,
|
|
|
- materialTheoreticalWeight: e.materialTheoreticalWeight,
|
|
|
+ // materialTheoreticalWeight: e.materialTheoreticalWeight,
|
|
|
+ arragneCount : this.arragneCount,
|
|
|
};
|
|
|
this.selectionList.push(addmap);
|
|
|
+ //车序号自增
|
|
|
+ this.arragneCxh++;
|
|
|
});
|
|
|
this.selectionList1 = [];
|
|
|
this.table = false;
|
|
|
+ //重置销售订单信息
|
|
|
+ this.option.requestUrl = "/api/v1/ams/getSaleOrderAndMaterialById?apiId=410&saleOrderId=" + this.$route.params.saleOrderId + "&i=" + new Date();
|
|
|
},
|
|
|
// 返回选中的物资信息
|
|
|
selectionChange(selection) {
|
|
@@ -410,7 +530,7 @@ export default {
|
|
|
mapItem.materialNumber=item.orderPlanWeight;
|
|
|
mapList.push(mapItem);
|
|
|
});
|
|
|
- // console.log("mapList",mapList);
|
|
|
+ console.log("mapList",mapList);
|
|
|
this.axios.post("/api/v1/ams/addTruckNo", mapList).then((res) => {
|
|
|
if (res.data.code == "200") {
|
|
|
this.$router.go(-1);
|
|
@@ -471,10 +591,10 @@ export default {
|
|
|
margin-left: -16rem;
|
|
|
}
|
|
|
.textinput {
|
|
|
- width: 50px;
|
|
|
+ width: 70px;
|
|
|
}
|
|
|
.textinput1 {
|
|
|
- width: 50px;
|
|
|
+ width: 70px;
|
|
|
text-align: center;
|
|
|
size: small;
|
|
|
}
|
|
@@ -483,12 +603,15 @@ export default {
|
|
|
margin-right: 30px;
|
|
|
}
|
|
|
.textinput3 {
|
|
|
- width: 270px;
|
|
|
+ width: 240px;
|
|
|
}
|
|
|
.textinput4 {
|
|
|
- width: 60px;
|
|
|
+ width: 120px;
|
|
|
}
|
|
|
.textinput5 {
|
|
|
width: 120px;
|
|
|
}
|
|
|
+.textinput6{
|
|
|
+ width: 70px;
|
|
|
+}
|
|
|
</style>
|