|
|
@@ -1,669 +1,18 @@
|
|
|
-<!-- @desc:采购退货新建 @auth:常皓宁 @time:2024/03/14 14:15 -->
|
|
|
<template>
|
|
|
- <div class="main-div" style="position: relative;">
|
|
|
- <loading :loading="loading" v-if="!modalVisible"></loading>
|
|
|
- <DkCollapse @on-change="changeCollapse" ref="collapse">
|
|
|
- <DkPanel prop="essentialInformation">
|
|
|
- <!-- 单据信息 -->
|
|
|
- <DkForm slot="content" ref="formInline" v-model="formData"
|
|
|
- style="width:100%" :label-max-words="5">
|
|
|
- <!--供应商-->
|
|
|
- <DkFormItem prop="supId" :label="$t('supplierName')" :required="true">
|
|
|
- <SelectMagnifier v-model="formData.supId" :display-text="formData.supplierName"
|
|
|
- :type="this.$config.MagnifierType.supplier"
|
|
|
- :multiple="false"
|
|
|
- :otherCondition="{supplierType:'供应商类别-采购'}"/>
|
|
|
- </DkFormItem>
|
|
|
- <!--来源单号-->
|
|
|
- <DkFormItem prop="fromNo">
|
|
|
- <InputPop ref="fromNo" v-model="formData.fromNo" :readonly="true"/>
|
|
|
- </DkFormItem>
|
|
|
- <!--收货仓库-->
|
|
|
- <DkFormItem prop="whId" :label="$t('returnWareHouse')" :required="true">
|
|
|
- <SelectPop v-model="formData.whId" ref="whId"
|
|
|
- :options="warehouseList"
|
|
|
- :multiple="false"
|
|
|
- labelKey="whName" valueKey="whId"
|
|
|
- @on-select="changItemWhId">
|
|
|
- </SelectPop>
|
|
|
- </DkFormItem>
|
|
|
- <!--自动出库库标识-->
|
|
|
- <DkFormItem prop="autoFlag" v-show="showAutoFlag">
|
|
|
- <template>
|
|
|
- <i-switch v-model="formData.automaticFlg":disabled="type === $config.formMode.handle">
|
|
|
- <span slot="open"></span>
|
|
|
- <span slot="close"></span>
|
|
|
- </i-switch>
|
|
|
- </template>
|
|
|
- </DkFormItem>
|
|
|
- <!--备注-->
|
|
|
- <DkFormItem prop="remarks">
|
|
|
- <InputPop ref="remarks" v-model="formData.remarks"
|
|
|
- maxlength=500 textareaFlag/>
|
|
|
- </DkFormItem>
|
|
|
- </DkForm>
|
|
|
- </DkPanel>
|
|
|
- <!--商品信息-->
|
|
|
- <DkPanel prop="goodsInformation">
|
|
|
- <div id="search-cond-div-goods-info" ref="search-cond-div-goods-info" slot="content">
|
|
|
- <EditTable slot="left"
|
|
|
- ref="detailTable"
|
|
|
- majorField="itemId"
|
|
|
- :data="purchaseItemList"
|
|
|
- :columns="goodsColumns"
|
|
|
- :height="400"
|
|
|
- :freeze="false"
|
|
|
- :show-footer="true"
|
|
|
- :add-flag="false"
|
|
|
- @changeValue="changeValue"
|
|
|
- ></EditTable>
|
|
|
- </div>
|
|
|
- </DkPanel>
|
|
|
- <!--附件-->
|
|
|
- <DkPanel prop="files">
|
|
|
- <div id="search-cond-div-files-info" ref="search-cond-div-files-info"
|
|
|
- slot="content">
|
|
|
- <DkPicWall v-model="formData.annexPaths" :disabled="this.allCanNoEdit?true:false"
|
|
|
- folder="t_order/annex_paths" :accept="$config.uploadFileConfig.acceptPicType"
|
|
|
- :format="['jpg','jpeg','png']"></DkPicWall>
|
|
|
- </div>
|
|
|
- </DkPanel>
|
|
|
- </DkCollapse>
|
|
|
-
|
|
|
- <!-- 下部分按钮区域-->
|
|
|
- <DkSaveButton ref="saveButton" :loading="loading" @save="save" @close="close"></DkSaveButton>
|
|
|
-
|
|
|
- <!--选择采购入库单弹窗-->
|
|
|
- <DkModal
|
|
|
- :loading="loading"
|
|
|
- ref="modal_search"
|
|
|
- id="search-data-class"
|
|
|
- class-name="change-class"
|
|
|
- width="1100px"
|
|
|
- v-model="chooseModal"
|
|
|
- :shortcut-flag="false"
|
|
|
- @modalOk="modalOk"
|
|
|
- @modalCancel="modalCancel"
|
|
|
- @on-visible-change="openPurchaseModal"
|
|
|
- :title="modalTitle">
|
|
|
- <BaseIndexButtonGroup id="ButtonGroup">
|
|
|
- <template #left>
|
|
|
- <BaseIndexButton ref="search" name="search" @click="getDataTable"></BaseIndexButton>
|
|
|
- <BaseIndexButton :finalFlag="true" ref="clear" name="clear"
|
|
|
- @click="$refs['searchCond'].clearCondition()"></BaseIndexButton>
|
|
|
- </template>
|
|
|
- </BaseIndexButtonGroup>
|
|
|
- <SearchCond id="search-cond-div" width="1000px" class="search-cond-class"
|
|
|
- v-if="searchContent && searchContent.length > 0" ref="searchCond"
|
|
|
- v-model="searchCond" :setFlag="false" :searchContent="searchContent" :col-count="4"></SearchCond>
|
|
|
- <DkSplit mode="vertical" v-model="split" :height="chooseTableHeight">
|
|
|
- <div slot="top">
|
|
|
- <DkTable
|
|
|
- ref="purTable"
|
|
|
- :data="purList"
|
|
|
- :height="this.chooseTableHeight * split"
|
|
|
- :page-flag="false"
|
|
|
- :show-setting-flag="false"
|
|
|
- :freeze="false"
|
|
|
- :multiple="false"
|
|
|
- :choose-flag="false"
|
|
|
- :clearCheckFlag="false"
|
|
|
- :auto-width-flag="false"
|
|
|
- primaryKey="intoId"
|
|
|
- :showCheckboxHeader="false"
|
|
|
- :chooseCheckFlag="false"
|
|
|
- :showSettingFlag="false"
|
|
|
- @current-change="currentChange($event)">
|
|
|
- <!-- 采购入库单号-->
|
|
|
- <DkTableColumn field="intoNo"></DkTableColumn>
|
|
|
- <!-- 来源单号-->
|
|
|
- <DkTableColumn field="fromNo"></DkTableColumn>
|
|
|
- <!--部门-->
|
|
|
- <DkTableColumn field="orgName"></DkTableColumn>
|
|
|
- <!--员工-->
|
|
|
- <DkTableColumn field="staffName"></DkTableColumn>
|
|
|
- <!--客户-->
|
|
|
- <DkTableColumn field="cusName"></DkTableColumn>
|
|
|
- <!--入库状态-->
|
|
|
- <DkTableColumn field="intoStatusName" :color-cards="['入库中','已入库']"></DkTableColumn>
|
|
|
- <!--已入库数量-->
|
|
|
- <DkTableColumn field="intoQty" :digits="0" sum :title="'已入库数量'"></DkTableColumn>
|
|
|
- <!--已入库金额-->
|
|
|
- <DkTableColumn field="intoAmt" :digits="0" sum :title="'已入库金额'"></DkTableColumn>
|
|
|
- <!--制单人-->
|
|
|
- <DkTableColumn field="makeStaffName"></DkTableColumn>
|
|
|
- <!--制单时间-->
|
|
|
- <DkTableColumn field="makeTime"></DkTableColumn>
|
|
|
- <!--备注-->
|
|
|
- <DkTableColumn field="remarks"></DkTableColumn>
|
|
|
- </DkTable>
|
|
|
- </div>
|
|
|
- <div slot="bottom">
|
|
|
- <!--入库单明细-->
|
|
|
- <DkTable :pageFlag="false"
|
|
|
- :pageTotalFlag="false"
|
|
|
- primaryKey="itemId"
|
|
|
- :id="'table-'+$options.name"
|
|
|
- :show-footer="true"
|
|
|
- ref="detail-select"
|
|
|
- :showSettingFlag="false"
|
|
|
- :data="tableDataDetail_goodsDetail"
|
|
|
- :height="this.chooseTableHeight * (1-split)">
|
|
|
- <!-- 来源单号-->
|
|
|
- <DkTableColumn field="fromNo"></DkTableColumn>
|
|
|
- <!-- 商品型号-->
|
|
|
- <DkTableColumn field="skuModel" :filter="false"></DkTableColumn>
|
|
|
- <!-- 商品名称-->
|
|
|
- <DkTableColumn field="skuName"></DkTableColumn>
|
|
|
- <!-- 唯一编码-->
|
|
|
- <DkTableColumn field="skuCode" :filter="false"></DkTableColumn>
|
|
|
- <!-- 品牌-->
|
|
|
- <DkTableColumn field="brandName" :filter="false"></DkTableColumn>
|
|
|
- <!--品牌简称-->
|
|
|
- <DkTableColumn field="shortName" :filter="false"></DkTableColumn>
|
|
|
- <!--非标号-->
|
|
|
- <DkTableColumn field="nonStandardCode"></DkTableColumn>
|
|
|
- <!--已入库数量-->
|
|
|
- <DkTableColumn field="intoQty" :title="'已入库数量'"></DkTableColumn>
|
|
|
- <!--已入库金额-->
|
|
|
- <DkTableColumn field="intoAmt" :title="'已入库金额'"></DkTableColumn>
|
|
|
- <!--备注-->
|
|
|
- <DkTableColumn field="remarks"></DkTableColumn>
|
|
|
- </DkTable>
|
|
|
- </div>
|
|
|
- </DkSplit>
|
|
|
- </DkModal>
|
|
|
- </div>
|
|
|
+ <CommonForm type="handle" ></CommonForm>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-
|
|
|
-import {formMixin} from '@/mixins/form'
|
|
|
+import CommonForm from './form'
|
|
|
|
|
|
export default {
|
|
|
- name: "procure-return-handle",
|
|
|
- components: {},
|
|
|
- mixins: [formMixin],
|
|
|
- props: {
|
|
|
- type: {
|
|
|
- type: String,
|
|
|
- default:'handle'
|
|
|
- },
|
|
|
- },
|
|
|
- data() {
|
|
|
- let self = this
|
|
|
- return {
|
|
|
- fromId:null,//采购入库单来源Id
|
|
|
- //是否显示自动办理入库标识
|
|
|
- showAutoFlag: true,
|
|
|
- tableHeight: 450,
|
|
|
- tableDataDetail_goodsDetail: [], // 用于存放入库单明细数据
|
|
|
- split: 0.5,// 分区的默认
|
|
|
- chooseTableHeight: 600,
|
|
|
- purList: [],// 选择采购入库单
|
|
|
- // 查询条件
|
|
|
- searchCond: {},
|
|
|
- // 选择采购入库单弹窗查询条件
|
|
|
- searchContent:
|
|
|
- [
|
|
|
- {
|
|
|
- itemCode: '入库单号-文本',
|
|
|
- itemName: 'intoNo',
|
|
|
- valueFormat: {code: 'intoNo'},
|
|
|
- valueKind: 'STR'
|
|
|
- },
|
|
|
- ],
|
|
|
- //明细明细分页
|
|
|
- detailPageInfo: {
|
|
|
- total: 0,
|
|
|
- pageSize: this.$config.pageSize,
|
|
|
- currentPage: 1
|
|
|
- },
|
|
|
- modalTitle: '选择采购入库单',//选择成型线弹窗名称
|
|
|
- chooseModal: false,
|
|
|
- purItemId: null,
|
|
|
- loading: false,
|
|
|
- allCanNoEdit: false, //是否所有的都不允许编辑
|
|
|
- formData: {
|
|
|
- intoId: null,//入库单Id
|
|
|
- fromId: null,//来源单Id
|
|
|
- fromNo: null,//来源单号
|
|
|
- purId: null,//采购入库单Id
|
|
|
- purNo: null,//采购入库单号
|
|
|
- supId: null,//供应商Id
|
|
|
- supplierName: null,//供应商
|
|
|
- whId: null,//仓库Id
|
|
|
- whName: null,//仓库
|
|
|
- automaticFlg: false,//自动出库标识
|
|
|
- remarks: null,
|
|
|
- },
|
|
|
- //明细
|
|
|
- purchaseItemList: [],
|
|
|
- goodsColumns: [
|
|
|
- {field: 'skuModel', type: 'disabled'},//商品型号
|
|
|
- {field: 'skuName', type: 'disabled'},//商品名称
|
|
|
- //入库单价
|
|
|
- {
|
|
|
- field: 'priceInto',
|
|
|
- type: 'disabled',
|
|
|
- digits: 2,
|
|
|
- flgUserSensitive: true,
|
|
|
- },
|
|
|
- // 退货数量
|
|
|
- {
|
|
|
- field: 'itemQty',
|
|
|
- title: self.$t('returnQty1'),
|
|
|
- type: 'number',
|
|
|
- digits: 0,
|
|
|
- sum: true,
|
|
|
- negative: () => true,
|
|
|
- formula: {
|
|
|
- itemAmt: ['priceInto*itemQty', 'priceInto', 'itemQty'],
|
|
|
- },
|
|
|
- },
|
|
|
- //退货金额
|
|
|
- {
|
|
|
- field: 'itemAmt',
|
|
|
- title: self.$t('returnAmt1'),
|
|
|
- type: 'disabled',
|
|
|
- digits: 2,
|
|
|
- flgUserSensitive: true,
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'whId',
|
|
|
- type: 'select',
|
|
|
- options: () => self.warehouseList,
|
|
|
- labelKey: 'whName',
|
|
|
- valueKey: 'whId',
|
|
|
- dataType: self.$config.tableSelectType.warehouse,
|
|
|
- fieldUpdate: [
|
|
|
- {updateField: 'whName', valueFiled: 'whName'},
|
|
|
- {updateField: 'whId', valueFiled: 'whId'},
|
|
|
- ],
|
|
|
- searchDataFlag: false,
|
|
|
- },//仓库名称
|
|
|
- {
|
|
|
- field: 'remarks',
|
|
|
- },
|
|
|
- ],
|
|
|
- warehouseList: [],//仓库
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- methods: {
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 总单仓库修改明细仓库
|
|
|
- * @author : 常皓宁
|
|
|
- * @date : 2024/3/19 9:23
|
|
|
- */
|
|
|
- changItemWhId(){
|
|
|
- let itemData = this.$refs['detailTable'].getTableDataFilter();
|
|
|
- let whName = this.warehouseList.filter(it => it.whId == this.formData.whId)
|
|
|
- if(itemData && itemData.length > 0){
|
|
|
- itemData.forEach(it =>{
|
|
|
- it.whId = this.formData.whId
|
|
|
- it.whId_Name = whName[0].whName
|
|
|
- it.whName = whName[0].whName
|
|
|
- })
|
|
|
- this.$refs['detailTable'].$refs.xTable.reloadData(itemData)
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 选择采购入库单
|
|
|
- * @author : 常皓宁
|
|
|
- * @date : 2024/3/15 13:02
|
|
|
- */
|
|
|
- choosePurchase(modalOpenFlag) {
|
|
|
- if(modalOpenFlag){
|
|
|
- this.chooseModal = true
|
|
|
- this.getDataTable()
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 打开采购入库单modal
|
|
|
- * @author : 常皓宁
|
|
|
- * @date : 2024/3/15 13:06
|
|
|
- */
|
|
|
- openPurchaseModal(e) {
|
|
|
- this.$nextTick(() => {
|
|
|
- if (e) {
|
|
|
- this.modalVisible = true;
|
|
|
- } else {
|
|
|
- this.modalVisible = false;
|
|
|
- // 清空列表和查询条件
|
|
|
- this.$refs['searchCond'].clearCondition()
|
|
|
- // 清空数据源
|
|
|
- this.moldlineList = []
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 清空选择框
|
|
|
- * @author : 周兴
|
|
|
- * @date : 2023/2/21 15:34
|
|
|
- */
|
|
|
- modalCancel() {
|
|
|
- this.$refs['searchCond'].clearCondition()
|
|
|
- // 清空数据源
|
|
|
- this.moldlineList = []
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 选择采购入库单确定事件
|
|
|
- * @author : 常皓宁
|
|
|
- * @date : 2024/3/15 15:23
|
|
|
- */
|
|
|
- modalOk() {
|
|
|
- let batchRows = []
|
|
|
- let itemBatchRows = []
|
|
|
- //包括左侧
|
|
|
- if (this.purList) {
|
|
|
- batchRows = this.$refs['purTable'].batchRows
|
|
|
- itemBatchRows = this.$refs['detail-select'].batchRows
|
|
|
- console.log('batchRows',batchRows)
|
|
|
- console.log('itemBatchRows',itemBatchRows)
|
|
|
- // 总单
|
|
|
- if (batchRows) {
|
|
|
- this.formData.purId = batchRows[0].fromId
|
|
|
- this.formData.purNo = batchRows[0].fromNo
|
|
|
- this.formData.fromId = batchRows[0].fromId
|
|
|
- this.formData.fromNo = batchRows[0].fromNo
|
|
|
- this.formData.supId = batchRows[0].supId
|
|
|
- this.formData.supplierName = batchRows[0].supplierName
|
|
|
- this.formData.whId = batchRows[0].whId
|
|
|
- this.formData.whName = batchRows[0].whName
|
|
|
- }
|
|
|
- // 明细
|
|
|
- if (itemBatchRows) {
|
|
|
- itemBatchRows.map(row => {
|
|
|
- let item = row
|
|
|
- this.$set(item, 'intoItemId', row['itemId'])
|
|
|
- // 仓库
|
|
|
- this.$set(item, 'whId', this.formData.whId)
|
|
|
- this.$set(item, 'whName', this.formData.whName)
|
|
|
- })
|
|
|
- this.purchaseItemList = itemBatchRows
|
|
|
- for (let index = 0; index < this.purchaseItemList.length; index++) {
|
|
|
- this.purchaseItemList[index].itemQty = (this.purchaseItemList[index].intoQty - this.purchaseItemList[index].returnQty) * -1
|
|
|
- this.purchaseItemList[index].itemAmt = (this.purchaseItemList[index].intoAmt - this.purchaseItemList[index].returnAmt) * -1
|
|
|
- }
|
|
|
- //关闭选择弹框
|
|
|
- this.modalCancel() // 清空选择界面
|
|
|
- this.chooseModal = false
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 行点击事件
|
|
|
- * @author : 常皓宁
|
|
|
- * @date : 2024/2/28 15:01
|
|
|
- */
|
|
|
- currentChange({row}) {
|
|
|
- if (row != null) {
|
|
|
- this.intoId = row.intoId
|
|
|
- //查询采购入库单明细
|
|
|
- this.getDetail(1)
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 获取总单id对应明细
|
|
|
- * @author : 常皓宁
|
|
|
- * @date : 2024/2/28 15:03
|
|
|
- */
|
|
|
- getDetail(currentPage) {
|
|
|
- if (currentPage) {
|
|
|
- this.detailPageInfo.currentPage = currentPage
|
|
|
- }
|
|
|
- let params = {
|
|
|
- intoId: this.intoId,
|
|
|
- pageSize: this.detailPageInfo.pageSize,
|
|
|
- currentPage: this.detailPageInfo.currentPage
|
|
|
- }
|
|
|
- // 查询数据
|
|
|
- return this.excute(this.$service.purEnterItemService, this.$service.purEnterItemService.selectByCond, params).then(res => {
|
|
|
- if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
- this.tableDataDetail_goodsDetail = res.data.list
|
|
|
- // 全选
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs['detail-select'].checkAll();
|
|
|
- })
|
|
|
- this.$refs['detail-select'].pageInfo.total = res.data.total
|
|
|
- } else {
|
|
|
- this.tableDataDetail_goodsDetail = []
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 数据校验
|
|
|
- * @author : 常皓宁
|
|
|
- * @date : 2024/3/2 9:51
|
|
|
- */
|
|
|
- validData() {
|
|
|
- // // 明细必须有数据
|
|
|
- // let itemTable = this.$refs['detailTable'].getTableDataFilter();
|
|
|
- // if (!itemTable || itemTable.length == 0) {
|
|
|
- // this.$Message.warning(this.$t('W_012'))
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // for (let i = 0; i < itemTable.length; i++) {
|
|
|
- // if (!itemTable[i].itemQty || itemTable[i].itemQty === '') {
|
|
|
- // this.$message.warning(this.$t('W_041', {'param': this.$t('sequence') + (i + 1) + this.$t('rowNo') + this.$t('itemQty')}))
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // if (!itemTable[i].pricePur || itemTable[i].pricePur === '') {
|
|
|
- // this.$message.warning(this.$t('W_041', {'param': this.$t('sequence') + (i + 1) + this.$t('rowNo') + this.$t('pricePur')}))
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // }
|
|
|
- return true
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 行改变事件
|
|
|
- * @author : 常皓宁
|
|
|
- * @date : 2024/3/19 10:51
|
|
|
- */
|
|
|
- changeValue(field, row, rowIndex) {
|
|
|
- if (!row.whId || row.whId === 0 || row.whId === null) {
|
|
|
- this.$set(row, 'whId', this.whId);
|
|
|
- this.$set(row, 'whId_Name', this.whName);
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 清空参数
|
|
|
- * @date : 2022/12/20 15:33
|
|
|
- * @author : 常皓宁
|
|
|
- */
|
|
|
- clear() {
|
|
|
- this.formData = {
|
|
|
- fromId: null,//来源单Id
|
|
|
- fromNo: null,//来源单号
|
|
|
- purId: null,
|
|
|
- purNo: null,
|
|
|
- supId: null,
|
|
|
- supName: null,
|
|
|
- whId: null,
|
|
|
- whName: null,
|
|
|
- remarks: null,
|
|
|
- },
|
|
|
- this.purchaseItemList = []
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 给参数赋值
|
|
|
- * @author : 常皓宁
|
|
|
- * @date : 2024/2/28 13:41
|
|
|
- */
|
|
|
- setParams() {
|
|
|
- this.params = {...this.formData}
|
|
|
-
|
|
|
- // 新建
|
|
|
- if (this.type === this.$config.formMode.add) {
|
|
|
- let tableFilter = this.$refs['detailTable'].getTableDataFilter();
|
|
|
- tableFilter.map(row => {
|
|
|
- let item = row
|
|
|
- // 退货价
|
|
|
- this.$set(item, 'priceReturn', row['priceInto']* -1)
|
|
|
- return item
|
|
|
- })
|
|
|
- // 采购退货明细
|
|
|
- this.params.intoReturnItemVOList = tableFilter
|
|
|
- // 入库中数量
|
|
|
- this.params.sumQuantity = tableFilter.sum('itemQty')
|
|
|
- // 入库中金额
|
|
|
- this.params.sumAmount = tableFilter.sum('itemAmt')
|
|
|
- }
|
|
|
- // 入库办理
|
|
|
- if (this.type === this.$config.formMode.handle) {
|
|
|
- let tableFilter = this.$refs['detailTable'].getTableDataFilter();
|
|
|
- // 采购入库明细
|
|
|
- this.params.itemList = tableFilter
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 提交事件
|
|
|
- * @author : 付斌
|
|
|
- * @date : 2024-02-19 10:47
|
|
|
- */
|
|
|
- saveData() {
|
|
|
- console.log('this.params', this.params)
|
|
|
- //新建
|
|
|
- if (this.type === this.$config.formMode.add) {
|
|
|
- return this.excute(this.$service.purReturnService, this.$service.purReturnService.insert, this.params)
|
|
|
- }
|
|
|
- //退货办理
|
|
|
- else if (this.type === this.$config.formMode.handle) {
|
|
|
- return this.excute(this.$service.purReturnHandleService, this.$service.purReturnHandleService.inboundHandle, this.params)
|
|
|
- }
|
|
|
- },
|
|
|
- /***************************列表及其他事件************************************/
|
|
|
-
|
|
|
- /***************************设定参数函数************************************/
|
|
|
-
|
|
|
- /***************************created调用数据接口函数************************************/
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 获取采购入库数据
|
|
|
- * @author : 常皓宁
|
|
|
- * @date : 2024/3/15 13:08
|
|
|
- */
|
|
|
- getDataTable() {
|
|
|
- let param = {}
|
|
|
- param.fromId = this.fromId
|
|
|
- param.cpId = this.$store.state.user.cpId
|
|
|
- param.intoStatus = this.$config.intoStatus.yiRuKu
|
|
|
- param = Object.assign(param, this.searchCond._value)
|
|
|
- this.loading = true;
|
|
|
- this.excute(this.$service.purEnterService, this.$service.purEnterService.selectByCond, param).then(res => {
|
|
|
- if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
- this.purList = res.data.list
|
|
|
- } else {
|
|
|
- this.$Message.warning(res.message)
|
|
|
- this.purList = []
|
|
|
- }
|
|
|
- this.loading = false;
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 通过id查询
|
|
|
- * @author : 常皓宁
|
|
|
- * @date : 2024/2/29 8:49
|
|
|
- */
|
|
|
- detail(id) {
|
|
|
- console.log('id',id)
|
|
|
- return this.excuteNoParam(this.$service.purReturnHandleService, this.$service.purReturnHandleService.selectByUpdate, [id])
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 编辑页面赋值
|
|
|
- * @author : 常皓宁
|
|
|
- * @date : 2024/2/29 9:49
|
|
|
- */
|
|
|
- setValuesByEdit(data) {
|
|
|
- console.log('data',data)
|
|
|
- this.formData.intoId = data.data.intoId
|
|
|
- this.formData.fromId = data.data.fromId
|
|
|
- this.formData.fromNo = data.data.fromNo
|
|
|
- this.formData.supId = data.data.supId
|
|
|
- this.formData.supplierName = data.data.supName
|
|
|
- this.formData.remarks = data.data.remarks
|
|
|
- this.formData.whId = data.data.whId
|
|
|
- this.formData.whName = data.data.whName
|
|
|
- let dataItem = data.dataItem
|
|
|
- dataItem.map(row => {
|
|
|
- let item = row
|
|
|
- // 标价
|
|
|
- this.$set(item, 'priceInto', row['priceStd'])
|
|
|
- // 退货数量
|
|
|
- this.$set(item, 'itemQty', row['itemQty']*-1)
|
|
|
- // 退货金额
|
|
|
- this.$set(item, 'itemAmt', row['itemQty']*row['priceStd'])
|
|
|
- // 可退货数量
|
|
|
- this.$set(item, 'intoQty', row['intoQty'] - row['returnQty'])
|
|
|
- // 可退货金额
|
|
|
- this.$set(item, 'intoAmt', row['intoAmt'] - row['returnAmt'])
|
|
|
- return item
|
|
|
- })
|
|
|
- this.purchaseItemList = dataItem
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 获取仓库
|
|
|
- * @author : 常皓宁
|
|
|
- * @date : 2024/2/28 14:39
|
|
|
- */
|
|
|
- getWareHouseList() {
|
|
|
- let params = {
|
|
|
- cpId: this.$store.state.user.cpId
|
|
|
- }
|
|
|
- this.excute(this.$service.commonService, this.$service.commonService.getWarehouse, params, false).then(res => {//调用api查询方法
|
|
|
- if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
- this.warehouseList = res.data
|
|
|
- //赋值默认仓库 组件需要
|
|
|
- let newList = res.data.filter(it => it.flgDefault)
|
|
|
- this.whId = newList[0].whId
|
|
|
- this.whName = newList[0].whName
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
- * @desc : 加载数据
|
|
|
- * @author : 常皓宁
|
|
|
- * @date : 2024/2/28 14:37
|
|
|
- */
|
|
|
- initData() {
|
|
|
- this.getWareHouseList(); // 获取仓库数据
|
|
|
- },
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 在实例创建完成后被立即同步调用
|
|
|
- * @author : 寇珊珊
|
|
|
- * @date : 2022/3/3 10:32
|
|
|
- */
|
|
|
- created() {
|
|
|
- this.resizeTableFlag = true; // 计算表格高度
|
|
|
- this.showAutoFlag = false;
|
|
|
+ name: 'pur-return-handle',
|
|
|
+ components:{
|
|
|
+ CommonForm
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-
|
|
|
<style scoped>
|
|
|
|
|
|
-
|
|
|
-/deep/ .ivu-modal-body {
|
|
|
- background: #EAEDF7 !important;
|
|
|
-}
|
|
|
-
|
|
|
</style>
|