|
@@ -48,29 +48,6 @@
|
|
|
clearable
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <label class="el-form-item__label" style="width: auto;"
|
|
|
- >订单日期:</label
|
|
|
- >
|
|
|
- <el-date-picker
|
|
|
- v-model="startTime"
|
|
|
- type="date"
|
|
|
- placeholder="选择日期"
|
|
|
- style="width:150px"
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
- <span>至</span>
|
|
|
- <el-date-picker
|
|
|
- v-model="endTime"
|
|
|
- type="date"
|
|
|
- placeholder="选择日期"
|
|
|
- style="width:150px"
|
|
|
- >
|
|
|
- </el-date-picker>
|
|
|
- <el-button type="primary" class="btn" @click="onclick">
|
|
|
- <i class="el-icon-search"></i>
|
|
|
- </el-button>
|
|
|
- </el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="exportAllReportToExcel"
|
|
|
>下载Excel</el-button
|
|
@@ -158,6 +135,28 @@
|
|
|
:filters="filterSaleAreaList"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="closeEntryId"
|
|
|
+ label="金蝶分录ID"
|
|
|
+ width="150px"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="entryStatus"
|
|
|
+ label="分录状态"
|
|
|
+ width="100px"
|
|
|
+ show-overflow-tooltip
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="saleRemark"
|
|
|
+ label="摘要"
|
|
|
+ width="150px"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="carrierName"
|
|
|
label="承运商"
|
|
@@ -195,7 +194,6 @@
|
|
|
label="物资规格"
|
|
|
align="center"
|
|
|
sortable
|
|
|
- show-overflow-tooltip
|
|
|
width="120px"
|
|
|
>
|
|
|
</el-table-column>
|
|
@@ -304,13 +302,6 @@
|
|
|
show-overflow-tooltip
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="closeEntryId"
|
|
|
- label="金蝶分录ID"
|
|
|
- width="100px"
|
|
|
- show-overflow-tooltip
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -479,6 +470,7 @@ export default {
|
|
|
'saleArea'
|
|
|
],
|
|
|
saleOrderMapList: [
|
|
|
+ 'orderNo',
|
|
|
'truckNo',
|
|
|
'province',
|
|
|
'district',
|
|
@@ -493,12 +485,23 @@ export default {
|
|
|
'materialNumber',
|
|
|
'steelMeters',
|
|
|
'isPoundSale'
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ saleDateOfReceipt: null
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- if (this.orgCodeList.includes(getCookie('orgCode'))) {
|
|
|
- this.isShowOperate = true
|
|
|
+ let loadTime1 = new Date(
|
|
|
+ new Date(new Date().toLocaleDateString()).getTime() +
|
|
|
+ (3600 * 1000 * 8 - 1)
|
|
|
+ ) // 当天8点前
|
|
|
+ let loadTime2 = new Date(
|
|
|
+ new Date(new Date().toLocaleDateString()).getTime() +
|
|
|
+ (3600 * 1000 * 32 - 1)
|
|
|
+ ) // 次天8点前
|
|
|
+ if (new Date().getTime() - loadTime1 > 0) {
|
|
|
+ this.saleDateOfReceipt = loadTime2
|
|
|
+ } else {
|
|
|
+ this.saleDateOfReceipt = loadTime1
|
|
|
}
|
|
|
this.getSteelReport()
|
|
|
},
|
|
@@ -506,6 +509,7 @@ export default {
|
|
|
tableData: {
|
|
|
handler(oldVal, newVal) {
|
|
|
this.filterListChange()
|
|
|
+ this.toggleSelection(newVal)
|
|
|
},
|
|
|
deep: true,
|
|
|
immediate: true
|
|
@@ -526,6 +530,11 @@ export default {
|
|
|
},
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
+ toggleSelection() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.tableRef.toggleAllSelection()
|
|
|
+ })
|
|
|
+ },
|
|
|
handleSelectionChange() {},
|
|
|
//记录每一行的合并数
|
|
|
getSpanArr(data) {
|
|
@@ -565,12 +574,24 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
addSaleOrder() {
|
|
|
- this.tableData.forEach(e => {
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '正在快马加鞭为您生成上传销售订单,请稍候',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ })
|
|
|
+ let closeEntryList = []
|
|
|
+ this.$refs.tableRef.selection.forEach(e => {
|
|
|
+ let map = {}
|
|
|
e.saleRemark = `${this.getRemarkDate()}${e.areaName},直发${
|
|
|
e.addressDistrict
|
|
|
}`
|
|
|
+ map.saleMaterialId = e.saleMaterialId
|
|
|
+ map.closeEntryId = e.closeEntryId
|
|
|
+ map.number = e.saleOrderNo
|
|
|
+ closeEntryList.push(map)
|
|
|
})
|
|
|
- const map1 = this.tableData.reduce((result, item) => {
|
|
|
+ const map1 = this.$refs.tableRef.selection.reduce((result, item) => {
|
|
|
result[item.saleOrderNo] = result[item.saleOrderNo] || []
|
|
|
result[item.saleOrderNo].push(item)
|
|
|
return result
|
|
@@ -597,9 +618,51 @@ export default {
|
|
|
})
|
|
|
map.shipperId = 1
|
|
|
map.mapList = arr
|
|
|
+ map.isUploadEas = 1
|
|
|
saleOrderListMap.push(map)
|
|
|
})
|
|
|
- console.log(saleOrderListMap)
|
|
|
+ this.axios
|
|
|
+ .post('/api/v1/ams/addSteelSaleOrderList', saleOrderListMap)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == '200') {
|
|
|
+ loading.close()
|
|
|
+ this.getSteelReport()
|
|
|
+ this.$message.success('新增上传销售订单成功!')
|
|
|
+ this.tableData = []
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.data.data)
|
|
|
+ this.getSteelReport()
|
|
|
+ loading.close()
|
|
|
+ this.tableData = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.$message.error('生成错误!')
|
|
|
+ loading.close()
|
|
|
+ this.tableData = []
|
|
|
+ })
|
|
|
+ const loadings = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '正在关闭上一个分录,请稍候',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ })
|
|
|
+ this.axios
|
|
|
+ .post('/api/v1/ams/closingEntries', closeEntryList)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code == '200') {
|
|
|
+ loadings.close()
|
|
|
+ this.$message.success('关闭成功')
|
|
|
+ } else {
|
|
|
+ this.$message.error('关闭失败')
|
|
|
+ this.getSteelReport()
|
|
|
+ loadings.close()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.$message.error('关闭错误!')
|
|
|
+ loadings.close()
|
|
|
+ })
|
|
|
},
|
|
|
getRemarkDate() {
|
|
|
let day = new Date().getDate()
|
|
@@ -731,29 +794,6 @@ export default {
|
|
|
//筛选
|
|
|
//筛选客户
|
|
|
//点击操作弹出框
|
|
|
- operation(row) {
|
|
|
- this.isRowClick = 0
|
|
|
- if (Object.values(this.steelMap).length == 0) {
|
|
|
- this.$message.error('请点击需要执行更改操作的行!')
|
|
|
- return
|
|
|
- }
|
|
|
- if (typeof row === 'undefined') {
|
|
|
- row = this.steelMap
|
|
|
- }
|
|
|
- this.axios
|
|
|
- .post(
|
|
|
- '/api/v1/tms/getSteelReportDetailsBySmId?saleOrderMaterialId=' +
|
|
|
- row.saleOrderMaterialId
|
|
|
- )
|
|
|
- .then(res => {
|
|
|
- this.steelMap = res.data.data
|
|
|
- this.addressId = row.shipperAddressId
|
|
|
- this.getAllProvince()
|
|
|
- this.onchangeProvince()
|
|
|
- this.onchangeCity()
|
|
|
- this.centerDialogVisible = true
|
|
|
- })
|
|
|
- },
|
|
|
//销售钢材报表导出excel
|
|
|
exportAllReportToExcel() {
|
|
|
const loading = this.$loading({
|