|
@@ -57,8 +57,9 @@
|
|
|
expand-trigger="hover"
|
|
|
:options="warehouseCascadeData"
|
|
|
:fieldNames="{ label: 'name', value: 'id', children: 'warehouseLocationList' }"
|
|
|
- id="bulkWarehousingOrderEdit-warehouseCascade"
|
|
|
+ id="purchaseOrderWarehousing-warehouseCascade"
|
|
|
placeholder="请选择仓库仓位"
|
|
|
+ :allowClear="false"
|
|
|
style="width: 100%;" />
|
|
|
</template>
|
|
|
</s-table>
|
|
@@ -73,8 +74,8 @@
|
|
|
|
|
|
<script>
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
-import { purchaseDetailBySn } from '@/api/purchase'
|
|
|
-import { purchaseDetailList, updateWarehouse } from '@/api/purchaseDetail'
|
|
|
+import { purchaseDetailBySn, purchaseWriteStockIn } from '@/api/purchase'
|
|
|
+import { purchaseDetailList, purchaseUpdateWarehouse } from '@/api/purchaseDetail'
|
|
|
import ProductType from '../../common/productType.js'
|
|
|
import ProductBrand from '../../common/productBrand.js'
|
|
|
import { warehouseCascadeList } from '@/api/warehouse'
|
|
@@ -96,7 +97,7 @@ export default {
|
|
|
warehouseCascadeData: [], // 仓库仓位
|
|
|
// 表头
|
|
|
columns: [
|
|
|
- { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
|
|
|
+ { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
|
{ title: '产品编码', dataIndex: 'dealerProductEntity.code', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '产品名称', dataIndex: 'dealerProductEntity.name', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '原厂编码', dataIndex: 'dealerProductEntity.origCode', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
|
|
@@ -104,9 +105,9 @@ export default {
|
|
|
{ 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: 'totalAmount', width: 100, align: 'center', customRender: function (text) { return '¥' + (text || 0) } },
|
|
|
- { title: '入库数量', dataIndex: 'putQty', width: 100, align: 'center' },
|
|
|
- { title: '仓库仓位', scopedSlots: { customRender: 'warehousePosition' }, width: 300, align: 'center' }
|
|
|
+ { 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' }
|
|
|
],
|
|
|
chooseLoadData: [],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
@@ -156,7 +157,12 @@ export default {
|
|
|
},
|
|
|
// 确认入库
|
|
|
handleWarehousing () {
|
|
|
-
|
|
|
+ purchaseWriteStockIn({ id: this.detail.id }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.$message.info(res.message)
|
|
|
+ this.handleBack()
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 返回列表
|
|
|
handleBack () {
|
|
@@ -191,7 +197,7 @@ export default {
|
|
|
changeWarehouseCascade (val, opt, ind) {
|
|
|
console.log(val, opt, ind)
|
|
|
let loadData = this.chooseLoadData[ind]
|
|
|
- if (val.length < 2) {
|
|
|
+ if (val.length == 1) {
|
|
|
this.$message.warning('当前仓库无仓位,请选择其他仓库')
|
|
|
const warehouseSnBackups = loadData.warehouseSnBackups || undefined
|
|
|
const warehouseLocationSnBackups = loadData.warehouseLocationSnBackups || undefined
|
|
@@ -213,8 +219,15 @@ export default {
|
|
|
},
|
|
|
// 修改库存
|
|
|
updateWarehouse (row) {
|
|
|
- updateWarehouse({ warehouseSn: row.warehouseSn, warehouseLocationSn: row.warehouseLocationSn }).then(res => {
|
|
|
-
|
|
|
+ purchaseUpdateWarehouse({
|
|
|
+ id: row.id,
|
|
|
+ warehouseSn: row.warehouseSn,
|
|
|
+ warehouseLocationSn: row.warehouseLocationSn
|
|
|
+ }).then(res => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ this.$message.info(res.message)
|
|
|
+ this.$refs.table.refresh()
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
},
|