|
@@ -1,301 +1,413 @@
|
|
|
<template>
|
|
|
<div class="bulkReturnGoodsEdit-wrap">
|
|
|
- <a-page-header :ghost="false" @back="handleBack" >
|
|
|
- <!-- 自定义的二级文字标题 -->
|
|
|
- <template slot="subTitle">
|
|
|
- <a id="bulkReturnGoodsEdit-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
|
|
|
- </template>
|
|
|
- <!-- 操作区,位于 title 行的行尾 -->
|
|
|
- <!-- <template slot="extra">
|
|
|
- <a-button key="2" id="bulkReturnGoodsEdit-preview-btn">打印预览</a-button>
|
|
|
- <a-button key="1" type="primary" id="bulkReturnGoodsEdit-print-btn">快速打印</a-button>
|
|
|
- </template> -->
|
|
|
- </a-page-header>
|
|
|
- <!-- 内容 -->
|
|
|
- <a-page-header title="单号:CG2021010100001" ></a-page-header>
|
|
|
- <!-- 基础信息 -->
|
|
|
- <a-card size="small" :bordered="false" class="bulkReturnGoodsEdit-cont">
|
|
|
- <a-collapse :activeKey="['1']">
|
|
|
- <a-collapse-panel key="1">
|
|
|
- <template slot="header">
|
|
|
- 基础信息
|
|
|
- <a-button
|
|
|
- type="primary"
|
|
|
- shape="circle"
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
+ <a-page-header :ghost="false" :backIcon="false" class="bulkReturnGoodsEdit-cont">
|
|
|
+ <!-- 自定义的二级文字标题 -->
|
|
|
+ <template slot="subTitle">
|
|
|
+ <a id="bulkReturnGoodsEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
|
+ </template>
|
|
|
+ </a-page-header>
|
|
|
+ <!-- 选择产品 -->
|
|
|
+ <a-card size="small" :bordered="false" class="bulkReturnGoodsEdit-cont">
|
|
|
+ <!-- 搜索条件 -->
|
|
|
+ <div class="table-page-search-wrapper">
|
|
|
+ <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
+ <a-row :gutter="15">
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="产品编码" prop="productCode">
|
|
|
+ <a-input id="bulkReturnGoodsEdit-productCode" v-model="queryParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-item label="产品名称" prop="productName">
|
|
|
+ <a-input id="bulkReturnGoodsEdit-productName" v-model="queryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
+ <a-form-model-item label="仓库">
|
|
|
+ <a-select
|
|
|
+ placeholder="请选择仓库"
|
|
|
+ id="bulkReturnGoodsEdit-warehouseSn"
|
|
|
+ allowClear
|
|
|
+ v-model="queryParam.warehouseSn"
|
|
|
+ :showSearch="true"
|
|
|
+ option-filter-prop="children"
|
|
|
+ :filter-option="filterOption">
|
|
|
+ <a-select-option v-for="item in warehouseList" :key="item.warehouseSn" :value="item.warehouseSn">{{ item.name }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="bulkReturnGoodsEdit-refresh">查询</a-button>
|
|
|
+ <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="bulkReturnGoodsEdit-reset">重置</a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+ <!-- 列表 -->
|
|
|
+ <s-table
|
|
|
+ class="sTable"
|
|
|
+ ref="table"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="columns"
|
|
|
+ :customRow="handleClickRow"
|
|
|
+ :data="loadData"
|
|
|
+ :scroll="{ x: 980, y:300 }"
|
|
|
+ bordered>
|
|
|
+ <!-- 退货单价 -->
|
|
|
+ <template slot="purchaseCost" slot-scope="text, record">
|
|
|
+ <a-input-number
|
|
|
size="small"
|
|
|
- icon="edit"
|
|
|
- class="edit-circle-btn"
|
|
|
- id="bulkReturnGoodsEdit-edit-circle-btn"
|
|
|
- @click.stop="handleEditInfo" />
|
|
|
+ id="bulkReturnGoodsEdit-purchaseCost"
|
|
|
+ v-model="record.purchaseCost"
|
|
|
+ :precision="2"
|
|
|
+ :min="0"
|
|
|
+ :max="999999"
|
|
|
+ placeholder="请输入"
|
|
|
+ style="width: 100%;" />
|
|
|
</template>
|
|
|
- <a-descriptions :column="3">
|
|
|
- <a-descriptions-item label="供应商">箭冠营销中心</a-descriptions-item>
|
|
|
- <a-descriptions-item label="是否抓单">箭冠营销中心</a-descriptions-item>
|
|
|
- <a-descriptions-item label="备注">箭冠营销中心</a-descriptions-item>
|
|
|
- </a-descriptions>
|
|
|
- </a-collapse-panel>
|
|
|
- </a-collapse>
|
|
|
- </a-card>
|
|
|
- <!-- 选择产品 -->
|
|
|
- <a-card size="small" :bordered="false" class="bulkReturnGoodsEdit-cont">
|
|
|
- <a-collapse :activeKey="['1']">
|
|
|
- <a-collapse-panel key="1">
|
|
|
- <template slot="header">
|
|
|
- 选择产品<span class="sub-title">以下是该供应商的所有散件入库产品,请选择本次需要退货的产品</span>
|
|
|
+ <!-- 退货数量 -->
|
|
|
+ <template slot="purchaseQty" slot-scope="text, record">
|
|
|
+ <a-input-number
|
|
|
+ size="small"
|
|
|
+ id="bulkReturnGoodsEdit-purchaseQty"
|
|
|
+ v-model="record.purchaseQty"
|
|
|
+ :precision="0"
|
|
|
+ :min="1"
|
|
|
+ :max="record.currentQty"
|
|
|
+ placeholder="请输入"
|
|
|
+ style="width: 100%;" />
|
|
|
+ </template>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
+ <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="bulkReturnGoodsEdit-add-btn">添加</a-button>
|
|
|
</template>
|
|
|
- <!-- 选择产品 -->
|
|
|
- <div>
|
|
|
- <!-- 搜索条件 -->
|
|
|
+ </s-table>
|
|
|
+ </a-card>
|
|
|
+ <!-- 已选产品 -->
|
|
|
+ <a-card size="small" :bordered="false" class="bulkReturnGoodsEdit-cont">
|
|
|
+ <!-- 总计 -->
|
|
|
+ <a-alert type="info" style="margin-bottom:10px">
|
|
|
+ <div slot="message">
|
|
|
+ 总款数<strong>{{ (productTotal&&(productTotal.purchaseSize || productTotal.purchaseSize==0)) ? productTotal.purchaseSize : '--' }}</strong> ,
|
|
|
+ 总数量<strong>{{ (productTotal&&(productTotal.purchaseQty || productTotal.purchaseQty==0)) ? productTotal.purchaseQty : '--' }}</strong> ,
|
|
|
+ 总金额<strong>{{ (productTotal&&(productTotal.purchaseCost || productTotal.purchaseCost==0)) ? '¥'+productTotal.purchaseCost : '--' }}</strong>
|
|
|
+ </div>
|
|
|
+ </a-alert>
|
|
|
+ <!-- 筛选条件 -->
|
|
|
+ <a-row :gutter="15" justify="space-between">
|
|
|
+ <a-col :span="17">
|
|
|
<div class="table-page-search-wrapper">
|
|
|
- <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
+ <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
|
|
|
<a-row :gutter="15">
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="关键词">
|
|
|
- <a-input id="bulkReturnGoodsEdit-bundleName" v-model.trim="queryParam.bundleName" allowClear placeholder="产品名称/产品编码/原厂编码"/>
|
|
|
+ <a-col :md="9" :sm="24">
|
|
|
+ <a-form-item label="产品编码" prop="productCode">
|
|
|
+ <a-input id="bulkReturnGoodsEdit-productCode" v-model="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="散件单号">
|
|
|
- <a-input id="bulkReturnGoodsEdit-sparePartsReturnNo" v-model.trim="queryParam.sparePartsReturnNo" allowClear placeholder="请输入散件退货单号"/>
|
|
|
+ <a-col :md="9" :sm="24">
|
|
|
+ <a-form-item label="产品名称" prop="productName">
|
|
|
+ <a-input id="bulkReturnGoodsEdit-productName" v-model="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="散件单审核时间">
|
|
|
- <a-range-picker
|
|
|
- style="width:100%"
|
|
|
- id="bulkReturnGoodsEdit-creatTime"
|
|
|
- :disabledDate="disabledDate"
|
|
|
- v-model="time"
|
|
|
- :format="dateFormat"
|
|
|
- :placeholder="['开始时间', '结束时间']" />
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="bulkReturnGoodsEdit-refresh">查询</a-button>
|
|
|
- <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="bulkReturnGoodsEdit-reset">重置</a-button>
|
|
|
+ <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
|
+ <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="chooseDisabled" id="bulkReturnGoodsEdit-refresh">查询</a-button>
|
|
|
+ <a-button style="margin-left: 8px" @click="chooseResetSearchForm" :disabled="chooseDisabled" id="bulkReturnGoodsEdit-reset">重置</a-button>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
</div>
|
|
|
- <!-- 列表 -->
|
|
|
- <s-table
|
|
|
- class="sTable"
|
|
|
- ref="table"
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="7" style="text-align: right;"></a-col>
|
|
|
+ </a-row>
|
|
|
+ <!-- 列表 -->
|
|
|
+ <s-table
|
|
|
+ class="sTable"
|
|
|
+ ref="chooseTable"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="chooseColumns"
|
|
|
+ :data="chooseLoadData"
|
|
|
+ :scroll="{ x: 980, y:300 }"
|
|
|
+ bordered>
|
|
|
+ <!-- 退货单价 -->
|
|
|
+ <template slot="purchaseCost" slot-scope="text, record">
|
|
|
+ <a-input-number
|
|
|
size="small"
|
|
|
- :rowKey="(record) => record.id"
|
|
|
- :columns="columns"
|
|
|
- :data="loadData"
|
|
|
- bordered>
|
|
|
- <!-- 采购数量 -->
|
|
|
- <template slot="storageQuantity" slot-scope="text, record">
|
|
|
- <a-input-number
|
|
|
- id="bulkReturnGoodsEdit-storageQuantity"
|
|
|
- :value="record.storageQuantity"
|
|
|
- :precision="0"
|
|
|
- :min="0"
|
|
|
- :max="999999"
|
|
|
- placeholder="请输入" />
|
|
|
- </template>
|
|
|
- <!-- 操作 -->
|
|
|
- <template slot="action" slot-scope="text, record">
|
|
|
- <a-button size="small" type="primary" @click="handleAdd(record)" id="bulkReturnGoodsEdit-add-btn">添加</a-button>
|
|
|
- </template>
|
|
|
- </s-table>
|
|
|
- </div>
|
|
|
- </a-collapse-panel>
|
|
|
- </a-collapse>
|
|
|
- </a-card>
|
|
|
- <!-- 已选产品 -->
|
|
|
- <a-card size="small" :bordered="false" class="bulkReturnGoodsEdit-cont">
|
|
|
- <a-collapse :activeKey="['1']">
|
|
|
- <a-collapse-panel key="1">
|
|
|
- <template slot="header">
|
|
|
- 已选产品
|
|
|
- <!-- <a-button size="small" class="import-btn" id="bulkReturnGoodsEdit-import-btn" @click.stop="handleImport">导入明细</a-button> -->
|
|
|
+ id="bulkReturnGoodsEdit-purchaseCost"
|
|
|
+ v-model="record.purchaseCost"
|
|
|
+ :precision="2"
|
|
|
+ :min="0"
|
|
|
+ :max="999999"
|
|
|
+ placeholder="请输入"
|
|
|
+ @blur="e => purchaseCostBlur(e.target.value, record)"
|
|
|
+ style="width: 100%;" />
|
|
|
</template>
|
|
|
- <!-- 已选产品 -->
|
|
|
- <div>
|
|
|
- <!-- 总计 -->
|
|
|
- <a-alert type="info" style="margin-bottom:10px">
|
|
|
- <div slot="message">产品款数 <strong>6</strong> ,退货数量合计 <strong>6</strong> ,退货金额合计¥<strong>6.33</strong></div>
|
|
|
- </a-alert>
|
|
|
- <!-- 列表 -->
|
|
|
- <s-table
|
|
|
- class="sTable"
|
|
|
- ref="table"
|
|
|
+ <!-- 退货数量 -->
|
|
|
+ <template slot="purchaseQty" slot-scope="text, record">
|
|
|
+ <a-input-number
|
|
|
size="small"
|
|
|
- :rowKey="(record) => record.id"
|
|
|
- :columns="chooseColumns"
|
|
|
- :data="chooseLoadData"
|
|
|
- bordered>
|
|
|
- <!-- 采购数量 -->
|
|
|
- <template slot="storageQuantity" slot-scope="text, record">
|
|
|
- <a-input-number
|
|
|
- id="bulkReturnGoodsEdit-storageQuantity"
|
|
|
- :value="record.storageQuantity"
|
|
|
- :precision="0"
|
|
|
- :min="0"
|
|
|
- :max="999999"
|
|
|
- placeholder="请输入" />
|
|
|
- </template>
|
|
|
- <!-- 操作 -->
|
|
|
- <template slot="action" slot-scope="text, record">
|
|
|
- <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="bulkReturnGoodsEdit-del-btn">删除</a-button>
|
|
|
- </template>
|
|
|
- </s-table>
|
|
|
- </div>
|
|
|
- </a-collapse-panel>
|
|
|
- </a-collapse>
|
|
|
- </a-card>
|
|
|
- <a-affix :offset-bottom="0">
|
|
|
- <div style="text-align: center;width: 100%;background-color: #fff;padding: 12px 0;box-shadow: 0 0 20px #dcdee2;">
|
|
|
- <a-button type="primary" id="bulkReturnGoodsEdit-submit-btn" size="large" class="button-primary" @click="handleSubmit" style="padding: 0 60px;">提交</a-button>
|
|
|
- </div>
|
|
|
- </a-affix>
|
|
|
- <!-- 选择基本信息弹框 -->
|
|
|
- <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
|
|
|
+ id="bulkReturnGoodsEdit-purchaseQty"
|
|
|
+ v-model="record.purchaseQty"
|
|
|
+ :precision="0"
|
|
|
+ :min="1"
|
|
|
+ :max="999999"
|
|
|
+ placeholder="请输入"
|
|
|
+ @blur="e => purchaseQtyBlur(e.target.value, record)"
|
|
|
+ style="width: 100%;" />
|
|
|
+ </template>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
+ <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="bulkReturnGoodsEdit-del-btn">删除</a-button>
|
|
|
+ </template>
|
|
|
+ </s-table>
|
|
|
+ </a-card>
|
|
|
+ </a-spin>
|
|
|
+ <div class="affix-cont">
|
|
|
+ <a-button
|
|
|
+ type="primary"
|
|
|
+ id="bulkReturnGoodsEdit-submit-btn"
|
|
|
+ size="large"
|
|
|
+ :disabled="spinning"
|
|
|
+ class="button-primary"
|
|
|
+ @click="handleSubmit"
|
|
|
+ style="padding: 0 60px;">提交</a-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
-import basicInfoModal from './basicInfoModal.vue'
|
|
|
+import { warehouseAllList } from '@/api/warehouse'
|
|
|
+import { sparePartsRetDetailList, stockDetailProductList, sparePartsRetDetailSave, sparePartsRetDetailCount, sparePartsRetDetailDel, sparePartsRetSubmit } from '@/api/sparePartsRet'
|
|
|
export default {
|
|
|
- components: { STable, VSelect, basicInfoModal },
|
|
|
+ components: { STable, VSelect },
|
|
|
data () {
|
|
|
return {
|
|
|
+ spinning: false,
|
|
|
queryParam: {
|
|
|
-
|
|
|
+ productCode: '',
|
|
|
+ productName: '',
|
|
|
+ warehouseSn: undefined
|
|
|
},
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
- dateFormat: 'YYYY-MM-DD',
|
|
|
- time: [], // 散件单审核时间
|
|
|
// 表头
|
|
|
columns: [
|
|
|
- { title: '散件单号', dataIndex: 'creatDate', align: 'center' },
|
|
|
- { title: '散件单审核时间', dataIndex: 'custName', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品编码', dataIndex: 'custsName', align: 'center', sorter: true, customRender: function (text) { return text || '--' } },
|
|
|
- { title: '产品名称', dataIndex: 'totalP', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '单位', scopedSlots: { customRender: 'outOfStockNum' }, align: 'center' },
|
|
|
- { title: '成本价', dataIndex: 'totalNums', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '入库数量', dataIndex: 'totsalP', align: 'center' },
|
|
|
- { title: '已退数量', dataIndex: 'totaslP', align: 'center' },
|
|
|
- { title: '可退数量', dataIndex: 'tostalP', align: 'center' },
|
|
|
- { title: '库存数量', dataIndex: 'todtalP', align: 'center' },
|
|
|
- { title: '退货数量', scopedSlots: { customRender: 'storageQuantity' }, align: 'center' },
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '库存数量', dataIndex: 'currentQty', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '单位', dataIndex: 'unit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '退货单价', scopedSlots: { customRender: 'purchaseCost' }, width: 100, align: 'center' },
|
|
|
+ { title: '退货数量', scopedSlots: { customRender: 'purchaseQty' }, width: 100, align: 'center' },
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
- // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
|
|
|
- // const data = res.data
|
|
|
- // const no = (data.pageNo - 1) * data.pageSize
|
|
|
- // for (var i = 0; i < data.list.length; i++) {
|
|
|
- // data.list[i].no = no + i + 1
|
|
|
- // }
|
|
|
- // this.disabled = false
|
|
|
- // return data
|
|
|
- // })
|
|
|
- const _this = this
|
|
|
- return new Promise(function (resolve, reject) {
|
|
|
- const data = {
|
|
|
- pageNo: 1,
|
|
|
- pageSize: 10,
|
|
|
- list: [
|
|
|
- { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
|
|
|
- ],
|
|
|
- count: 10
|
|
|
- }
|
|
|
+ return stockDetailProductList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ const data = res.data
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
|
}
|
|
|
- _this.disabled = false
|
|
|
- resolve(data)
|
|
|
+ this.disabled = false
|
|
|
+ return data
|
|
|
})
|
|
|
},
|
|
|
+ chooseDisabled: false,
|
|
|
+ chooseQueryParam: {
|
|
|
+ productCode: '',
|
|
|
+ productName: ''
|
|
|
+ },
|
|
|
// 表头
|
|
|
chooseColumns: [
|
|
|
- { title: '产品编码', dataIndex: 'creatDaite', align: 'center', sorter: true },
|
|
|
- { title: '产品名称', dataIndex: 'custNayme', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '单位', dataIndex: 'custsNakme', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
- { title: '成本价', dataIndex: 'mementPay', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
- { title: '退货数量', scopedSlots: { customRender: 'storageQuantity' }, align: 'center' },
|
|
|
- { title: '退货金额', dataIndex: 'custssNakme', align: 'center', customRender: function (text) { return ((text || text == 0) ? '¥' + text : '--') } },
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: 180, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '仓库', dataIndex: 'warehouseName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '仓位', dataIndex: 'warehouseLocationName', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '单位', dataIndex: 'productUnit', width: 60, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '退货单价', scopedSlots: { customRender: 'purchaseCost' }, width: 100, align: 'center' },
|
|
|
+ { title: '退货数量', scopedSlots: { customRender: 'purchaseQty' }, width: 100, align: 'center' },
|
|
|
+ { title: '退货金额', dataIndex: 'purchaseAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: 80, align: 'center', fixed: 'right' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
chooseLoadData: parameter => {
|
|
|
- this.disabled = true
|
|
|
- // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
|
|
|
- // const data = res.data
|
|
|
- // const no = (data.pageNo - 1) * data.pageSize
|
|
|
- // for (var i = 0; i < data.list.length; i++) {
|
|
|
- // data.list[i].no = no + i + 1
|
|
|
- // }
|
|
|
- // this.disabled = false
|
|
|
- // return data
|
|
|
- // })
|
|
|
- const _this = this
|
|
|
- return new Promise(function (resolve, reject) {
|
|
|
- const data = {
|
|
|
- pageNo: 1,
|
|
|
- pageSize: 10,
|
|
|
- list: [
|
|
|
- { id: '1', purchaseNo: 'jgqp11111111111', custssName: 0, creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
|
|
|
- ],
|
|
|
- count: 10
|
|
|
- }
|
|
|
+ this.chooseDisabled = true
|
|
|
+ const params = Object.assign(parameter, this.chooseQueryParam, { sparePartsReturnSn: this.$route.params.sn })
|
|
|
+ return sparePartsRetDetailList(params).then(res => {
|
|
|
+ const data = res.data
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
|
+ data.list[i].purchaseCostBackups = data.list[i].purchaseCost
|
|
|
+ data.list[i].purchaseQtyBackups = data.list[i].purchaseQty
|
|
|
}
|
|
|
- _this.disabled = false
|
|
|
- resolve(data)
|
|
|
+ this.localDataSource = data.list || []
|
|
|
+ this.chooseDisabled = false
|
|
|
+ this.getDetailCount(params)
|
|
|
+ return data
|
|
|
})
|
|
|
},
|
|
|
- openModal: false // 选择基本信息弹框是否显示
|
|
|
+ localDataSource: [],
|
|
|
+ productTotal: null, // 合计
|
|
|
+ warehouseList: [] // 仓库列表
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- // 不可选日期
|
|
|
- disabledDate (date, dateStrings) {
|
|
|
- return date && date.valueOf() > Date.now()
|
|
|
+ // 合计
|
|
|
+ getDetailCount (params) {
|
|
|
+ sparePartsRetDetailCount(params).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.productTotal = res.data
|
|
|
+ } else {
|
|
|
+ this.productTotal = null
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 重置
|
|
|
resetSearchForm () {
|
|
|
- this.queryParam.orderBundleNo = ''
|
|
|
- this.queryParam.orderBundle.custMobile = ''
|
|
|
- this.queryParam.bundleName = ''
|
|
|
- this.queryParam.itemName = ''
|
|
|
- this.oldTime = undefined
|
|
|
- this.newTime = undefined
|
|
|
+ this.queryParam.productCode = ''
|
|
|
+ this.queryParam.productName = ''
|
|
|
+ this.queryParam.warehouseSn = undefined
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
- // 添加
|
|
|
- handleAdd (row) {},
|
|
|
+ // 已选产品 重置
|
|
|
+ chooseResetSearchForm () {
|
|
|
+ this.chooseQueryParam.productCode = ''
|
|
|
+ this.chooseQueryParam.productName = ''
|
|
|
+ this.$refs.chooseTable.refresh(true)
|
|
|
+ },
|
|
|
+ // 添加/编辑
|
|
|
+ handleAdd (row, isEdit) {
|
|
|
+ if (!isEdit && !row.purchaseCost) {
|
|
|
+ this.$message.warning('请输入退货单价后再添加!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!isEdit && !row.purchaseQty) {
|
|
|
+ this.$message.warning('请输入退货数量后再添加!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const params = {
|
|
|
+ id: isEdit ? row.id : undefined,
|
|
|
+ sparePartsReturnSn: this.$route.params.sn,
|
|
|
+ purchaseCost: row.purchaseCost,
|
|
|
+ purchaseQty: row.purchaseQty,
|
|
|
+ productSn: row.productSn,
|
|
|
+ productCode: row.productCode,
|
|
|
+ productOrigCode: row.productOrigCode,
|
|
|
+ productTypeSn1: row.productTypeSn1,
|
|
|
+ productTypeSn2: row.productTypeSn2,
|
|
|
+ productTypeSn3: row.productTypeSn3,
|
|
|
+ brandSn: row.brandSn,
|
|
|
+ warehouseLocationSn: row.warehouseLocationSn,
|
|
|
+ warehouseSn: row.warehouseSn,
|
|
|
+ productExpiryDate: row.productExpiryDate
|
|
|
+ }
|
|
|
+ if (isEdit) { // 编辑
|
|
|
+ // 清空成本价或数量时,值应保持未清空前的值,因成本价和数量都不可为空
|
|
|
+ if (!row.purchaseCost) {
|
|
|
+ row.purchaseCost = row.purchaseCostBackups
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!row.purchaseQty) {
|
|
|
+ row.purchaseQty = row.purchaseQtyBackups
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.spinning = true
|
|
|
+ sparePartsRetDetailSave(params).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.$message.success(res.message)
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ this.$refs.chooseTable.refresh()
|
|
|
+ this.spinning = false
|
|
|
+ } else {
|
|
|
+ this.spinning = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 删除
|
|
|
- handleDel (row) {},
|
|
|
- // 编辑基本信息
|
|
|
- handleEditInfo () {
|
|
|
- this.openModal = true
|
|
|
+ handleDel (row) {
|
|
|
+ const _this = this
|
|
|
+ this.$confirm({
|
|
|
+ title: '提示',
|
|
|
+ content: '删除后不可恢复,确定要进行删除吗?',
|
|
|
+ centered: true,
|
|
|
+ onOk () {
|
|
|
+ _this.spinning = true
|
|
|
+ sparePartsRetDetailDel({ id: row.id }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ _this.$message.success(res.message)
|
|
|
+ _this.$refs.table.refresh()
|
|
|
+ _this.$refs.chooseTable.refresh()
|
|
|
+ _this.spinning = false
|
|
|
+ } else {
|
|
|
+ _this.spinning = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 提交
|
|
|
handleSubmit () {
|
|
|
-
|
|
|
+ const _this = this
|
|
|
+ if (this.localDataSource.length < 1) {
|
|
|
+ this.$message.info('退货单中不存在任何产品,无法提交')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ _this.spinning = true
|
|
|
+ sparePartsRetSubmit({ id: this.$route.params.id }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.$message.success(res.message)
|
|
|
+ setTimeout(() => {
|
|
|
+ _this.handleBack()
|
|
|
+ _this.spinning = false
|
|
|
+ }, 1000)
|
|
|
+ } else {
|
|
|
+ _this.spinning = false
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- // 基本信息 保存
|
|
|
- handleOk () {
|
|
|
-
|
|
|
+ // 已选产品 单价 blur
|
|
|
+ purchaseCostBlur (val, record) {
|
|
|
+ // 光标移出,值发生改变再调用编辑接口
|
|
|
+ if (val != record.purchaseCostBackups) {
|
|
|
+ this.handleAdd(record, 'edit')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 已选产品 数量 blur
|
|
|
+ purchaseQtyBlur (val, record) {
|
|
|
+ if (val != record.purchaseQtyBackups) {
|
|
|
+ this.handleAdd(record, 'edit')
|
|
|
+ }
|
|
|
},
|
|
|
// 返回列表
|
|
|
handleBack () {
|
|
|
this.$router.push({ path: '/bulkManagement/bulkReturnGoods/list', query: { closeLastOldTab: true } })
|
|
|
},
|
|
|
- // 导入明细
|
|
|
- handleImport () {
|
|
|
- console.log(333)
|
|
|
+ // 双击快速添加
|
|
|
+ handleClickRow (record) {
|
|
|
+ return {
|
|
|
+ on: {
|
|
|
+ dblclick: (event) => {
|
|
|
+ this.handleAdd(record)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 仓库
|
|
|
+ getWarehouse () {
|
|
|
+ warehouseAllList({}).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.warehouseList = res.data
|
|
|
+ } else {
|
|
|
+ this.warehouseList = []
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
filterOption (input, option) {
|
|
|
return (
|
|
@@ -305,7 +417,7 @@ export default {
|
|
|
},
|
|
|
beforeRouteEnter (to, from, next) {
|
|
|
next(vm => {
|
|
|
- vm.openModal = false
|
|
|
+ vm.getWarehouse()
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -313,26 +425,16 @@ export default {
|
|
|
|
|
|
<style lang="less">
|
|
|
.bulkReturnGoodsEdit-wrap{
|
|
|
+ position: relative;
|
|
|
+ height: 100%;
|
|
|
+ padding-bottom: 51px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ >.ant-spin-nested-loading{
|
|
|
+ overflow-y: scroll;
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
.bulkReturnGoodsEdit-cont{
|
|
|
margin-bottom: 10px;
|
|
|
- .sub-title{
|
|
|
- font-size: 12px;
|
|
|
- color: #808695;
|
|
|
- margin-left: 10px;
|
|
|
- }
|
|
|
- .tag-txt{
|
|
|
- font-size: 12px;
|
|
|
- color: #ed1c24;
|
|
|
- }
|
|
|
- .edit-circle-btn{
|
|
|
- margin-left: 15px;
|
|
|
- i{
|
|
|
- vertical-align: text-bottom;
|
|
|
- }
|
|
|
- }
|
|
|
- .import-btn{
|
|
|
- margin-left: 15px;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
</style>
|