|
@@ -0,0 +1,173 @@
|
|
|
+<template>
|
|
|
+ <a-drawer
|
|
|
+ :zIndex="1010"
|
|
|
+ title="出库明细"
|
|
|
+ placement="right"
|
|
|
+ :visible="isShow"
|
|
|
+ width="80%"
|
|
|
+ :get-container="false"
|
|
|
+ :wrap-style="{ position: 'absolute' }"
|
|
|
+ @close="isShow = false"
|
|
|
+ wrapClassName="outIndetail-modal jg-drawer-wrap"
|
|
|
+ >
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
+ <div class="baseInfo" ref="searchBox" v-if="baseData">
|
|
|
+ <div>
|
|
|
+ <span>产品编码:{{ baseData.dealerProductEntity ? baseData.dealerProductEntity.code : baseData.productCode }}</span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <span>产品名称:{{ baseData.dealerProductEntity ? baseData.dealerProductEntity.name : baseData.productName }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="outIndetail-modal-table">
|
|
|
+ <!-- 列表 -->
|
|
|
+ <s-table
|
|
|
+ class="sTable"
|
|
|
+ ref="table"
|
|
|
+ size="small"
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
+ :columns="columns"
|
|
|
+ :data="loadData"
|
|
|
+ :scroll="{ y: tableHeight }"
|
|
|
+ :defaultLoadData="false"
|
|
|
+ :showPagination="false"
|
|
|
+ bordered>
|
|
|
+ </s-table>
|
|
|
+ </div>
|
|
|
+ </a-spin>
|
|
|
+ </a-drawer>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { commonMixin } from '@/utils/mixin'
|
|
|
+import { STable } from '@/components'
|
|
|
+import { stockOutDetailList } from '@/api/stockOut'
|
|
|
+export default {
|
|
|
+ name: 'OutinDetailModal',
|
|
|
+ components: { STable },
|
|
|
+ mixins: [commonMixin],
|
|
|
+ props: {
|
|
|
+ openModal: {
|
|
|
+ // 弹框显示状态
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ },
|
|
|
+ outBizType: {
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ spinning: false,
|
|
|
+ isShow: this.openModal, // 是否打开弹框
|
|
|
+ tableHeight: 0,
|
|
|
+ baseData: null,
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ this.disabled = true
|
|
|
+ this.spinning = true
|
|
|
+ // outBizType = SHOP_CALL_OUT(店内调出) / SALES (销售)
|
|
|
+ const params = this.baseData
|
|
|
+ console.log(params)
|
|
|
+ const queryParams = { outBizType: this.outBizType, productSn: params.productSn }
|
|
|
+ if (this.outBizType == 'SALES') {
|
|
|
+ queryParams.outBizSn = params.salesBillSn
|
|
|
+ queryParams.outBizNo = params.salesBillNo
|
|
|
+ }
|
|
|
+ if (this.outBizType == 'SHOP_CALL_OUT') {
|
|
|
+ queryParams.outBizSn = params.storeCallOutSn
|
|
|
+ queryParams.outBizNo = params.storeCallOutNo
|
|
|
+ }
|
|
|
+ // 仓库仓位
|
|
|
+ queryParams.warehouseSn = params.warehouseSn
|
|
|
+ queryParams.warehouseLocationSn = params.warehouseLocationSn
|
|
|
+ return stockOutDetailList(queryParams).then(res => {
|
|
|
+ let data
|
|
|
+ if (res.status == 200) {
|
|
|
+ data = res.data
|
|
|
+ const no = 0
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ data[i].no = no + i + 1
|
|
|
+ data[i].totalCost = Number(data[i].putCost * data[i].outQty).toFixed(2)
|
|
|
+ }
|
|
|
+ this.disabled = false
|
|
|
+ }
|
|
|
+ this.spinning = false
|
|
|
+ return data
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ columns () {
|
|
|
+ const _this = this
|
|
|
+ const arr = [
|
|
|
+ { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
|
|
|
+ { title: '库存批次', dataIndex: 'stockBatchNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '入库类型', dataIndex: 'putBizTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '仓库', dataIndex: 'warehouseName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ { title: '仓位', dataIndex: 'warehouseLocationName', width: '15%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
+ // { title: '成本价', dataIndex: 'putCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
+ { title: '本次出库数量', dataIndex: 'outQty', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
+ // { title: '成本小计', dataIndex: 'totalCost', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
|
|
|
+ ]
|
|
|
+ if (this.$hasPermissions('M_ShowAllCost')) {
|
|
|
+ arr.splice(5, 0, { title: '成本价', dataIndex: 'putCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
+ arr.splice(7, 0, { title: '成本小计', dataIndex: 'totalCost', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
|
|
|
+ }
|
|
|
+ return arr
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ setTableH () {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ const searchBoxH = this.$refs.searchBox.offsetHeight
|
|
|
+ this.tableHeight = window.innerHeight - searchBoxH - 235
|
|
|
+ })
|
|
|
+ },
|
|
|
+ cansel () {
|
|
|
+ this.isShow = false
|
|
|
+ this.baseData = null
|
|
|
+ },
|
|
|
+ getData (row) {
|
|
|
+ this.baseData = row
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ // 父页面传过来的弹框状态
|
|
|
+ openModal (newValue, oldValue) {
|
|
|
+ this.isShow = newValue
|
|
|
+ },
|
|
|
+ '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
|
|
|
+ this.setTableH()
|
|
|
+ },
|
|
|
+ // 重定义的弹框状态
|
|
|
+ isShow (newValue, oldValue) {
|
|
|
+ if (!newValue) {
|
|
|
+ this.$emit('close')
|
|
|
+ }else{
|
|
|
+ this.setTableH()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less">
|
|
|
+.outIndetail-modal {
|
|
|
+ .ant-drawer-body {
|
|
|
+ padding: 10px 20px;
|
|
|
+ .outIndetail-modal-table{
|
|
|
+ padding: 20px 0 0;
|
|
|
+ }
|
|
|
+ .baseInfo{
|
|
|
+ line-height: 24px;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|