|
@@ -76,7 +76,11 @@
|
|
|
</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="showDialog">多拼派车</el-button>
|
|
|
+ <el-button type="primary" @click="showDialog">多拼派车</el-button>、
|
|
|
+ <el-button type="primary" @click="mergeSplit()">
|
|
|
+ <i class="el-icon-pie-chart"></i>
|
|
|
+ 合并或拆分
|
|
|
+ </el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -92,8 +96,7 @@
|
|
|
:row-style="{ height: '30px' }"
|
|
|
:cell-style="{ fontWeight: '700' }"
|
|
|
>
|
|
|
- <el-table-column type="selection" width="40" :selectable="selectInit">
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column type="selection" width="40"> </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="index"
|
|
|
width="40"
|
|
@@ -299,6 +302,13 @@
|
|
|
align="center"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="optionCode"
|
|
|
+ label="派车人"
|
|
|
+ width="120px"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<!-- 多拼弹出层-->
|
|
@@ -316,12 +326,7 @@
|
|
|
placeholder="请输入车牌号"
|
|
|
@select="handleMulSelect"
|
|
|
></el-autocomplete>
|
|
|
- <el-button
|
|
|
- @click="updateMulCapacity"
|
|
|
- type="primary"
|
|
|
- :disabled="disabledDispatch"
|
|
|
- >提交</el-button
|
|
|
- >
|
|
|
+ <el-button @click="updateMulCapacity" type="primary">提交</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-dialog>
|
|
@@ -452,6 +457,200 @@ export default {
|
|
|
this.getSendStations()
|
|
|
},
|
|
|
methods: {
|
|
|
+ mergeSplit() {
|
|
|
+ if (this.$refs.tableRef.selection > 0) {
|
|
|
+ if (!this.$refs.tableRef.selection[0].saleOrderMaterialId) {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ duration: '2500',
|
|
|
+ message: '请所有分录均派车后再进行该操作',
|
|
|
+ offset: '250'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.$refs.tableRef.selection.length == 1) {
|
|
|
+ this.$confirm(
|
|
|
+ `尊敬的用户${getCookie(
|
|
|
+ 'loginName'
|
|
|
+ )},系统温馨提示您进行拆分操作前,请确认所拆分的订单将不会在金蝶进行提交,审核等操作!`,
|
|
|
+ '提醒',
|
|
|
+ {
|
|
|
+ confirmButtonText: '我已确认',
|
|
|
+ cancelButtonText: '我再想想',
|
|
|
+ center: true,
|
|
|
+ type: 'warning'
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ this.splitOrder()
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ duration: '2500',
|
|
|
+ message: '操作取消',
|
|
|
+ offset: '250'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else if (this.$refs.tableRef.selection.length > 1) {
|
|
|
+ this.$confirm(
|
|
|
+ `尊敬的用户${getCookie(
|
|
|
+ 'loginName'
|
|
|
+ )},系统温馨提示您进行合并操作前,请确认所合并的订单将不会在金蝶进行提交,审核等操作!`,
|
|
|
+ '提醒',
|
|
|
+ {
|
|
|
+ confirmButtonText: '我已确认',
|
|
|
+ cancelButtonText: '我再想想',
|
|
|
+ center: true,
|
|
|
+ type: 'warning'
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ this.mergeOrder()
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ duration: '2500',
|
|
|
+ message: '操作取消',
|
|
|
+ offset: '250'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请勾选/点击需要操作的行',
|
|
|
+ offset: '250',
|
|
|
+ duration: '2300'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ splitOrder() {
|
|
|
+ this.$confirm(
|
|
|
+ `勾选了${this.$refs.tableRef.selection.length}条运单将执行拆分操作`,
|
|
|
+ '提醒',
|
|
|
+ {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ center: true
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ let mapList = this.$refs.tableRef.selection.map(e => {
|
|
|
+ let map = {}
|
|
|
+ map.saleOrderMaterialId = e.saleOrderMaterialId
|
|
|
+ return map
|
|
|
+ })
|
|
|
+ let map = {
|
|
|
+ mapList: mapList,
|
|
|
+ userName: getCookie('loginName')
|
|
|
+ }
|
|
|
+ this.axios
|
|
|
+ .post('/api/v1/ams/splitOrder', map)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == '200') {
|
|
|
+ this.onclick(this.filterMap)
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '拆分成功',
|
|
|
+ offset: '250',
|
|
|
+ duration: '2500'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: res.data.data,
|
|
|
+ offset: '250',
|
|
|
+ duration: '2500'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: '拆分失败',
|
|
|
+ offset: '250',
|
|
|
+ duration: '2500'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ duration: '2500',
|
|
|
+ message: '操作取消',
|
|
|
+ offset: '250'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ mergeOrder() {
|
|
|
+ this.$confirm(
|
|
|
+ `勾选了${this.$refs.tableRef.selection.length}条运单将执行合并操作,此操作不可逆!`,
|
|
|
+ '提醒',
|
|
|
+ {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ center: true
|
|
|
+ }
|
|
|
+ )
|
|
|
+ .then(() => {
|
|
|
+ console.log(
|
|
|
+ this.$refs.tableRef.selection,
|
|
|
+ 'this.$refs.tableRef.selection'
|
|
|
+ )
|
|
|
+ let mapList = this.$refs.tableRef.selection.map(e => {
|
|
|
+ let map = {}
|
|
|
+ map.saleOrderMaterialId = e.saleOrderMaterialId
|
|
|
+ map.orderId = e.orderId
|
|
|
+ map.saleOrderId = e.saleOrderId
|
|
|
+ map.orderNo = e.orderNo
|
|
|
+ map.capacityNo = e.capacityNo
|
|
|
+ map.userName = getCookie('loginName')
|
|
|
+ return map
|
|
|
+ })
|
|
|
+ let map = {
|
|
|
+ mapList: mapList,
|
|
|
+ userName: getCookie('loginName')
|
|
|
+ }
|
|
|
+ this.axios
|
|
|
+ .post('/api/v1/ams/mergeOrder', map)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == '200') {
|
|
|
+ this.onclick(this.filterMap)
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '合并成功,请提醒驾驶员!',
|
|
|
+ offset: '250',
|
|
|
+ duration: '3000'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: res.data.data,
|
|
|
+ offset: '250',
|
|
|
+ duration: '2500'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: '合并失败',
|
|
|
+ offset: '250',
|
|
|
+ duration: '2500'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ duration: '2500',
|
|
|
+ message: '操作取消',
|
|
|
+ offset: '250'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
// dispatchSome() {
|
|
|
// console.log(this.tableData);
|
|
|
// //首先过滤掉已派车的数据
|
|
@@ -774,6 +973,7 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
let map = {
|
|
|
+ userName: getCookie('loginName'),
|
|
|
sendStationId: row.sendStationId,
|
|
|
saleOrderId: row.saleOrderId,
|
|
|
mapList: arr
|
|
@@ -840,6 +1040,7 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
let map = {
|
|
|
+ userName: getCookie('loginName'),
|
|
|
sendStationId: this.selection[0].sendStationId,
|
|
|
saleOrderId: this.selection[0].saleOrderId,
|
|
|
mapList: this.selection
|