|
@@ -212,7 +212,7 @@ import moment from 'moment'
|
|
|
import locale from 'ant-design-vue/es/date-picker/locale/zh_CN'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import selectGlOrderModal from './selectGlOrderModal.vue'
|
|
|
-import { sendBillInsert, sendBillFindBySn, sendBillUpdate } from '@/api/sendBill'
|
|
|
+import { sendBillInsert, sendBillFindBySn, sendBillUpdate, deleteSendBillStockOut } from '@/api/sendBill'
|
|
|
export default {
|
|
|
name: 'SendGoodModal',
|
|
|
components: { STable, VSelect, selectGlOrderModal },
|
|
@@ -319,9 +319,22 @@ export default {
|
|
|
},
|
|
|
// 删除出库单
|
|
|
delStockOutList (row) {
|
|
|
- const i = this.sendBillStockOutList.findIndex(item => row.stockOutSn == item.stockOutSn)
|
|
|
- this.sendBillStockOutList.splice(i, 1)
|
|
|
- this.getProductTotal()
|
|
|
+ const ri = this.sendBillStockOutList.findIndex(item => row.stockOutSn == item.stockOutSn)
|
|
|
+ // 新加的
|
|
|
+ if (row.id) {
|
|
|
+ this.sendBillStockOutList.splice(ri, 1)
|
|
|
+ this.getProductTotal()
|
|
|
+ } else {
|
|
|
+ // 删除后修改发货状态
|
|
|
+ this.spinning = true
|
|
|
+ deleteSendBillStockOut({ stockOutSn: row.stockOutSn, sendBillSn: this.form.sendBillSn }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.sendBillStockOutList.splice(ri, 1)
|
|
|
+ this.getProductTotal()
|
|
|
+ }
|
|
|
+ this.spinning = false
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
// 编辑
|
|
|
getDetail (data) {
|
|
@@ -375,7 +388,8 @@ export default {
|
|
|
// 计算运费合计
|
|
|
getTotalSendAmount () {
|
|
|
let ret = 0
|
|
|
- this.tableData.map(item => {
|
|
|
+ this.tableData.map((item, i) => {
|
|
|
+ item.no = i + 1
|
|
|
ret = ret + Number(item.totalAmount || 0)
|
|
|
})
|
|
|
this.form.totalSendAmount = ret.toFixed(2)
|
|
@@ -389,9 +403,6 @@ export default {
|
|
|
// 删除
|
|
|
handleDel (row, index) {
|
|
|
this.tableData.splice(index, 1)
|
|
|
- this.tableData.map((item, i) => {
|
|
|
- item.no = i + 1
|
|
|
- })
|
|
|
this.getTotalSendAmount()
|
|
|
},
|
|
|
// 添加
|