|
@@ -4,55 +4,32 @@
|
|
|
<!-- 自定义的二级文字标题 -->
|
|
|
<template slot="subTitle">
|
|
|
<a id="purchaseOrderWarehousing-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
|
- <span class="billno">单号:{{ detail&&detail.purchaseBillNo }}</span>
|
|
|
+ <span class="billno">单号:{{ detail&&detail[0].purchaseBillNo }}</span>
|
|
|
</template>
|
|
|
</a-page-header>
|
|
|
<!-- 内容 -->
|
|
|
- <a-card size="small" :bordered="false" class="purchaseOrderWarehousing-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="关键词">
|
|
|
- <a-input id="purchaseOrderWarehousing-bundleName" v-model.trim="queryParam.queryWord" allowClear placeholder="产品名称/产品编码/原厂编码"/>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="产品品牌">
|
|
|
- <ProductBrand id="purchaseOrderWarehousing-productBrand" v-model="queryParam.productBrandSn"></ProductBrand>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :md="6" :sm="24">
|
|
|
- <a-form-item label="产品类别">
|
|
|
- <ProductType id="purchaseOrderWarehousing-productType" @change="changeProductType" v-model="productType"></ProductType>
|
|
|
- </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="purchaseOrderWarehousing-refresh">查询</a-button>
|
|
|
- <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="purchaseOrderWarehousing-reset">重置</a-button>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- </a-form>
|
|
|
- </div>
|
|
|
+ <a-card size="small" v-for="(item,bindex) in detail" :key="item.id" :bordered="false" class="purchaseOrderWarehousing-cont">
|
|
|
<!-- 总计 -->
|
|
|
<a-alert type="info" showIcon style="margin-bottom:15px">
|
|
|
- <div slot="message">产品款数 <strong>6</strong> ,采购数量合计 <strong>6</strong> ,采购金额合计¥<strong>6.33</strong></div>
|
|
|
+ <div slot="message" >
|
|
|
+ <div>产品款数 <strong>{{ item.totalCategory }}</strong> ,采购数量合计 <strong>{{ item.totalQty }}</strong> ,采购金额合计¥<strong>{{ item.totalAmount }}</strong></div>
|
|
|
+ </div>
|
|
|
</a-alert>
|
|
|
<!-- 列表 -->
|
|
|
<s-table
|
|
|
class="sTable"
|
|
|
- ref="table"
|
|
|
+ :ref="'table-'+bindex"
|
|
|
size="default"
|
|
|
:rowKey="(record) => record.id"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
+ :tableId="item.receivingBillSn"
|
|
|
:scroll="{ x: 1360 }"
|
|
|
bordered>
|
|
|
<!-- 仓库仓位 -->
|
|
|
<template slot="warehousePosition" slot-scope="text, record, index">
|
|
|
<a-cascader
|
|
|
- @change="e => changeWarehouseCascade(e, record, index)"
|
|
|
+ @change="e => changeWarehouseCascade(e, record, index, bindex)"
|
|
|
v-model="record.warehouseCascade"
|
|
|
expand-trigger="hover"
|
|
|
:options="warehouseCascadeData"
|
|
@@ -63,19 +40,17 @@
|
|
|
style="width: 100%;" />
|
|
|
</template>
|
|
|
</s-table>
|
|
|
- </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="purchaseOrderWarehousing-warehousing" size="large" @click="handleWarehousing" style="padding: 0 60px;">确认入库</a-button>
|
|
|
+ <div style="text-align: center;">
|
|
|
+ <a-button type="primary" class="button-warning" :id="'purchaseOrderWarehousing-warehousing-'+bindex" @click="handleWarehousing(item,bindex)" >确认入库</a-button>
|
|
|
</div>
|
|
|
- </a-affix>
|
|
|
+ </a-card>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
-import { purchaseDetailBySn, purchaseWriteStockIn, receivingQuery, receivingDetail } from '@/api/purchase'
|
|
|
-import { purchaseDetailList, purchaseUpdateWarehouse } from '@/api/purchaseDetail'
|
|
|
+import { purchaseWriteStockIn, receivingQuery, receivingDetail } from '@/api/purchase'
|
|
|
+import { purchaseUpdateWarehouse } from '@/api/purchaseDetail'
|
|
|
import ProductType from '../../common/productType.js'
|
|
|
import ProductBrand from '../../common/productBrand.js'
|
|
|
import { warehouseCascadeList } from '@/api/warehouse'
|
|
@@ -104,7 +79,7 @@ export default {
|
|
|
{ title: '采购单价', dataIndex: 'price', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '采购数量', dataIndex: 'qty', width: 100, align: 'center', customRender: function (text) { return text || 0 } },
|
|
|
{ title: '本次发货数量', dataIndex: 'oosQty', width: 100, align: 'center', customRender: function (text) { return text || 0 } },
|
|
|
- { title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '单位', dataIndex: 'dealerProductEntity.unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '采购金额', dataIndex: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) }, fixed: 'right' },
|
|
|
{ title: '本次入库数量', dataIndex: 'putQty', width: 100, align: 'center', fixed: 'right' },
|
|
|
{ title: '仓库仓位', scopedSlots: { customRender: 'warehousePosition' }, width: 250, align: 'center', fixed: 'right' }
|
|
@@ -112,9 +87,10 @@ export default {
|
|
|
chooseLoadData: [],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
+ console.log(parameter)
|
|
|
this.disabled = true
|
|
|
- this.queryParam.purchaseBillSn = this.$route.params.sn
|
|
|
- return purchaseDetailList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ this.queryParam.receivingBillSn = parameter.tableId
|
|
|
+ return receivingDetail(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++) {
|
|
@@ -157,11 +133,10 @@ export default {
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 确认入库
|
|
|
- handleWarehousing () {
|
|
|
- purchaseWriteStockIn({ id: this.detail.id }).then(res => {
|
|
|
+ handleWarehousing (row, index) {
|
|
|
+ purchaseWriteStockIn({ id: row.id }).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.$message.info(res.message)
|
|
|
- this.handleBack()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -195,7 +170,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 修改仓库仓位
|
|
|
- changeWarehouseCascade (val, opt, ind) {
|
|
|
+ changeWarehouseCascade (val, opt, ind, bindex) {
|
|
|
console.log(val, opt, ind)
|
|
|
let loadData = this.chooseLoadData[ind]
|
|
|
if (val.length == 1) {
|
|
@@ -215,11 +190,11 @@ export default {
|
|
|
loadData.warehouseSnBackups = val[0] ? val[0] : ''
|
|
|
loadData.warehouseLocationSnBackups = val[1] ? val[1] : ''
|
|
|
loadData = this.chooseLoadData[ind]
|
|
|
- this.updateWarehouse(loadData)
|
|
|
+ this.updateWarehouse(loadData, bindex)
|
|
|
}
|
|
|
},
|
|
|
// 修改库存
|
|
|
- updateWarehouse (row) {
|
|
|
+ updateWarehouse (row, bindex) {
|
|
|
purchaseUpdateWarehouse({
|
|
|
id: row.id,
|
|
|
warehouseSn: row.warehouseSn,
|
|
@@ -227,7 +202,8 @@ export default {
|
|
|
}).then(res => {
|
|
|
if (res.status == 200) {
|
|
|
this.$message.info(res.message)
|
|
|
- this.$refs.table.refresh()
|
|
|
+ console.log(bindex, this.$refs)
|
|
|
+ this.$refs['table-' + bindex][0].refresh()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -250,5 +226,8 @@ export default {
|
|
|
font-weight: bold;
|
|
|
margin: 0 15px;
|
|
|
}
|
|
|
+ .purchaseOrderWarehousing-cont{
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|