|
@@ -834,27 +834,39 @@ export default {
|
|
|
map.mapList = arr
|
|
|
saleOrderListMap.push(map)
|
|
|
})
|
|
|
- this.axios
|
|
|
- .post('/api/v1/ams/addSteelSaleOrderList', saleOrderListMap)
|
|
|
- .then(res => {
|
|
|
- if (res.data.code == '200') {
|
|
|
- this.getRequestUrl()
|
|
|
- this.tableData = []
|
|
|
- loading.close()
|
|
|
- this.$message.success('新增销售订单成功!')
|
|
|
- } else {
|
|
|
- console.log(res.data.data)
|
|
|
- this.$message.error(res.data.data)
|
|
|
- this.getRequestUrl()
|
|
|
+ if (saleOrderListMap.length > 0) {
|
|
|
+ this.axios
|
|
|
+ .post('/api/v1/ams/addSteelSaleOrderList', saleOrderListMap)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == '200') {
|
|
|
+ this.getRequestUrl()
|
|
|
+ this.tableData = []
|
|
|
+ loading.close()
|
|
|
+ this.$message.success('新增销售订单成功!')
|
|
|
+ } else {
|
|
|
+ console.log(res.data.data)
|
|
|
+ this.$message.error(res.data.data)
|
|
|
+ this.getRequestUrl()
|
|
|
+ loading.close()
|
|
|
+ this.tableData = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
loading.close()
|
|
|
+ this.$message.error('请检查excel格式')
|
|
|
this.tableData = []
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- loading.close()
|
|
|
- this.$message.error('请检查excel格式')
|
|
|
- this.tableData = []
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ duration: 3500,
|
|
|
+ offset: 250,
|
|
|
+ message:
|
|
|
+ '该Excel系统未识别到订单,请仔细检查格式。(销售订单必须在第一个sheet,且必须遵循导入模板!)'
|
|
|
})
|
|
|
+ this.tableData = []
|
|
|
+ loading.close()
|
|
|
+ }
|
|
|
},
|
|
|
adverseCloseSaleOrder(row) {
|
|
|
console.log(row)
|