|
@@ -5,7 +5,6 @@
|
|
<!-- 自定义的二级文字标题 -->
|
|
<!-- 自定义的二级文字标题 -->
|
|
<template slot="subTitle">
|
|
<template slot="subTitle">
|
|
<a id="bulkWarehousingOrderEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
<a id="bulkWarehousingOrderEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
|
|
- <!-- <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">单号:{{ (basicInfoData&&basicInfoData.sparePartsPurchaseNo) || '' }}</p> -->
|
|
|
|
</template>
|
|
</template>
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<!-- 操作区,位于 title 行的行尾 -->
|
|
<template slot="extra">
|
|
<template slot="extra">
|
|
@@ -21,9 +20,9 @@
|
|
基础信息
|
|
基础信息
|
|
</template>
|
|
</template>
|
|
<a-descriptions :column="3">
|
|
<a-descriptions :column="3">
|
|
- <a-descriptions-item label="供应商">{{ (basicInfoData&&basicInfoData.supplierName) || '--' }}</a-descriptions-item>
|
|
|
|
- <a-descriptions-item label="入库类型">{{ (basicInfoData&&basicInfoData.sparePartsTypeName) || '--' }}</a-descriptions-item>
|
|
|
|
- <a-descriptions-item label="入库单号">{{ (basicInfoData&&basicInfoData.remarks) || '--' }}</a-descriptions-item>
|
|
|
|
|
|
+ <a-descriptions-item label="供应商">{{ (productTotal&&productTotal.supplierName) || '--' }}</a-descriptions-item>
|
|
|
|
+ <a-descriptions-item label="入库类型">{{ (productTotal&&productTotal.sparePartsTypeDictValue) || '--' }}</a-descriptions-item>
|
|
|
|
+ <a-descriptions-item label="入库单号">{{ (productTotal&&productTotal.sparePartsNo) || '--' }}</a-descriptions-item>
|
|
</a-descriptions>
|
|
</a-descriptions>
|
|
</a-collapse-panel>
|
|
</a-collapse-panel>
|
|
</a-collapse>
|
|
</a-collapse>
|
|
@@ -31,7 +30,7 @@
|
|
<a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-cont">
|
|
<a-card size="small" :bordered="false" class="bulkWarehousingOrderEdit-cont">
|
|
<!-- 操作按钮 -->
|
|
<!-- 操作按钮 -->
|
|
<div class="table-operator">
|
|
<div class="table-operator">
|
|
- <a-button id="bulkWarehousingOrderEdit-add" type="primary" class="button-error" @click="handleAdd">新增产品</a-button>
|
|
|
|
|
|
+ <a-button id="bulkWarehousingOrderEdit-add" type="primary" class="button-error" @click="handleEdit()">新增产品</a-button>
|
|
</div>
|
|
</div>
|
|
<!-- 总计 -->
|
|
<!-- 总计 -->
|
|
<a-alert type="info" showIcon style="margin-bottom:15px">
|
|
<a-alert type="info" showIcon style="margin-bottom:15px">
|
|
@@ -70,18 +69,19 @@
|
|
id="bulkWarehousingOrderEdit-submit"
|
|
id="bulkWarehousingOrderEdit-submit"
|
|
size="large"
|
|
size="large"
|
|
class="button-primary"
|
|
class="button-primary"
|
|
- @click="handleSubmit"
|
|
|
|
|
|
+ @click="handleBack"
|
|
style="padding: 0 60px;">保存并返回</a-button>
|
|
style="padding: 0 60px;">保存并返回</a-button>
|
|
</div>
|
|
</div>
|
|
</a-affix>
|
|
</a-affix>
|
|
- <spare-parts-product-modal :openModal="openModal" :itemSn="itemSn" @ok="handleOk" @close="openModal=false" />
|
|
|
|
|
|
+ <spare-parts-product-modal :openModal="openModal" :itemSn="itemSn" :nowData="productTotal" @ok="$refs.table.refresh(true)" @close="openModal=false" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { STable, VSelect } from '@/components'
|
|
import { STable, VSelect } from '@/components'
|
|
|
|
+import { getOperationalPrecision } from '@/libs/tools.js'
|
|
import sparePartsProductModal from './productModal.vue'
|
|
import sparePartsProductModal from './productModal.vue'
|
|
-import { sparePartsDetailList, sparePartsPageCount } from '@/api/spareParts'
|
|
|
|
|
|
+import { sparePartsDetailList, sparePartsPageCount, sparePartsDeleteDetail } from '@/api/spareParts'
|
|
export default {
|
|
export default {
|
|
components: { STable, VSelect, sparePartsProductModal },
|
|
components: { STable, VSelect, sparePartsProductModal },
|
|
data () {
|
|
data () {
|
|
@@ -89,13 +89,13 @@ export default {
|
|
// 表头
|
|
// 表头
|
|
columns: [
|
|
columns: [
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: 80, align: 'center' },
|
|
- { title: '产品编码', dataIndex: 'code', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '产品名称', dataIndex: 'name', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
|
|
|
|
+ { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '产品名称', dataIndex: 'productName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
{ title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
{ title: '单位', dataIndex: 'unit', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
- { title: '入库数量', dataIndex: 'putQty', width: 140, align: 'center' },
|
|
|
|
- { title: '入库单价', dataIndex: 'putCost', width: 140, align: 'center' },
|
|
|
|
- { title: '小计', dataIndex: 'origCode', width: 220, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
- { title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center', fixed: 'right' }
|
|
|
|
|
|
+ { title: '入库数量', dataIndex: 'productQty', width: 100, align: 'center' },
|
|
|
|
+ { title: '入库单价', dataIndex: 'productCost', width: 100, align: 'center' },
|
|
|
|
+ { title: '小计', dataIndex: 'subtotal', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '操作', scopedSlots: { customRender: 'action' }, width: 120, align: 'center', fixed: 'right' }
|
|
],
|
|
],
|
|
// 加载数据方法 必须为 Promise 对象
|
|
// 加载数据方法 必须为 Promise 对象
|
|
loadData: parameter => {
|
|
loadData: parameter => {
|
|
@@ -104,6 +104,8 @@ export default {
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
data.list[i].no = no + i + 1
|
|
data.list[i].no = no + i + 1
|
|
|
|
+ // 小计 由于数据库内小数位数为4位,页面则需显示2位。因此会做小数运算精度处理
|
|
|
|
+ data.list[i].subtotal = getOperationalPrecision(data.list[i].productCost, data.list[i].productQty)
|
|
}
|
|
}
|
|
this.getDetailCount(Object.assign(parameter, { sn: this.$route.params.sn }))
|
|
this.getDetailCount(Object.assign(parameter, { sn: this.$route.params.sn }))
|
|
return data
|
|
return data
|
|
@@ -116,32 +118,11 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // 基本信息
|
|
|
|
- getDetail () {
|
|
|
|
- sparePartsPurDetail({ id: this.$route.params.id }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.basicInfoData = res.data
|
|
|
|
- } else {
|
|
|
|
- this.basicInfoData = null
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- // 添加
|
|
|
|
- handleAdd () {
|
|
|
|
|
|
+ // 添加/编辑
|
|
|
|
+ handleEdit (row) {
|
|
|
|
+ this.itemSn = (row && row.sparePartsDetailSn) ? row.sparePartsDetailSn : null
|
|
this.openModal = true
|
|
this.openModal = true
|
|
},
|
|
},
|
|
- // 保存
|
|
|
|
- handleSubmit () {
|
|
|
|
- const _this = this
|
|
|
|
- sparePartsPurSubmit({ id: this.$route.params.id }).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.$message.success(res.message)
|
|
|
|
- setTimeout(() => {
|
|
|
|
- _this.handleBack()
|
|
|
|
- }, 1000)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
// 删除
|
|
// 删除
|
|
handleDel (row) {
|
|
handleDel (row) {
|
|
const _this = this
|
|
const _this = this
|
|
@@ -150,7 +131,7 @@ export default {
|
|
content: '删除后不可恢复,确定要进行删除吗?',
|
|
content: '删除后不可恢复,确定要进行删除吗?',
|
|
centered: true,
|
|
centered: true,
|
|
onOk () {
|
|
onOk () {
|
|
- sparePartsPurDetailDel({ id: row.id }).then(res => {
|
|
|
|
|
|
+ sparePartsDeleteDetail({ sn: row.sparePartsDetailSn }).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
_this.$message.success(res.message)
|
|
_this.$message.success(res.message)
|
|
_this.$refs.table.refresh()
|
|
_this.$refs.table.refresh()
|
|
@@ -159,12 +140,6 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 编辑基本信息
|
|
|
|
- handleEditInfo () {
|
|
|
|
- this.openModal = true
|
|
|
|
- },
|
|
|
|
- // 基本信息 保存
|
|
|
|
- handleOk () {},
|
|
|
|
// 返回列表
|
|
// 返回列表
|
|
handleBack () {
|
|
handleBack () {
|
|
this.$router.push({ path: '/purchasingManagement/bulkWarehousingOrder/list' })
|
|
this.$router.push({ path: '/purchasingManagement/bulkWarehousingOrder/list' })
|
|
@@ -178,32 +153,6 @@ export default {
|
|
this.productTotal = null
|
|
this.productTotal = null
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- },
|
|
|
|
- // 产品列表数据
|
|
|
|
- getProductList (pageNo, sorter) {
|
|
|
|
- this.pageNo = pageNo || this.pageNo
|
|
|
|
- const params = {
|
|
|
|
- pageNo: this.pageNo,
|
|
|
|
- pageSize: this.pageSize,
|
|
|
|
- sn: this.$route.params.sn
|
|
|
|
- }
|
|
|
|
- sparePartsDetailList(params).then(res => {
|
|
|
|
- if (res.status == 200) {
|
|
|
|
- this.getDetailCount(params)
|
|
|
|
- const data = res.data
|
|
|
|
- this.paginationProps.total = Number(res.data.count) || 0
|
|
|
|
- this.paginationProps.current = this.pageNo
|
|
|
|
- const no = (data.pageNo - 1) * data.pageSize
|
|
|
|
- for (var i = 0; i < data.list.length; i++) {
|
|
|
|
- data.list[i].no = no + i + 1
|
|
|
|
- }
|
|
|
|
- this.loadData = data.list
|
|
|
|
- } else {
|
|
|
|
- this.paginationProps.total = 0
|
|
|
|
- this.paginationProps.current = 1
|
|
|
|
- this.loadData = []
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
@@ -218,24 +167,6 @@ export default {
|
|
.bulkWarehousingOrderEdit-wrap{
|
|
.bulkWarehousingOrderEdit-wrap{
|
|
.bulkWarehousingOrderEdit-cont{
|
|
.bulkWarehousingOrderEdit-cont{
|
|
margin-bottom: 10px;
|
|
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>
|
|
</style>
|