|
@@ -18,68 +18,68 @@
|
|
|
<a-row>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
<a-form-model-item label="申请人" prop="applyPersonSn">
|
|
|
- <employee style="width: 100%;" id="billOfLading-Employee" v-model="form.applyPersonSn"></employee>
|
|
|
+ <employee style="width: 100%;" id="billOfLading-Employee" @change="employeeChange" v-model="form.applyPersonSn"></employee>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
- <a-form-model-item label="主题" prop="code">
|
|
|
+ <a-form-model-item label="主题" prop="theme">
|
|
|
<a-input
|
|
|
- id="billOfLadingEdit-code"
|
|
|
+ id="billOfLadingEdit-theme"
|
|
|
:maxLength="30"
|
|
|
- v-model.trim="form.code"
|
|
|
+ v-model.trim="form.theme"
|
|
|
placeholder="请输入主题(最多30个字符)"
|
|
|
allowClear />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
- <a-form-model-item label="物流公司" prop="origCode">
|
|
|
- <a-input
|
|
|
- id="billOfLadingEdit-origCode"
|
|
|
- v-model.trim="form.origCode"
|
|
|
- placeholder="请选择物流公司"
|
|
|
- allowClear />
|
|
|
+ <a-form-model-item label="物流公司">
|
|
|
+ <logisticsCompany
|
|
|
+ id="billOfLadingEdit-logisticsCompany"
|
|
|
+ @change="ltcChange"
|
|
|
+ v-model="form.logisticsCompany"
|
|
|
+ />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
- <a-form-model-item label="物流点" prop="otherCode">
|
|
|
- <a-input
|
|
|
- id="billOfLadingEdit-otherCode"
|
|
|
- v-model.trim="form.otherCode"
|
|
|
- placeholder="请选择物流点"
|
|
|
+ <a-form-model-item label="物流点">
|
|
|
+ <logisticsPoint
|
|
|
+ ref="logisticsPoint"
|
|
|
+ id="billOfLadingEdit-logisticsPoint"
|
|
|
+ v-model.trim="form.logisticsPoint"
|
|
|
allowClear />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
<a-form-model-item label="发货方">
|
|
|
- <dealerSubareaScopeList ref="dealerSubareaScopeList" id="billOfLadingEdit-buyerSn" @change="custChange" />
|
|
|
+ <dealerSubareaScopeList ref="dealerSubareaScopeList" id="billOfLadingEdit-senderName" @change="custChange" />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
- <a-form-model-item label="收货人" prop="qrCode">
|
|
|
+ <a-form-model-item label="收货人">
|
|
|
<a-input
|
|
|
- id="billOfLadingEdit-qrCode"
|
|
|
+ id="billOfLadingEdit-receiverName"
|
|
|
:maxLength="30"
|
|
|
- v-model.trim="form.qrCode"
|
|
|
+ v-model.trim="form.receiverName"
|
|
|
placeholder="请输入收货人(最多30个字符)"
|
|
|
allowClear />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
- <a-form-model-item label="电话" prop="qrCode">
|
|
|
+ <a-form-model-item label="电话">
|
|
|
<a-input
|
|
|
- id="billOfLadingEdit-qrCode"
|
|
|
+ id="billOfLadingEdit-receiverPhone"
|
|
|
:maxLength="30"
|
|
|
- v-model.trim="form.qrCode"
|
|
|
+ v-model.trim="form.receiverPhone"
|
|
|
placeholder="请输入电话(最多30个字符)"
|
|
|
allowClear />
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
|
|
- <a-form-model-item label="件数" prop="packQty">
|
|
|
+ <a-form-model-item label="件数">
|
|
|
<a-input-number
|
|
|
- id="billOfLadingEdit-packQty"
|
|
|
+ id="billOfLadingEdit-goodsNum"
|
|
|
style="width:100%"
|
|
|
- v-model="form.packQty"
|
|
|
+ v-model="form.goodsNum"
|
|
|
:precision="0"
|
|
|
:min="1"
|
|
|
:max="999999"
|
|
@@ -90,9 +90,9 @@
|
|
|
<a-col :span="24">
|
|
|
<a-form-model-item label="运费" :label-col="{span:2}" :wrapper-col="{span:20}">
|
|
|
<a-input
|
|
|
- id="billOfLadingEdit-qrCode"
|
|
|
+ id="billOfLadingEdit-freight"
|
|
|
:maxLength="100"
|
|
|
- v-model.trim="form.qrCode"
|
|
|
+ v-model.trim="form.freight"
|
|
|
placeholder="请输入运费(最多100个字符)"
|
|
|
allowClear />
|
|
|
</a-form-model-item>
|
|
@@ -100,10 +100,10 @@
|
|
|
</a-row>
|
|
|
<a-row>
|
|
|
<a-col :spna="24">
|
|
|
- <a-form-model-item style="margin-bottom:0" label="备注" prop="size" :label-col="{span:2}" :wrapper-col="{span:20}">
|
|
|
+ <a-form-model-item style="margin-bottom:0" label="备注" :label-col="{span:2}" :wrapper-col="{span:20}">
|
|
|
<a-textarea
|
|
|
- v-model.trim="form.size"
|
|
|
- id="billOfLadingEdit-size"
|
|
|
+ v-model.trim="form.remarks"
|
|
|
+ id="billOfLadingEdit-remarks"
|
|
|
:maxLength="500"
|
|
|
allowClear
|
|
|
placeholder="请输入备注(最多500个字符)" />
|
|
@@ -114,7 +114,7 @@
|
|
|
<Upload
|
|
|
style="height: 100%;"
|
|
|
id="billOfLadingEdit-attachList"
|
|
|
- v-model="form.expenseAccountFilesList"
|
|
|
+ v-model="form.attachmentList"
|
|
|
ref="attachList"
|
|
|
:fileSize="10"
|
|
|
:maxNums="10"
|
|
@@ -135,7 +135,7 @@
|
|
|
<span>{{ index+1 }}</span>
|
|
|
</template>
|
|
|
<!-- 单号 -->
|
|
|
- <template slot="salesReturnBillNo" slot-scope="text, record">
|
|
|
+ <template slot="salesReturnNo" slot-scope="text, record">
|
|
|
<span>{{ record.salesReturnBillNo }}</span>
|
|
|
</template>
|
|
|
<!-- 操作 -->
|
|
@@ -176,7 +176,12 @@
|
|
|
style="padding: 0 60px;">提交</a-button>
|
|
|
</div>
|
|
|
<!-- 关联销退单 -->
|
|
|
- <selectXtModal ref="selXtModal" modalTit="选择销退单" :chooseData="chooseData" :openModal="showXtModal" @cancel="showXtModal=false"></selectXtModal>
|
|
|
+ <selectXtModal
|
|
|
+ ref="selXtModal"
|
|
|
+ modalTit="选择销退单"
|
|
|
+ :chooseData="chooseData"
|
|
|
+ :openModal="showXtModal"
|
|
|
+ @cancel="showXtModal=false"></selectXtModal>
|
|
|
<!-- 选择审核人员 -->
|
|
|
<chooseDepartUserModal :openModal="openDepartUserModal" @close="openDepartUserModal=false" @submit="handleSubmit"></chooseDepartUserModal>
|
|
|
</div>
|
|
@@ -185,75 +190,58 @@
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
import { STable, VSelect, Upload } from '@/components'
|
|
|
-import { productSave, productSnDetail } from '@/api/product'
|
|
|
+import { pickUpSave, pickUpSubmit, pickUpDetail, pickUpDetailQueryList } from '@/api/pickUp'
|
|
|
import selectXtModal from './selectXtModal.vue'
|
|
|
import employee from '../../expenseManagement/expenseReimbursement/employee.js'
|
|
|
+import logisticsCompany from './logisticsCompany.js'
|
|
|
+import logisticsPoint from './logisticsPoint'
|
|
|
import chooseDepartUserModal from '../../expenseManagement/expenseReimbursement/chooseDepartUserModal.vue'
|
|
|
import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
|
|
|
export default {
|
|
|
name: 'ProductInfoEdit',
|
|
|
mixins: [commonMixin],
|
|
|
- components: { VSelect, Upload, STable, employee, dealerSubareaScopeList, chooseDepartUserModal, selectXtModal },
|
|
|
+ components: { VSelect, Upload, STable, employee, dealerSubareaScopeList, chooseDepartUserModal, selectXtModal, logisticsCompany, logisticsPoint },
|
|
|
data () {
|
|
|
return {
|
|
|
spinning: false,
|
|
|
showXtModal: false,
|
|
|
openDepartUserModal: false,
|
|
|
+ pickUpSn: '',
|
|
|
formItemLayout: {
|
|
|
labelCol: { span: 4 },
|
|
|
wrapperCol: { span: 16 }
|
|
|
},
|
|
|
attachAction: process.env.VUE_APP_API_BASE_URL + '/uploadGetFileInfo',
|
|
|
form: {
|
|
|
- applyPersonSn: '', // 申请人
|
|
|
- applyPersonName: '',
|
|
|
- code: '', // 产品编码
|
|
|
- origCode: '', // 原厂编码
|
|
|
- otherCode: '', // 其他编码
|
|
|
- productBrandSn: undefined, // 产品品牌
|
|
|
- productTypeSn1: '', // 产品一级分类
|
|
|
- productTypeSn2: '', // 产品二级分类
|
|
|
- productTypeSn3: '', // 产品三级分类
|
|
|
- productType: [], // 产品分类
|
|
|
- unit: undefined, // 单位
|
|
|
- packQty: '', // 包装数
|
|
|
- packQtyUnit: undefined, // 包装数单位
|
|
|
- arrowFalg: undefined, // 是否箭冠产品
|
|
|
- qrCode: '',
|
|
|
- productMsg: '', // 产品图片
|
|
|
- size: '', // 产品尺寸
|
|
|
- weight: '', // 产品重量
|
|
|
- color: undefined, // 颜色
|
|
|
- boxSize: '', // 内核尺寸
|
|
|
- description: '', // 产品说明
|
|
|
- otherDesc: '' // 其他说明
|
|
|
+ applyPersonSn: undefined, // 申请人
|
|
|
+ applyPersonName: undefined,
|
|
|
+ theme: '', // 主题
|
|
|
+ logisticsCompany: undefined, // 物流公司
|
|
|
+ logisticsPoint: undefined, // 物流点
|
|
|
+ senderName: '', // 发货方
|
|
|
+ senderSn: '',
|
|
|
+ receiverName: '', // 收货人
|
|
|
+ receiverPhone: '', // 电话
|
|
|
+ goodsNum: '', // 件数
|
|
|
+ freight: '', // 运费
|
|
|
+ remarks: '',
|
|
|
+ attachmentList: '' // 附件
|
|
|
},
|
|
|
+ attachList: [],
|
|
|
rules: {
|
|
|
applyPersonSn: [
|
|
|
{ required: true, message: '请选择申请人', trigger: 'blur' }
|
|
|
],
|
|
|
- code: [
|
|
|
- { required: true, message: '请输入产品编码', trigger: 'blur' }
|
|
|
- ],
|
|
|
- productBrandSn: [
|
|
|
- { required: true, message: '请选择产品品牌', trigger: 'change' }
|
|
|
- ],
|
|
|
- productType: [
|
|
|
- { required: true, message: '请选择产品分类', trigger: 'change' }
|
|
|
- ],
|
|
|
- unit: [
|
|
|
- { required: true, message: '请选择单位', trigger: 'change' }
|
|
|
- ],
|
|
|
- arrowFalg: [
|
|
|
- { required: true, message: '请选择是否为箭冠产品', trigger: 'change' }
|
|
|
+ theme: [
|
|
|
+ { required: true, message: '请输入主题', trigger: 'blur' }
|
|
|
]
|
|
|
},
|
|
|
chooseData: [],
|
|
|
columns: [
|
|
|
{ title: '序号', scopedSlots: { customRender: 'no' }, width: '8%', align: 'center' },
|
|
|
- { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnBillNo' }, width: '15%', align: 'center' },
|
|
|
+ { title: '总部销退单号', scopedSlots: { customRender: 'salesReturnNo' }, width: '15%', align: 'center' },
|
|
|
{ title: '客户名称', dataIndex: 'buyerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
- { title: '申请退货数量', dataIndex: 'totalQty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '申请退货数量', dataIndex: 'totalBackStockQty', width: '15%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '审核时间', dataIndex: 'auditTime', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '业务状态', dataIndex: 'billStatusDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: '12%', align: 'center' }
|
|
@@ -262,23 +250,49 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
custChange (val) {
|
|
|
- this.queryParam.buyerSn = val.key
|
|
|
+ this.form.senderSn = val.key
|
|
|
+ this.form.senderName = val.name
|
|
|
+ },
|
|
|
+ // 申请人员
|
|
|
+ employeeChange (v, r) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.ruleForm.validateField(['applyPersonSn'])
|
|
|
+ })
|
|
|
},
|
|
|
openSelModal () {
|
|
|
this.showXtModal = true
|
|
|
},
|
|
|
+ ltcChange (v, row) {
|
|
|
+ if (row) {
|
|
|
+ this.$refs.logisticsPoint.getList(row.logisticsPointList)
|
|
|
+ this.form.logisticsPoint = undefined
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 关联销售退货单
|
|
|
+ getReturnOrderList () {
|
|
|
+ pickUpDetailQueryList({ pickUpSn: this.$route.params.sn }).then(res => {
|
|
|
+ this.chooseData = []
|
|
|
+ res.data.map(item => {
|
|
|
+ this.chooseData.push(item.salesReturnBillEntity)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
// 详情
|
|
|
getDetail () {
|
|
|
this.spinning = true
|
|
|
this.disabled = true
|
|
|
- expenseAccountDetail({ expenseAccountSn: this.expenseAccountSn }).then(res => {
|
|
|
+ pickUpDetail({ pickUpSn: this.$route.params.sn }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
const data = res.data
|
|
|
this.form = Object.assign(this.form, data)
|
|
|
// 获取附件列表
|
|
|
- this.form.expenseAccountFilesList = ''
|
|
|
- this.attachList = res.data.expenseAccountFilesList
|
|
|
+ this.form.attachmentList = ''
|
|
|
+ this.attachList = res.data.attachmentList
|
|
|
this.$refs.attachList.setFileList(this.attachList)
|
|
|
+ // 发货方
|
|
|
+ if (this.form.senderSn) {
|
|
|
+ this.$refs.dealerSubareaScopeList.getDetail(this.form.senderSn)
|
|
|
+ }
|
|
|
} else {
|
|
|
this.$refs.ruleForm.resetFields()
|
|
|
}
|
|
@@ -286,33 +300,45 @@ export default {
|
|
|
this.disabled = false
|
|
|
})
|
|
|
},
|
|
|
+ // 删除关联单
|
|
|
+ handleDel (row) {
|
|
|
+ const i = this.chooseData.findIndex(item => row.salesReturnBillNo == item.salesReturnBillNo)
|
|
|
+ this.chooseData.splice(i, 1)
|
|
|
+ },
|
|
|
+ // 获取关联单sn列表
|
|
|
+ getRtSnList () {
|
|
|
+ const ret = []
|
|
|
+ this.chooseData.map(item => {
|
|
|
+ ret.push({ salesReturnSn: item.salesReturnBillSn, salesReturnNo: item.salesReturnNo })
|
|
|
+ })
|
|
|
+ return ret
|
|
|
+ },
|
|
|
// 提交
|
|
|
handleSave (type) {
|
|
|
const _this = this
|
|
|
this.$refs.ruleForm.validate(valid => {
|
|
|
if (valid) {
|
|
|
- if (this.chooseData.length == 0) {
|
|
|
- _this.$message.info('请选择销退单')
|
|
|
- } else {
|
|
|
- // 保存
|
|
|
- if (type == 'save') {
|
|
|
- const form = JSON.parse(JSON.stringify(_this.form))
|
|
|
- form.id = _this.$route.params.id ? _this.$route.params.id : undefined
|
|
|
- form.expenseAccountFilesList = _this.attachList
|
|
|
- _this.spinning = true
|
|
|
- productSave(form).then(res => {
|
|
|
- if (res.status == 200) {
|
|
|
- _this.$message.success(res.message)
|
|
|
- _this.handleBack()
|
|
|
- }
|
|
|
+ const form = JSON.parse(JSON.stringify(_this.form))
|
|
|
+ form.attachmentList = _this.attachList
|
|
|
+ form.pickUpSalesReturnList = this.getRtSnList()
|
|
|
+ _this.spinning = true
|
|
|
+ pickUpSave(form).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ // 保存
|
|
|
+ if (type == 'save') {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.handleBack()
|
|
|
_this.spinning = false
|
|
|
- })
|
|
|
+ }
|
|
|
+ // 提交
|
|
|
+ if (type == 'submit') {
|
|
|
+ _this.openDepartUserModal = true
|
|
|
+ _this.pickUpSn = res.data.pickUpSn
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ _this.spinning = false
|
|
|
}
|
|
|
- // 提交
|
|
|
- if (type == 'submit') {
|
|
|
- _this.openDepartUserModal = true
|
|
|
- }
|
|
|
- }
|
|
|
+ })
|
|
|
} else {
|
|
|
return false
|
|
|
}
|
|
@@ -321,7 +347,7 @@ export default {
|
|
|
// 提交信息
|
|
|
handleSubmit (data) {
|
|
|
this.spinning = true
|
|
|
- expenseAccountSubmit({ expenseAccountSn: this.$route.params.sn, ...data }).then(res => {
|
|
|
+ pickUpSubmit({ pickUpSn: this.$route.params.sn || this.pickUpSn, ...data }).then(res => {
|
|
|
if (res.status == '200') {
|
|
|
this.$message.success(res.message)
|
|
|
this.handleBack()
|
|
@@ -342,11 +368,12 @@ export default {
|
|
|
},
|
|
|
pageInit () {
|
|
|
this.attachList = []
|
|
|
- this.form.expenseAccountFilesList = ''
|
|
|
+ this.form.attachmentList = ''
|
|
|
this.$refs.attachList.setFileList('')
|
|
|
this.$refs.ruleForm.resetFields()
|
|
|
- if (this.$route.params.id) { // 编辑页
|
|
|
+ if (this.$route.params.sn) { // 编辑页
|
|
|
this.getDetail()
|
|
|
+ this.getReturnOrderList()
|
|
|
}
|
|
|
}
|
|
|
},
|