|
@@ -6,10 +6,11 @@
|
|
|
<template slot="subTitle">
|
|
|
<a id="salesReturnEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
|
<span style="margin: 0 10px 0 20px;color: #666;font-size: 14px;font-weight: 600;">退货单号:{{ ordeDetail&&ordeDetail.salesReturnNo||'--' }}</span>
|
|
|
- <a-button type="link" size="small" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo">
|
|
|
+ <a-button id="salesReturnEdit-showDesc-btn" type="link" size="small" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo">
|
|
|
<a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/> {{ isShowBisiceInfo?'隐藏':'查看' }}信息
|
|
|
</a-button>
|
|
|
<a-button
|
|
|
+ id="salesReturnEdit-editInfo-btn"
|
|
|
type="link"
|
|
|
size="small"
|
|
|
@click="handleEditCustom"
|
|
@@ -64,7 +65,7 @@
|
|
|
<div>
|
|
|
折扣金额:
|
|
|
<a-input-number id="discount" v-model="ordeDetail.discountAmount" :min="0" :precision="2" :max="999999"/>
|
|
|
- <a-button type="primary" @click="salesReturnDiscount" class="button-info">打折</a-button>
|
|
|
+ <a-button id="salesReturnEdit-discount-btn" type="primary" @click="salesReturnDiscount" class="button-info">打折</a-button>
|
|
|
</div>
|
|
|
<div>
|
|
|
折扣:<strong>{{ ordeDetail&&(ordeDetail.discountRate || ordeDetail.discountRate==0) ? ordeDetail.discountRate+'%' : '--' }}</strong>;
|
|
@@ -81,12 +82,12 @@
|
|
|
<a-row :gutter="15">
|
|
|
<a-col :md="8" :sm="24">
|
|
|
<a-form-model-item label="产品编码">
|
|
|
- <a-input v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
|
|
|
+ <a-input id="salesReturnEdit-productCode" v-model.trim="productForm.productCode" allowClear placeholder="输入产品编码" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="8" :sm="24">
|
|
|
<a-form-model-item label="产品名称">
|
|
|
- <a-input v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
|
|
|
+ <a-input id="salesReturnEdit-productName" v-model.trim="productForm.productName" allowClear placeholder="输入产品名称" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :md="8" :sm="24">
|
|
@@ -115,7 +116,7 @@
|
|
|
:disabled="chooseLoadData.length==0"
|
|
|
:loading="delLoading"
|
|
|
style="margin-left: 10px"
|
|
|
- id="salesReturn-del-all">清空列表</a-button>
|
|
|
+ id="salesReturn-delAll">清空列表</a-button>
|
|
|
</div>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
@@ -135,7 +136,7 @@
|
|
|
<!-- 本次退货数量 -->
|
|
|
<template slot="qty" slot-scope="text, record">
|
|
|
<a-input-number
|
|
|
- id="salesReturn-qty"
|
|
|
+ :id="'salesReturn-qty-'+record.id"
|
|
|
size="small"
|
|
|
v-model="record.qty"
|
|
|
:precision="0"
|
|
@@ -148,7 +149,7 @@
|
|
|
<!-- 废品数量 -->
|
|
|
<template slot="celQty" slot-scope="text, record">
|
|
|
<a-input-number
|
|
|
- id="salesReturn-celQty"
|
|
|
+ :id="'salesReturn-celQty-'+record.id"
|
|
|
size="small"
|
|
|
v-model="record.celQty"
|
|
|
:precision="0"
|
|
@@ -161,7 +162,7 @@
|
|
|
<!-- 价格 -->
|
|
|
<template slot="price" slot-scope="text, record">
|
|
|
<a-input-number
|
|
|
- id="salesReturn-price"
|
|
|
+ :id="'salesReturn-price-'+record.id"
|
|
|
size="small"
|
|
|
v-model="record.price"
|
|
|
:precision="2"
|
|
@@ -184,7 +185,7 @@
|
|
|
expand-trigger="hover"
|
|
|
:options="warehouseCascadeData"
|
|
|
:fieldNames="{ label: 'name', value: 'sn', children: 'warehouseLocationList' }"
|
|
|
- id="bulkWarehousingOrderEdit-warehouseCascade"
|
|
|
+ :id="'salesReturn-warehouseCascade-'+record.id"
|
|
|
placeholder="请选择仓库仓位"
|
|
|
style="width: 100%;" />
|
|
|
</template>
|
|
@@ -196,12 +197,12 @@
|
|
|
:loading="delLoading"
|
|
|
class="button-error"
|
|
|
@click="handleDel(record)"
|
|
|
- id="salesReturn-Del">删除</a-button>
|
|
|
+ :id="'salesReturn-del-'+record.id"
|
|
|
+ >删除</a-button>
|
|
|
</template>
|
|
|
</s-table>
|
|
|
</a-card>
|
|
|
</a-spin>
|
|
|
- <!-- <div class="affix-cont"></div> -->
|
|
|
<!-- 选择客户弹框 -->
|
|
|
<choose-custom-modal ref="editCustomModal" :show="openModal" @ok="chooseCustomOk" @cancel="openModal=false"></choose-custom-modal>
|
|
|
</div>
|
|
@@ -210,12 +211,14 @@
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
+import Print from '@/views/common/print.vue'
|
|
|
+import { hdPrint } from '@/libs/JGPrint'
|
|
|
import queryPart from './queryPart.vue'
|
|
|
import chooseCustomModal from './chooseCustomModal.vue'
|
|
|
+// 接口
|
|
|
import { warehouseCascadeList } from '@/api/warehouse'
|
|
|
import { salesReturnDetail, salesReturnQueryCount, salesReturnDetailList, salesReturnDiscount, salesReturnDelAll, salesReturnDetailDel, salesReturnSaveProduct, salesReturnSubmit, salesReturnDetailPrint, salesDetailExport } from '@/api/salesReturn'
|
|
|
-import Print from '@/views/common/print.vue'
|
|
|
-import { hdPrint } from '@/libs/JGPrint'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'SalesReturnEdit',
|
|
|
components: {
|
|
@@ -230,23 +233,23 @@ export default {
|
|
|
const _this = this
|
|
|
return {
|
|
|
spinning: false,
|
|
|
- orderId: null,
|
|
|
- orderSn: null,
|
|
|
- buyerSn: null,
|
|
|
disabled: false,
|
|
|
- openModal: false,
|
|
|
+ orderId: null, // 单据id
|
|
|
+ orderSn: null, // 单据sn
|
|
|
+ buyerSn: null, // 客户sn
|
|
|
+ openModal: false, // 选择客户弹框
|
|
|
isInster: false, // 是否正在添加产品
|
|
|
- ordeDetail: { discountAmount: 0 },
|
|
|
- delLoading: false,
|
|
|
+ ordeDetail: { discountAmount: 0 }, // 单据详情信息
|
|
|
+ delLoading: false, // 添加删除按钮loading
|
|
|
warehouseCascadeData: [], // 仓库仓位
|
|
|
// 已选产品
|
|
|
dataSource: [],
|
|
|
productForm: {
|
|
|
- productCode: '',
|
|
|
- productName: '',
|
|
|
- orderBy: 'sales_return_bill_detail.CREATE_DATE desc'
|
|
|
+ productCode: '', // 产品编码
|
|
|
+ productName: '', // 产品名称
|
|
|
+ orderBy: 'sales_return_bill_detail.CREATE_DATE desc' // 排序
|
|
|
},
|
|
|
- countData: null,
|
|
|
+ countData: null, // 统计信息
|
|
|
// 表头
|
|
|
columns: [
|
|
|
{ title: '序号', dataIndex: 'no', align: 'center', width: '4%' },
|
|
@@ -262,7 +265,7 @@ export default {
|
|
|
{ title: '折后金额小计', dataIndex: 'discountedAmount', align: 'right', width: '8%', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
|
|
|
],
|
|
|
- chooseLoadData: [],
|
|
|
+ chooseLoadData: [], // 已选列表原始数据
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
@@ -279,6 +282,7 @@ export default {
|
|
|
data.list[i].qtyBackups = data.list[i].qty
|
|
|
data.list[i].celQtyBackups = data.list[i].celQty
|
|
|
data.list[i].priceBackups = data.list[i].price
|
|
|
+ // 仓库仓位
|
|
|
const warehouseSn = data.list[i].warehouseSn || undefined
|
|
|
const warehouseLocationSn = data.list[i].warehouseLocationSn || undefined
|
|
|
if (warehouseSn || warehouseLocationSn) {
|
|
@@ -296,24 +300,25 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
printerType: 'NEEDLE', // 打印机类型
|
|
|
- isShowBisiceInfo: false
|
|
|
+ isShowBisiceInfo: false // 是否显示详情信息
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- // 返回
|
|
|
+ // 返回列表
|
|
|
handleBack () {
|
|
|
- this.$router.push({ path: '/salesManagement/salesReturn/list' })
|
|
|
+ this.$router.push({ name: 'salesReturnList' })
|
|
|
},
|
|
|
// 选择客户成功
|
|
|
chooseCustomOk (data) {
|
|
|
this.openModal = false
|
|
|
this.getOrderDetail()
|
|
|
},
|
|
|
+ // 编辑客户
|
|
|
handleEditCustom () {
|
|
|
this.openModal = true
|
|
|
this.$refs.editCustomModal.editCust(this.ordeDetail)
|
|
|
},
|
|
|
- // 已选产品 blur
|
|
|
+ // 已选产品,修改数量、价格、废品数量
|
|
|
onCellBlur (val, record, type) {
|
|
|
let valBackups
|
|
|
if (type == 'qty') {
|
|
@@ -325,6 +330,7 @@ export default {
|
|
|
}
|
|
|
// 光标移出,值发生改变再调用编辑接口
|
|
|
if (val && val != valBackups) {
|
|
|
+ // 废品数量不可大于本次退货数量
|
|
|
if (Number(record.celQty) > Number(record.qty)) {
|
|
|
this.$message.info('废品数量不可大于本次退货数量')
|
|
|
this.reductionVal(record, type, valBackups)
|
|
@@ -335,6 +341,7 @@ export default {
|
|
|
this.reductionVal(record, type, valBackups)
|
|
|
}
|
|
|
},
|
|
|
+ // 恢复原值
|
|
|
reductionVal (record, type, valBackups) {
|
|
|
if (type == 'qty') {
|
|
|
record.qty = valBackups
|
|
@@ -365,6 +372,7 @@ export default {
|
|
|
// 修改仓库仓位
|
|
|
changeWarehouseCascade (val, opt, ind) {
|
|
|
let loadData = this.chooseLoadData[ind]
|
|
|
+ // 仓库无仓位
|
|
|
if (val.length < 2) {
|
|
|
this.$message.warning('当前仓库无仓位,请选择其他仓库')
|
|
|
const warehouseSnBackups = loadData.warehouseSnBackups || undefined
|
|
@@ -405,6 +413,7 @@ export default {
|
|
|
salesReturnDetail({ sn: this.orderSn }).then(res => {
|
|
|
this.ordeDetail = res.data || null
|
|
|
if (!flag) {
|
|
|
+ // 查询产品列表
|
|
|
this.$refs.queryPart.pageInit(this.buyerSn, this.ordeDetail && this.ordeDetail.priceType || '')
|
|
|
}
|
|
|
})
|
|
@@ -418,6 +427,7 @@ export default {
|
|
|
id: this.ordeDetail.id
|
|
|
}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
+ // 获取详情,并刷新已选产品列表
|
|
|
this.getOrderDetail(true)
|
|
|
this.$refs.table.refresh(true)
|
|
|
this.spinning = false
|
|
@@ -479,7 +489,6 @@ export default {
|
|
|
},
|
|
|
// 添加或修改产品
|
|
|
saveProduct (row, type) {
|
|
|
- console.log(row)
|
|
|
// 防止多次添加产品
|
|
|
if (this.isInster) {
|
|
|
return
|
|
@@ -506,10 +515,8 @@ export default {
|
|
|
params.id = row.id
|
|
|
params.qty = row.qty
|
|
|
} else {
|
|
|
+ // 新增
|
|
|
params.salesQty = row.qty
|
|
|
- // 默认仓库
|
|
|
- // params.warehouseLocationSn = '100000000165'
|
|
|
- // params.warehouseSn = '100000000156'
|
|
|
}
|
|
|
this.spinning = true
|
|
|
salesReturnSaveProduct(params).then(res => {
|
|
@@ -548,6 +555,7 @@ export default {
|
|
|
_this.spinning = false
|
|
|
})
|
|
|
},
|
|
|
+ // 页面初始化
|
|
|
pageInit () {
|
|
|
this.orderId = this.$route.params.id
|
|
|
this.orderSn = this.$route.params.sn
|