|
@@ -57,6 +57,12 @@
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
><el-button type="primary" @click="search">查询</el-button>
|
|
><el-button type="primary" @click="search">查询</el-button>
|
|
|
<el-button type="primary" @click="insert">新增</el-button>
|
|
<el-button type="primary" @click="insert">新增</el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="approve"
|
|
|
|
|
+ v-privilege="activeMenu + 'submit'"
|
|
|
|
|
+ >提交</el-button
|
|
|
|
|
+ >
|
|
|
<el-button
|
|
<el-button
|
|
|
type="primary"
|
|
type="primary"
|
|
|
@click="approve"
|
|
@click="approve"
|
|
@@ -64,6 +70,18 @@
|
|
|
>审核</el-button
|
|
>审核</el-button
|
|
|
>
|
|
>
|
|
|
<el-button type="danger" @click="deleteOrder">删除</el-button>
|
|
<el-button type="danger" @click="deleteOrder">删除</el-button>
|
|
|
|
|
+ <el-button type="primary">
|
|
|
|
|
+ <el-upload
|
|
|
|
|
+ class="upload-excel"
|
|
|
|
|
+ action=""
|
|
|
|
|
+ :on-change="importExcel"
|
|
|
|
|
+ :show-file-list="false"
|
|
|
|
|
+ accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
|
|
|
|
+ :auto-upload="false"
|
|
|
|
|
+ >
|
|
|
|
|
+ 导入Excel</el-upload
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
</div>
|
|
</div>
|
|
@@ -148,11 +166,21 @@
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <el-form-item label="是否自提">
|
|
|
|
|
+ <el-select v-model="planForm.isSelfMention" style="width:auto">
|
|
|
|
|
+ <el-option label="是" value="是" :key="1"> </el-option>
|
|
|
|
|
+ <el-option label="否" value="否" :key="0"> </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
<el-button
|
|
<el-button
|
|
|
type="primary"
|
|
type="primary"
|
|
|
@click="checkRealTimeInventory"
|
|
@click="checkRealTimeInventory"
|
|
|
- :disabled="planForm.receiveId == null ? true : false"
|
|
|
|
|
|
|
+ :disabled="
|
|
|
|
|
+ planForm.receiveId == null || planForm.saleRemark == null
|
|
|
|
|
+ ? true
|
|
|
|
|
+ : false
|
|
|
|
|
+ "
|
|
|
>浏览实时库存</el-button
|
|
>浏览实时库存</el-button
|
|
|
>
|
|
>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -535,7 +563,9 @@
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
import { getCookie, formatDate } from '@/utils/util.js'
|
|
import { getCookie, formatDate } from '@/utils/util.js'
|
|
|
|
|
+import exportTranPlan from './exportTranPlan.js'
|
|
|
export default {
|
|
export default {
|
|
|
|
|
+ extends: exportTranPlan,
|
|
|
data() {
|
|
data() {
|
|
|
const generateStartDate = _ => {
|
|
const generateStartDate = _ => {
|
|
|
let startDate = new Date()
|
|
let startDate = new Date()
|
|
@@ -611,7 +641,8 @@ export default {
|
|
|
planForm: {
|
|
planForm: {
|
|
|
shipperName: '四川省达州钢铁集团有限责任公司',
|
|
shipperName: '四川省达州钢铁集团有限责任公司',
|
|
|
shipperId: 1,
|
|
shipperId: 1,
|
|
|
- filterFlag: 1
|
|
|
|
|
|
|
+ filterFlag: 1,
|
|
|
|
|
+ receiveId: null
|
|
|
},
|
|
},
|
|
|
title: '新增转运计划',
|
|
title: '新增转运计划',
|
|
|
materialList1: [],
|
|
materialList1: [],
|
|
@@ -742,7 +773,9 @@ export default {
|
|
|
approvingList: [],
|
|
approvingList: [],
|
|
|
loginName: '',
|
|
loginName: '',
|
|
|
orgCode: '',
|
|
orgCode: '',
|
|
|
- showSummaryList: ['materialNumber', 'materialWeight']
|
|
|
|
|
|
|
+ showSummaryList: ['materialNumber', 'materialWeight'],
|
|
|
|
|
+ userId: '',
|
|
|
|
|
+ userName: ''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -761,6 +794,7 @@ export default {
|
|
|
receiveCompanyId(val) {
|
|
receiveCompanyId(val) {
|
|
|
console.log(val, 'vval')
|
|
console.log(val, 'vval')
|
|
|
this.planForm.consigneeId = val
|
|
this.planForm.consigneeId = val
|
|
|
|
|
+ this.planForm.receiveCompanyId = val
|
|
|
this.getOyeSaleArea({ consigneeId: val })
|
|
this.getOyeSaleArea({ consigneeId: val })
|
|
|
},
|
|
},
|
|
|
province(val) {
|
|
province(val) {
|
|
@@ -774,7 +808,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
dialogVisible(val) {
|
|
dialogVisible(val) {
|
|
|
if (val) {
|
|
if (val) {
|
|
|
- this.getOyeConsigneeId()
|
|
|
|
|
|
|
+ this.getOyeConsigneeId(this.planForm)
|
|
|
this.getOyeSaleArea()
|
|
this.getOyeSaleArea()
|
|
|
} else {
|
|
} else {
|
|
|
this.planForm.receiveId = ''
|
|
this.planForm.receiveId = ''
|
|
@@ -808,6 +842,8 @@ export default {
|
|
|
getInfo() {
|
|
getInfo() {
|
|
|
this.loginName = getCookie('loginName')
|
|
this.loginName = getCookie('loginName')
|
|
|
this.orgCode = getCookie('orgCode')
|
|
this.orgCode = getCookie('orgCode')
|
|
|
|
|
+ this.userId = getCookie('userId')
|
|
|
|
|
+ this.userName = JSON.parse(getCookie('userInfo')).userName
|
|
|
},
|
|
},
|
|
|
getRequestUrl() {
|
|
getRequestUrl() {
|
|
|
this.approvingOptions.requestUrl =
|
|
this.approvingOptions.requestUrl =
|
|
@@ -818,6 +854,9 @@ export default {
|
|
|
let queryOp = {}
|
|
let queryOp = {}
|
|
|
queryOp[this.screen] = [this.con]
|
|
queryOp[this.screen] = [this.con]
|
|
|
queryOp[this.screen1] = [this.con1]
|
|
queryOp[this.screen1] = [this.con1]
|
|
|
|
|
+ if (this.orgCode == 'shouhuokehu') {
|
|
|
|
|
+ queryOp['consigneeName'] = this.userName
|
|
|
|
|
+ }
|
|
|
this.approvingOptions.requestQuery = {
|
|
this.approvingOptions.requestQuery = {
|
|
|
orderStatus: 0,
|
|
orderStatus: 0,
|
|
|
deleted: 0,
|
|
deleted: 0,
|
|
@@ -871,11 +910,18 @@ export default {
|
|
|
this.title = '新增转运计划'
|
|
this.title = '新增转运计划'
|
|
|
},
|
|
},
|
|
|
getOyeConsigneeId(data = {}) {
|
|
getOyeConsigneeId(data = {}) {
|
|
|
|
|
+ if (this.orgCode == 'shouhuokehu') {
|
|
|
|
|
+ data.consigneeName = this.userName
|
|
|
|
|
+ }
|
|
|
this.axios.post('/api/v1/uc/getOyeConsigneeId', data).then(res => {
|
|
this.axios.post('/api/v1/uc/getOyeConsigneeId', data).then(res => {
|
|
|
|
|
+ if (res.data.data.length == 1) {
|
|
|
|
|
+ this.planForm.receiveId = res.data.data[0].id
|
|
|
|
|
+ }
|
|
|
this.consigneeInfo = res.data.data || []
|
|
this.consigneeInfo = res.data.data || []
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
getOyeSaleArea(data = {}) {
|
|
getOyeSaleArea(data = {}) {
|
|
|
|
|
+ console.log(data, 'data')
|
|
|
this.axios.post('/api/v1/uc/getOyeSaleArea', data).then(res => {
|
|
this.axios.post('/api/v1/uc/getOyeSaleArea', data).then(res => {
|
|
|
this.saleAreaInfo = res.data.data || []
|
|
this.saleAreaInfo = res.data.data || []
|
|
|
})
|
|
})
|
|
@@ -1005,6 +1051,10 @@ export default {
|
|
|
singleDistribute() {
|
|
singleDistribute() {
|
|
|
console.log(this.materialList)
|
|
console.log(this.materialList)
|
|
|
let ml = this.materialList.length
|
|
let ml = this.materialList.length
|
|
|
|
|
+ if (this.planForm.shipperAddressId == null) {
|
|
|
|
|
+ this.$message.error('请先选择收货地址')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
if (ml == 0) {
|
|
if (ml == 0) {
|
|
|
this.$message.warning('请至少填入一车物资')
|
|
this.$message.warning('请至少填入一车物资')
|
|
|
return
|
|
return
|
|
@@ -1039,6 +1089,10 @@ export default {
|
|
|
},
|
|
},
|
|
|
createACar() {
|
|
createACar() {
|
|
|
let i = 0
|
|
let i = 0
|
|
|
|
|
+ if (this.planForm.shipperAddressId == null) {
|
|
|
|
|
+ this.$message.error('请先选择收货地址')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
this.materialList.forEach(e => {
|
|
this.materialList.forEach(e => {
|
|
|
if (!/(^[1-9]\d*$)/.test(e.orderPlanWeight)) {
|
|
if (!/(^[1-9]\d*$)/.test(e.orderPlanWeight)) {
|
|
|
e.orderPlanWeight = null
|
|
e.orderPlanWeight = null
|
|
@@ -1325,13 +1379,17 @@ export default {
|
|
|
makeSureAddOrder() {
|
|
makeSureAddOrder() {
|
|
|
console.log(this.planForm, 'pl')
|
|
console.log(this.planForm, 'pl')
|
|
|
console.log(this.selectionList, 'se')
|
|
console.log(this.selectionList, 'se')
|
|
|
|
|
+ if (this.selectionList.length == 0) {
|
|
|
|
|
+ this.$message.warning('请至少添加一车数据!')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
let data = { ...this.planForm }
|
|
let data = { ...this.planForm }
|
|
|
data.salerId = data.saleMan
|
|
data.salerId = data.saleMan
|
|
|
data.mapList = this.selectionList
|
|
data.mapList = this.selectionList
|
|
|
- data.isSelfMention = '否'
|
|
|
|
|
this.axios.post('/api/v1/ams/addTransPlan', data).then(res => {
|
|
this.axios.post('/api/v1/ams/addTransPlan', data).then(res => {
|
|
|
if (res.data.status == 'succeed') {
|
|
if (res.data.status == 'succeed') {
|
|
|
this.$message.success('添加成功!')
|
|
this.$message.success('添加成功!')
|
|
|
|
|
+ this.selectionList = []
|
|
|
this.getRequestUrl()
|
|
this.getRequestUrl()
|
|
|
this.dialogVisible = false
|
|
this.dialogVisible = false
|
|
|
} else {
|
|
} else {
|
|
@@ -1343,6 +1401,10 @@ export default {
|
|
|
this.approvingList = [].concat(section)
|
|
this.approvingList = [].concat(section)
|
|
|
},
|
|
},
|
|
|
approve() {
|
|
approve() {
|
|
|
|
|
+ if (this.approvingList.length == 0) {
|
|
|
|
|
+ this.$message.warning('请至少选择一条数据!')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
let arr = this.approvingList.map(item => {
|
|
let arr = this.approvingList.map(item => {
|
|
|
let map = {}
|
|
let map = {}
|
|
|
map.orderStatus = 4
|
|
map.orderStatus = 4
|
|
@@ -1364,6 +1426,7 @@ export default {
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
if (res.data.status == 'succeed') {
|
|
if (res.data.status == 'succeed') {
|
|
|
this.$message.success('审核成功!')
|
|
this.$message.success('审核成功!')
|
|
|
|
|
+ this.approvingList = []
|
|
|
this.getRequestUrl()
|
|
this.getRequestUrl()
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.error(res.data.msg)
|
|
this.$message.error(res.data.msg)
|
|
@@ -1373,11 +1436,17 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
deleteOrder() {
|
|
deleteOrder() {
|
|
|
|
|
+ if (this.approvingList.length == 0) {
|
|
|
|
|
+ this.$message.warning('请至少选择一条数据!')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(this.approvingList, 'arr')
|
|
|
let arr = this.approvingList.map(item => {
|
|
let arr = this.approvingList.map(item => {
|
|
|
let map = {}
|
|
let map = {}
|
|
|
map.orderStatus = this.activeName == 'first' ? 0 : 4
|
|
map.orderStatus = this.activeName == 'first' ? 0 : 4
|
|
|
map.saleOrderId = item.saleOrderId
|
|
map.saleOrderId = item.saleOrderId
|
|
|
map.deleted = 1
|
|
map.deleted = 1
|
|
|
|
|
+ map.saleMaterialId = item.saleMaterialId
|
|
|
return map
|
|
return map
|
|
|
})
|
|
})
|
|
|
this.$confirm('确认删除选中的转运计划', '提示', {
|
|
this.$confirm('确认删除选中的转运计划', '提示', {
|
|
@@ -1392,6 +1461,41 @@ export default {
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
if (res.data.status == 'succeed') {
|
|
if (res.data.status == 'succeed') {
|
|
|
this.$message.success('删除成功!')
|
|
this.$message.success('删除成功!')
|
|
|
|
|
+ this.approvingList = []
|
|
|
|
|
+ this.getRequestUrl()
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.error(res.data.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ submit() {
|
|
|
|
|
+ if (this.approvingList.length == 0) {
|
|
|
|
|
+ this.$message.warning('请至少选择一条数据!')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ let arr = this.approvingList.map(item => {
|
|
|
|
|
+ let map = {}
|
|
|
|
|
+ map.orderStatus = 1
|
|
|
|
|
+ map.saleOrderId = item.saleOrderId
|
|
|
|
|
+ map.deleted = 0
|
|
|
|
|
+ map.orderPlanWeight = item.materialNumber
|
|
|
|
|
+ map.inventoryId = item.inventoryId
|
|
|
|
|
+ return map
|
|
|
|
|
+ })
|
|
|
|
|
+ this.$confirm('确认提交选中的转运计划', '提示', {
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ confirmButtonText: '确定'
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ if (res == 'confirm') {
|
|
|
|
|
+ this.axios
|
|
|
|
|
+ .post('/api/v1/ams/approveTransPlan', {
|
|
|
|
|
+ mapList: arr
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ if (res.data.status == 'succeed') {
|
|
|
|
|
+ this.$message.success('提交成功!')
|
|
|
this.getRequestUrl()
|
|
this.getRequestUrl()
|
|
|
} else {
|
|
} else {
|
|
|
this.$message.error(res.data.msg)
|
|
this.$message.error(res.data.msg)
|