|
@@ -1,61 +1,37 @@
|
|
<template>
|
|
<template>
|
|
- <div class="allocateBillEdit-wrap">
|
|
|
|
|
|
+ <div class="editGrap-wrap">
|
|
<!-- <a-spin :spinning="spinning" tip="Loading..."> -->
|
|
<!-- <a-spin :spinning="spinning" tip="Loading..."> -->
|
|
<div class="ant-spin-nested-loading">
|
|
<div class="ant-spin-nested-loading">
|
|
- <a-page-header :ghost="false" :backIcon="false" class="allocateBillEdit-back" >
|
|
|
|
|
|
+ <a-page-header :ghost="false" :backIcon="false" class="editGrap-back" >
|
|
<!-- 自定义的二级文字标题 -->
|
|
<!-- 自定义的二级文字标题 -->
|
|
<template slot="subTitle">
|
|
<template slot="subTitle">
|
|
- <a id="allocateBillEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
|
|
|
|
+ <a id="editGrap-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
</template>
|
|
</template>
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<template slot="extra">
|
|
<template slot="extra">
|
|
- <a-button
|
|
|
|
- key="3"
|
|
|
|
- type="primary"
|
|
|
|
- class="button-warning"
|
|
|
|
- v-if="$hasPermissions('B_transferOut_detail_export')"
|
|
|
|
- id="allocateBillEdit-export-btn"
|
|
|
|
- :disabled="localDataSource.length==0"
|
|
|
|
- @click="handleExcel">导出Excel</a-button>
|
|
|
|
- <a-button
|
|
|
|
- key="2"
|
|
|
|
- type="primary"
|
|
|
|
- class="button-error"
|
|
|
|
- v-if="$hasPermissions('B_transferOut_print')"
|
|
|
|
- id="allocateBillEdit-db-print-btn"
|
|
|
|
- :disabled="localDataSource.length==0"
|
|
|
|
- @click="handlePrint('dbPrint')">调拨打印</a-button>
|
|
|
|
- <a-button
|
|
|
|
- key="1"
|
|
|
|
- type="primary"
|
|
|
|
- class="button-info"
|
|
|
|
- v-if="$hasPermissions('B_transferOut_print')"
|
|
|
|
- id="allocateBillEdit-dbfl-print-btn"
|
|
|
|
- :disabled="localDataSource.length==0"
|
|
|
|
- @click="handlePrint('dbflPrint')">调拨分类打印</a-button>
|
|
|
|
|
|
+ <print :params="{allocateSn: $route.params.sn}" :disabled="localDataSource.length==0" @loading="spinning=true" @unloading="spinning=false"></print>
|
|
</template>
|
|
</template>
|
|
</a-page-header>
|
|
</a-page-header>
|
|
- <a-card size="small" :bordered="false" v-if="basicInfoData" class="allocateBillEdit-cont">
|
|
|
|
|
|
+ <a-card size="small" :bordered="false" v-if="basicInfoData" class="editGrap-cont">
|
|
<a-collapse :activeKey="['0']">
|
|
<a-collapse :activeKey="['0']">
|
|
<a-collapse-panel key="0" header="基础信息">
|
|
<a-collapse-panel key="0" header="基础信息">
|
|
<a-descriptions :column="3">
|
|
<a-descriptions :column="3">
|
|
- <a-descriptions-item label="调往对象">{{ (basicInfoData&&basicInfoData.targetName) || '--' }}</a-descriptions-item>
|
|
|
|
- <a-descriptions-item label="调拨单号">{{ (basicInfoData&&basicInfoData.allocateNo) || '--' }}</a-descriptions-item>
|
|
|
|
- <a-descriptions-item label="调拨类型">
|
|
|
|
|
|
+ <a-descriptions-item label="调拨退货对象">{{ (basicInfoData&&basicInfoData.targetName) || '--' }}</a-descriptions-item>
|
|
|
|
+ <a-descriptions-item label="调拨退货对象名称">{{ (basicInfoData&&basicInfoData.targetName) || '--' }}</a-descriptions-item>
|
|
|
|
+ <a-descriptions-item label="调拨退货类型">
|
|
<AllocateType id="allocateEdit-allocateTypeSn" style="width: 200px;" @change="changeAllocateType" v-model="basicInfoData.allocateTypeSn"></AllocateType>
|
|
<AllocateType id="allocateEdit-allocateTypeSn" style="width: 200px;" @change="changeAllocateType" v-model="basicInfoData.allocateTypeSn"></AllocateType>
|
|
</a-descriptions-item>
|
|
</a-descriptions-item>
|
|
- <a-descriptions-item label="业务状态">{{ (basicInfoData&&basicInfoData.stateDictValue) || '--' }}</a-descriptions-item>
|
|
|
|
- <a-descriptions-item label="起止时间">
|
|
|
|
- <span v-if="basicInfoData&&(basicInfoData.promoStartDate || basicInfoData.promoEndDate)">{{ (basicInfoData&&basicInfoData.promoStartDate) || '--' }} ~ {{ (basicInfoData&&basicInfoData.promoEndDate) || '--' }}</span>
|
|
|
|
- <span v-else>--</span>
|
|
|
|
|
|
+ <a-descriptions-item label="是否抓单">{{ (basicInfoData&&basicInfoData.allocateNo) || '--' }}</a-descriptions-item>
|
|
|
|
+ <a-descriptions-item label="备注">
|
|
|
|
+ {{ (basicInfoData&&basicInfoData.remark) }}
|
|
|
|
+ <a-icon type="form" title="编辑备注" @click="editRemark = true" style="color: dodgerblue;font-size: 14px;" />
|
|
</a-descriptions-item>
|
|
</a-descriptions-item>
|
|
- <a-descriptions-item label="备注">{{ (basicInfoData&&basicInfoData.remark) || '--' }}</a-descriptions-item>
|
|
|
|
</a-descriptions>
|
|
</a-descriptions>
|
|
</a-collapse-panel>
|
|
</a-collapse-panel>
|
|
</a-collapse>
|
|
</a-collapse>
|
|
</a-card>
|
|
</a-card>
|
|
<!-- 选择产品 -->
|
|
<!-- 选择产品 -->
|
|
- <a-card size="small" :bordered="false" class="allocateBillEdit-cont">
|
|
|
|
|
|
+ <a-card size="small" :bordered="false" class="editGrap-cont">
|
|
<a-collapse :activeKey="['1']">
|
|
<a-collapse :activeKey="['1']">
|
|
<a-collapse-panel key="1" :forceRender="true" header="选择产品">
|
|
<a-collapse-panel key="1" :forceRender="true" header="选择产品">
|
|
<!-- 筛选条件 -->
|
|
<!-- 筛选条件 -->
|
|
@@ -63,18 +39,18 @@
|
|
<a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
<a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- <a-form-item label="产品编码" prop="productCode">
|
|
|
|
- <a-input id="allocateBillEdit-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
|
|
|
|
+ <a-form-item label="调拨单号" prop="productOrigCode">
|
|
|
|
+ <a-input id="editGrap-productOrigCode" v-model.trim="queryParam.productOrigCode" placeholder="请输入调拨单号" allowClear />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- <a-form-item label="产品名称" prop="productName">
|
|
|
|
- <a-input id="allocateBillEdit-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
|
|
|
|
+ <a-form-item label="产品编码" prop="productCode">
|
|
|
|
+ <a-input id="editGrap-productCode" v-model.trim="queryParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24">
|
|
<a-col :md="6" :sm="24">
|
|
- <a-form-item label="原厂编码" prop="productOrigCode">
|
|
|
|
- <a-input id="allocateBillEdit-productOrigCode" v-model.trim="queryParam.productOrigCode" placeholder="请输入原厂编码" allowClear />
|
|
|
|
|
|
+ <a-form-item label="产品名称" prop="productName">
|
|
|
|
+ <a-input id="editGrap-productName" v-model.trim="queryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
@@ -98,24 +74,36 @@
|
|
:scroll="{ y: 300 }"
|
|
:scroll="{ y: 300 }"
|
|
:defaultLoadData="false"
|
|
:defaultLoadData="false"
|
|
bordered>
|
|
bordered>
|
|
|
|
+ <!-- 退货单价 -->
|
|
|
|
+ <template slot="returnPrice" slot-scope="text, record">
|
|
|
|
+ <div @dblclick.stop>
|
|
|
|
+ <a-input-number
|
|
|
|
+ size="small"
|
|
|
|
+ v-model="record.returnPrice"
|
|
|
|
+ :precision="2"
|
|
|
|
+ :min="0"
|
|
|
|
+ :max="999999"
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ style="width: 100%;" />
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
- <template slot="action1" slot-scope="text, record">
|
|
|
|
- <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="allocateBillEdit-add-btn">添加</a-button>
|
|
|
|
|
|
+ <template slot="action" slot-scope="text, record">
|
|
|
|
+ <a-button size="small" type="primary" class="button-primary" @click="handleAdd(record)" id="editGrap-add-btn">添加</a-button>
|
|
</template>
|
|
</template>
|
|
</s-table>
|
|
</s-table>
|
|
</a-collapse-panel>
|
|
</a-collapse-panel>
|
|
</a-collapse>
|
|
</a-collapse>
|
|
</a-card>
|
|
</a-card>
|
|
<!-- 已选产品 -->
|
|
<!-- 已选产品 -->
|
|
- <a-card size="small" :bordered="false" class="allocateBillEdit-cont">
|
|
|
|
|
|
+ <a-card size="small" :bordered="false" class="editGrap-cont">
|
|
<a-collapse :activeKey="['2']">
|
|
<a-collapse :activeKey="['2']">
|
|
<a-collapse-panel key="2" :forceRender="true" header="已选产品">
|
|
<a-collapse-panel key="2" :forceRender="true" header="已选产品">
|
|
<!-- 总计 -->
|
|
<!-- 总计 -->
|
|
<a-alert type="info" style="margin-bottom:10px">
|
|
<a-alert type="info" style="margin-bottom:10px">
|
|
<div slot="message">
|
|
<div slot="message">
|
|
- 总数量:<strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong> ,
|
|
|
|
- <span v-if="$hasPermissions('B_isShowCost')">总成本(¥):<strong>{{ (productTotal&&(productTotal.totalCost || productTotal.totalCost==0)) ? productTotal.totalCost : '--' }}</strong> ,</span>
|
|
|
|
- <span v-if="$hasPermissions('B_isShowPrice')">总售价(¥):<strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong></span>
|
|
|
|
|
|
+ 退货总数量:<strong>{{ (productTotal&&(productTotal.totalQty || productTotal.totalQty==0)) ? productTotal.totalQty : '--' }}</strong> ,
|
|
|
|
+ <span v-if="$hasPermissions('B_isShowPrice')">退货总金额(¥):<strong>{{ (productTotal&&(productTotal.totalPrice || productTotal.totalPrice==0)) ? productTotal.totalPrice : '--' }}</strong></span>
|
|
</div>
|
|
</div>
|
|
</a-alert>
|
|
</a-alert>
|
|
<!-- 筛选条件 -->
|
|
<!-- 筛选条件 -->
|
|
@@ -126,12 +114,12 @@
|
|
<a-row :gutter="15">
|
|
<a-row :gutter="15">
|
|
<a-col :md="9" :sm="24">
|
|
<a-col :md="9" :sm="24">
|
|
<a-form-item label="产品编码" prop="productCode">
|
|
<a-form-item label="产品编码" prop="productCode">
|
|
- <a-input id="allocateBillEdit-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
|
|
|
|
+ <a-input id="editGrap-productCode" v-model.trim="chooseQueryParam.productCode" placeholder="请输入产品编码" allowClear />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="9" :sm="24">
|
|
<a-col :md="9" :sm="24">
|
|
<a-form-item label="产品名称" prop="productName">
|
|
<a-form-item label="产品名称" prop="productName">
|
|
- <a-input id="allocateBillEdit-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
|
|
|
|
+ <a-input id="editGrap-productName" v-model.trim="chooseQueryParam.productName" placeholder="请输入产品名称" allowClear />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
<a-col :md="6" :sm="24" style="margin-bottom: 10px;">
|
|
@@ -143,8 +131,8 @@
|
|
</div>
|
|
</div>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="7" style="text-align: right;">
|
|
<a-col :span="7" style="text-align: right;">
|
|
- <a-button size="small" id="allocateBillEdit-import-btn" @click="openGuideModal=true">导入产品</a-button>
|
|
|
|
- <a-button size="small" type="danger" style="margin-left: 5px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button>
|
|
|
|
|
|
+ <!-- <a-button size="small" id="editGrap-import-btn" @click="openGuideModal=true">导入产品</a-button> -->
|
|
|
|
+ <!-- <a-button size="small" type="danger" style="margin-left: 5px" @click.stop="handleDel('', 'all')" id="chainTransferOutEdit-del-all-btn">整单删除</a-button> -->
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
@@ -160,43 +148,21 @@
|
|
:scroll="{ y: 300 }"
|
|
:scroll="{ y: 300 }"
|
|
:defaultLoadData="false"
|
|
:defaultLoadData="false"
|
|
bordered>
|
|
bordered>
|
|
- <!-- 售价 -->
|
|
|
|
- <template slot="price" slot-scope="text, record, index">
|
|
|
|
- <!-- 调往对象为经销商时不可编辑售价,为员工或其他时可编辑售价 -->
|
|
|
|
- <div v-if="$route.params.dealerLevel == 'OTHER'">
|
|
|
|
- <a-select
|
|
|
|
- size="small"
|
|
|
|
- id="allocateBillEdit-price"
|
|
|
|
- option-label-prop="label"
|
|
|
|
- v-model="record.price"
|
|
|
|
- placeholder="请选择"
|
|
|
|
- @change="e => priceChange(e, record)"
|
|
|
|
- @focus="e => priceFocus(record, index)"
|
|
|
|
- style="width: 100%;">
|
|
|
|
- <a-select-option v-if="record.cost" :value="record.cost" :key="'cb-'+record.cost" :label="record.cost">成本 {{ record.cost }}</a-select-option>
|
|
|
|
- <a-select-option v-if="loadDataSource&&loadDataSource[index]&&loadDataSource[index].provincePrice" :value="loadDataSource[index].provincePrice" :key="'A-'+loadDataSource[index].productSn" :label="loadDataSource[index].provincePrice">A价 {{ loadDataSource[index].provincePrice }}</a-select-option>
|
|
|
|
- <a-select-option v-if="loadDataSource&&loadDataSource[index]&&loadDataSource[index].cityPrice" :value="loadDataSource[index].cityPrice" :key="'B-'+loadDataSource[index].productSn" :label="loadDataSource[index].cityPrice">B价 {{ loadDataSource[index].cityPrice }}</a-select-option>
|
|
|
|
- <a-select-option v-if="loadDataSource&&loadDataSource[index]&&loadDataSource[index].specialPrice" :value="loadDataSource[index].specialPrice" :key="'C-'+loadDataSource[index].productSn" :label="loadDataSource[index].specialPrice">C价 {{ loadDataSource[index].specialPrice }}</a-select-option>
|
|
|
|
- </a-select>
|
|
|
|
- </div>
|
|
|
|
- <span v-else>{{ record.price }}</span>
|
|
|
|
- </template>
|
|
|
|
- <!-- 调出数量 -->
|
|
|
|
- <template slot="qty" slot-scope="text, record">
|
|
|
|
|
|
+ <!-- 退货单价 -->
|
|
|
|
+ <template slot="returnPrice" slot-scope="text, record">
|
|
<a-input-number
|
|
<a-input-number
|
|
size="small"
|
|
size="small"
|
|
- id="allocateBillEdit-qty"
|
|
|
|
- v-model="record.qty"
|
|
|
|
- :precision="0"
|
|
|
|
- :min="1"
|
|
|
|
|
|
+ v-model="record.returnPrice"
|
|
|
|
+ @blur="e => priceChange(e.target.value, record)"
|
|
|
|
+ :precision="2"
|
|
|
|
+ :min="0"
|
|
:max="999999"
|
|
:max="999999"
|
|
placeholder="请输入"
|
|
placeholder="请输入"
|
|
- @blur="e => qtyBlur(e.target.value, record)"
|
|
|
|
style="width: 100%;" />
|
|
style="width: 100%;" />
|
|
</template>
|
|
</template>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<template slot="action" slot-scope="text, record">
|
|
<template slot="action" slot-scope="text, record">
|
|
- <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="allocateBillEdit-del-btn">删除</a-button>
|
|
|
|
|
|
+ <a-button size="small" type="primary" class="button-error" @click="handleDel(record)" id="editGrap-del-btn">删除</a-button>
|
|
</template>
|
|
</template>
|
|
</s-table>
|
|
</s-table>
|
|
</a-collapse-panel>
|
|
</a-collapse-panel>
|
|
@@ -207,7 +173,7 @@
|
|
<div class="affix-cont">
|
|
<div class="affix-cont">
|
|
<a-button
|
|
<a-button
|
|
type="primary"
|
|
type="primary"
|
|
- id="allocateBillEdit-submit"
|
|
|
|
|
|
+ id="editGrap-submit"
|
|
size="large"
|
|
size="large"
|
|
:disabled="spinning"
|
|
:disabled="spinning"
|
|
class="button-primary"
|
|
class="button-primary"
|
|
@@ -215,26 +181,42 @@
|
|
style="padding: 0 60px;">提交</a-button>
|
|
style="padding: 0 60px;">提交</a-button>
|
|
</div>
|
|
</div>
|
|
<!-- 导入产品 -->
|
|
<!-- 导入产品 -->
|
|
- <importGuideModal :openModal="openGuideModal" :params="{allocateSn: $route.params.sn}" @close="openGuideModal=false" @ok="handleGuideOk" />
|
|
|
|
- <!-- 打印导出 -->
|
|
|
|
- <print-modal :openModal="openModal" :itemData="basicInfoData" :nowType="nowType" @ok="handleOk" @close="openModal=false" />
|
|
|
|
- <!-- 打印 -->
|
|
|
|
- <div id="print"></div>
|
|
|
|
|
|
+ <!-- <importGuideModal :openModal="openGuideModal" :params="{allocateSn: $route.params.sn}" @close="openGuideModal=false" @ok="handleGuideOk" /> -->
|
|
|
|
+ <!-- 修改基础信息 -->
|
|
|
|
+ <a-modal
|
|
|
|
+ centered
|
|
|
|
+ wrapClassName="allocateBill-editRemark-modal"
|
|
|
|
+ v-if="basicInfoData"
|
|
|
|
+ :footer="null"
|
|
|
|
+ :maskClosable="false"
|
|
|
|
+ title="修改备注"
|
|
|
|
+ v-model="editRemark"
|
|
|
|
+ @cancle="editRemark = false"
|
|
|
|
+ :width="600">
|
|
|
|
+ <a-textarea
|
|
|
|
+ v-model="basicInfoData.remark"
|
|
|
|
+ placeholder="请输入备注(最多120个字符)"
|
|
|
|
+ :maxLength="120"
|
|
|
|
+ :auto-size="{ minRows: 3, maxRows: 5 }"
|
|
|
|
+ />
|
|
|
|
+ <div class="btn-cont">
|
|
|
|
+ <a-button type="primary" id="allocateBill-basicInfo-modal-save" @click="handleEditRemark">保存</a-button>
|
|
|
|
+ <a-button id="allocateBill-basicInfo-modal-back" @click="editRemark = false" style="margin-left: 15px;">取消</a-button>
|
|
|
|
+ </div>
|
|
|
|
+ </a-modal>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
-import ImportGuideModal from './importGuideModal.vue'
|
|
|
|
-import printModal from './printModal.vue'
|
|
|
|
-import { hdExportExcel } from '@/libs/exportExcel'
|
|
|
|
|
|
+// import ImportGuideModal from './importGuideModal.vue'
|
|
|
|
+import print from './print.vue'
|
|
import { queryStockProductPage } from '@/api/stock'
|
|
import { queryStockProductPage } from '@/api/stock'
|
|
-import { productPriceInfo } from '@/api/product'
|
|
|
|
import AllocateType from '@/views/common/allocateType.js'
|
|
import AllocateType from '@/views/common/allocateType.js'
|
|
-import { allocateBillSave, allocateBillDetailList, allocateBillDetailCount, allocateBillDetail, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillDetailPrint, allocateBillBatchInsert, allocateBillDetailExcel } from '@/api/allocateBill'
|
|
|
|
|
|
+import { allocateBillSave, allocateBillDetailList, allocateBillDetailCount, allocateBillDetail, allocateBillDetailSave, allocateBillSubmit, allocateBillDetailDel, allocateBillDetailDelAll, allocateBillBatchInsert } from '@/api/allocateBill'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- components: { STable, VSelect, ImportGuideModal, AllocateType, printModal },
|
|
|
|
|
|
+ components: { STable, VSelect, AllocateType, print },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
spinning: false,
|
|
spinning: false,
|
|
@@ -247,6 +229,7 @@ export default {
|
|
productCode: '',
|
|
productCode: '',
|
|
productName: ''
|
|
productName: ''
|
|
},
|
|
},
|
|
|
|
+ editRemark: false,
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
loading: false,
|
|
loading: false,
|
|
chooseDisabled: false, // 查询、重置按钮是否可操作
|
|
chooseDisabled: false, // 查询、重置按钮是否可操作
|
|
@@ -292,81 +275,75 @@ export default {
|
|
},
|
|
},
|
|
productTotal: null, // 合计
|
|
productTotal: null, // 合计
|
|
basicInfoData: null, // 基本信息
|
|
basicInfoData: null, // 基本信息
|
|
- openGuideModal: false, // 导入产品引导
|
|
|
|
- openModal: false,
|
|
|
|
- nowType: null
|
|
|
|
|
|
+ openGuideModal: false // 导入产品引导
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
columns () {
|
|
columns () {
|
|
const arr = [
|
|
const arr = [
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
|
+ { title: '调拨单号', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品名称', dataIndex: 'productName', align: 'center', width: '29%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '产品名称', dataIndex: 'productName', align: 'center', width: '29%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
- { title: '原厂编码', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- // { title: '成本价', dataIndex: 'lastStockCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- // { title: '售价', dataIndex: 'productPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '库存数量', dataIndex: 'currentStockQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '单位', dataIndex: 'productUnit', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action1' }, width: '10%', align: 'center' }
|
|
|
|
|
|
+ { title: '单位', dataIndex: 'productUnit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '调拨单价', dataIndex: 'lastStockCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '调拨数量', dataIndex: 'currentStockQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '剩余可退数量', dataIndex: 'productPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '10%', align: 'center' },
|
|
|
|
+ { title: '退货数量', dataIndex: 'returnQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
]
|
|
]
|
|
- if (this.$hasPermissions('B_isShowCost')) { // 成本价权限
|
|
|
|
- arr.splice(4, 0, { title: '成本价', dataIndex: 'lastStockCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
|
- }
|
|
|
|
- if (this.$hasPermissions('B_isShowPrice')) { // 售价权限
|
|
|
|
- const ind = this.$hasPermissions('B_isShowCost') ? 5 : 4
|
|
|
|
- arr.splice(ind, 0, { title: '售价', dataIndex: 'productPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
|
- }
|
|
|
|
return arr
|
|
return arr
|
|
},
|
|
},
|
|
chooseColumns () {
|
|
chooseColumns () {
|
|
const arr = [
|
|
const arr = [
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
|
+ { title: '调拨单号', dataIndex: 'productOrigCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品编码', dataIndex: 'productEntity.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '产品编码', dataIndex: 'productEntity.code', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
- { title: '产品名称', dataIndex: 'productEntity.name', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
- { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- // { title: '成本价', dataIndex: 'cost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- // { title: '售价', scopedSlots: { customRender: 'price' }, width: '10%', align: 'center' },
|
|
|
|
- { title: '库存数量', dataIndex: 'currentStockQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
- { title: '调出数量', scopedSlots: { customRender: 'qty' }, width: '10%', align: 'center' },
|
|
|
|
- { title: '单位', dataIndex: 'productEntity.unit', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: '6%', align: 'center' }
|
|
|
|
|
|
+ { title: '产品名称', dataIndex: 'productEntity.name', align: 'center', width: '29%', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
+ { title: '单位', dataIndex: 'productEntity.unit', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '调拨单价', dataIndex: 'lastStockCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '调拨数量', dataIndex: 'currentStockQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '剩余可退数量', dataIndex: 'productPrice', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '退货单价', scopedSlots: { customRender: 'returnPrice' }, width: '10%', align: 'center' },
|
|
|
|
+ { title: '退货数量', dataIndex: 'returnQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '退货金额', dataIndex: 'returnAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
|
|
]
|
|
]
|
|
- if (this.$hasPermissions('B_isShowCost')) { // 成本价权限
|
|
|
|
- arr.splice(4, 0, { title: '成本价', dataIndex: 'cost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
|
|
|
|
- }
|
|
|
|
- if (this.$hasPermissions('B_isShowPrice')) { // 售价权限
|
|
|
|
- const ind = this.$hasPermissions('B_isShowCost') ? 5 : 4
|
|
|
|
- arr.splice(ind, 0, { title: '售价', scopedSlots: { customRender: 'price' }, width: '10%', align: 'center' })
|
|
|
|
- }
|
|
|
|
return arr
|
|
return arr
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 修改备注
|
|
|
|
+ handleEditRemark () {
|
|
|
|
+ const _this = this
|
|
|
|
+ const params = _this.basicInfoData
|
|
|
|
+ allocateBillSave({
|
|
|
|
+ allocateSn: params.allocateSn,
|
|
|
|
+ targetType: params.targetType,
|
|
|
|
+ targetSn: params.targetSn,
|
|
|
|
+ targetName: params.targetName,
|
|
|
|
+ allocateTypeSn: params.allocateTypeSn,
|
|
|
|
+ remark: params.remark
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.$message.success(res.message)
|
|
|
|
+ _this.getDetail()
|
|
|
|
+ } else {
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ _this.editRemark = false
|
|
|
|
+ },
|
|
// 修改调拨类型
|
|
// 修改调拨类型
|
|
changeAllocateType (val) {
|
|
changeAllocateType (val) {
|
|
const _this = this
|
|
const _this = this
|
|
this.$confirm({
|
|
this.$confirm({
|
|
title: '提示',
|
|
title: '提示',
|
|
- content: '确定要更改调拨类型吗?',
|
|
|
|
|
|
+ content: '确定要更改调拨退货类型吗?',
|
|
centered: true,
|
|
centered: true,
|
|
onOk () {
|
|
onOk () {
|
|
- const params = _this.basicInfoData
|
|
|
|
- allocateBillSave({
|
|
|
|
- allocateSn: params.allocateSn,
|
|
|
|
- targetType: params.targetType,
|
|
|
|
- targetSn: params.targetSn,
|
|
|
|
- targetName: params.targetName,
|
|
|
|
- allocateTypeSn: params.allocateTypeSn,
|
|
|
|
- remark: params.remark
|
|
|
|
- }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- _this.$message.success(res.message)
|
|
|
|
- _this.getDetail()
|
|
|
|
- } else {
|
|
|
|
- _this.spinning = false
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ _this.handleEditRemark()
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -503,82 +480,15 @@ export default {
|
|
},
|
|
},
|
|
// 返回列表
|
|
// 返回列表
|
|
handleBack () {
|
|
handleBack () {
|
|
- this.$router.push({ path: '/allocationManagement/transferOut/list', query: { closeLastOldTab: true } })
|
|
|
|
- },
|
|
|
|
- // 已选产品 调出数量 blur
|
|
|
|
- qtyBlur (val, record) {
|
|
|
|
- // 光标移出,值发生改变再调用编辑接口
|
|
|
|
- if (val != record.qtyBackups) {
|
|
|
|
- this.handleAdd(record, 'edit')
|
|
|
|
- }
|
|
|
|
|
|
+ this.$router.push({ name: 'transferReturnList', query: { closeLastOldTab: true } })
|
|
},
|
|
},
|
|
- // 已选产品 售价 change
|
|
|
|
|
|
+ // 已选产品 退货单价 change
|
|
priceChange (val, record) {
|
|
priceChange (val, record) {
|
|
// 光标移出,值发生改变再调用编辑接口
|
|
// 光标移出,值发生改变再调用编辑接口
|
|
if (val != record.priceBackups) {
|
|
if (val != record.priceBackups) {
|
|
this.handleAdd(record, 'edit', 'noRefresh')
|
|
this.handleAdd(record, 'edit', 'noRefresh')
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 获取价格
|
|
|
|
- priceFocus (row, index) {
|
|
|
|
- if (row.productSn) {
|
|
|
|
- productPriceInfo({ sn: row.productSn }).then(res => {
|
|
|
|
- if (res.status == 200 && res.data) {
|
|
|
|
- this.loadDataSource[index].provincePrice = res.data.provincePrice || undefined
|
|
|
|
- this.loadDataSource[index].cityPrice = res.data.cityPrice || undefined
|
|
|
|
- this.loadDataSource[index].specialPrice = res.data.specialPrice || undefined
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 导出
|
|
|
|
- handleExcel () {
|
|
|
|
- const _this = this
|
|
|
|
- this.spinning = true
|
|
|
|
- hdExportExcel(allocateBillDetailExcel, { allocateSn: this.$route.params.sn }, '调拨明细', function () {
|
|
|
|
- _this.spinning = false
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 打印预览/快捷打印
|
|
|
|
- handlePrint (type) {
|
|
|
|
- this.nowType = type
|
|
|
|
- this.openModal = true
|
|
|
|
- },
|
|
|
|
- handleOk (objs) {
|
|
|
|
- const _this = this
|
|
|
|
- const params = JSON.parse(JSON.stringify(objs))
|
|
|
|
- delete params.type
|
|
|
|
- _this.spinning = true
|
|
|
|
- allocateBillDetailPrint(params).then(res => {
|
|
|
|
- _this.spinning = false
|
|
|
|
- if (res.type == 'application/json') {
|
|
|
|
- var reader = new FileReader()
|
|
|
|
- reader.addEventListener('loadend', function () {
|
|
|
|
- const obj = JSON.parse(reader.result)
|
|
|
|
- _this.$notification.error({
|
|
|
|
- message: '提示',
|
|
|
|
- description: obj.message
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- reader.readAsText(res)
|
|
|
|
- } else {
|
|
|
|
- this.print(res, objs.isPreview)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- print (data, type) {
|
|
|
|
- if (!data) {
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }))
|
|
|
|
- document.getElementById('print').innerHTML = '<iframe id="printftoe" name="printftoe" src="' + url + '" hidden></iframe>'
|
|
|
|
- if (type == '1') { // 预览
|
|
|
|
- window.open(url)
|
|
|
|
- } else if (type == '0') { // 打印
|
|
|
|
- window.frames['printftoe'].focus()
|
|
|
|
- window.frames['printftoe'].print()
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
// 刷新当前页面
|
|
// 刷新当前页面
|
|
refashPage () {
|
|
refashPage () {
|
|
this.$refs.table.refresh()
|
|
this.$refs.table.refresh()
|
|
@@ -608,7 +518,7 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|
|
<style lang="less">
|
|
- .allocateBillEdit-wrap{
|
|
|
|
|
|
+ .editGrap-wrap{
|
|
position: relative;
|
|
position: relative;
|
|
height: 100%;
|
|
height: 100%;
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
@@ -617,10 +527,10 @@ export default {
|
|
height: 100%;
|
|
height: 100%;
|
|
padding-bottom: 51px;
|
|
padding-bottom: 51px;
|
|
}
|
|
}
|
|
- .allocateBillEdit-back{
|
|
|
|
|
|
+ .editGrap-back{
|
|
margin-bottom: 10px;
|
|
margin-bottom: 10px;
|
|
}
|
|
}
|
|
- .allocateBillEdit-cont{
|
|
|
|
|
|
+ .editGrap-cont{
|
|
margin-bottom: 10px;
|
|
margin-bottom: 10px;
|
|
.sub-title{
|
|
.sub-title{
|
|
font-size: 12px;
|
|
font-size: 12px;
|
|
@@ -642,4 +552,10 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .allocateBill-editRemark-modal{
|
|
|
|
+ .btn-cont{
|
|
|
|
+ text-align: center;
|
|
|
|
+ padding-top: 20px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|