|
@@ -112,12 +112,17 @@
|
|
<div class="table-operator" v-if="$auth('repair-application-forms-finish')">
|
|
<div class="table-operator" v-if="$auth('repair-application-forms-finish')">
|
|
<a-button type="primary" @click="handleSpareStoreSelect(1)">
|
|
<a-button type="primary" @click="handleSpareStoreSelect(1)">
|
|
<a-icon type="plus"/>
|
|
<a-icon type="plus"/>
|
|
- 专用备件
|
|
|
|
|
|
+ 更换专用备件
|
|
</a-button>
|
|
</a-button>
|
|
<a-divider type="vertical" />
|
|
<a-divider type="vertical" />
|
|
<a-button type="primary" @click="handleSpareStoreSelect(0)">
|
|
<a-button type="primary" @click="handleSpareStoreSelect(0)">
|
|
<a-icon type="plus"/>
|
|
<a-icon type="plus"/>
|
|
- 常用备件
|
|
|
|
|
|
+ 更换常用备件
|
|
|
|
+ </a-button>
|
|
|
|
+ <a-divider type="vertical" />
|
|
|
|
+ <a-button type="primary" @click="handleAddSpare()">
|
|
|
|
+ <a-icon type="plus"/>
|
|
|
|
+ 添加专用备件
|
|
</a-button>
|
|
</a-button>
|
|
</div>
|
|
</div>
|
|
<a-table
|
|
<a-table
|
|
@@ -128,14 +133,14 @@
|
|
rowKey="id">
|
|
rowKey="id">
|
|
<span slot="actionSpare" slot-scope="record">
|
|
<span slot="actionSpare" slot-scope="record">
|
|
<template>
|
|
<template>
|
|
-<!-- <a v-if="$auth('repair-application-forms-finish')" @click="handleEditSpare(record)">修改</a>-->
|
|
|
|
- <a-popconfirm v-if="$auth('repair-application-forms-finish')" title="是否替换该备件?" @confirm="updateSpare(record)">
|
|
|
|
|
|
+ <a v-if="$auth('repair-application-forms-finish') && record.isSpecial === 0" @click="handleEditSpare(record)">修改</a>
|
|
|
|
+<!-- <a-popconfirm v-if="$auth('repair-application-forms-finish')" title="是否替换该备件?" @confirm="updateSpare(record)">
|
|
<a>更换备件</a>
|
|
<a>更换备件</a>
|
|
- </a-popconfirm>
|
|
|
|
-<!-- <a-divider type="vertical" />
|
|
|
|
|
|
+ </a-popconfirm>-->
|
|
|
|
+ <a-divider type="vertical" />
|
|
<a-popconfirm v-if="$auth('repair-application-forms-finish')" title="是否要删除该条数据?" @confirm="batchDeleteSpare(record.id)">
|
|
<a-popconfirm v-if="$auth('repair-application-forms-finish')" title="是否要删除该条数据?" @confirm="batchDeleteSpare(record.id)">
|
|
<a>删除</a>
|
|
<a>删除</a>
|
|
- </a-popconfirm>-->
|
|
|
|
|
|
+ </a-popconfirm>
|
|
</template>
|
|
</template>
|
|
</span>
|
|
</span>
|
|
</a-table>
|
|
</a-table>
|
|
@@ -246,7 +251,7 @@ import RepairProjectSelectModal from '@/views/repair/repairproject/modules/Repai
|
|
import { queryRepairProject, fetchRepairProject, deleteRepairProjects } from '@/api/repair/repairproject'
|
|
import { queryRepairProject, fetchRepairProject, deleteRepairProjects } from '@/api/repair/repairproject'
|
|
import SparePartInfoSelectModal from '@/views/sqarepartmanage/sparepartinfo/modules/SparePartInfoSelectModal'
|
|
import SparePartInfoSelectModal from '@/views/sqarepartmanage/sparepartinfo/modules/SparePartInfoSelectModal'
|
|
import BaseFormForRepair from '@/views/sqarepartmanage/sparepartused/modules/BaseFormForRepair'
|
|
import BaseFormForRepair from '@/views/sqarepartmanage/sparepartused/modules/BaseFormForRepair'
|
|
-import { selectSparePartUsedListBySbId, addSparePartUsedBatch, deleteSparePartUseds, updateSpare } from '@/api/sqarepartmanage/sparepartused'
|
|
|
|
|
|
+import { selectSparePartUsedListBySbId, addSparePartUsedBatch, deleteSparePartUseds, updateSpare, selectSparePartUsedListByRepairId } from '@/api/sqarepartmanage/sparepartused'
|
|
import SpareStoreSelectModal from '@/views/store/sparestore/modules/SpareStoreSelectModal'
|
|
import SpareStoreSelectModal from '@/views/store/sparestore/modules/SpareStoreSelectModal'
|
|
import BaseTool from '@/utils/tool'
|
|
import BaseTool from '@/utils/tool'
|
|
import FeeBaseForm from '@/views/repair/fee/modules/BaseForm'
|
|
import FeeBaseForm from '@/views/repair/fee/modules/BaseForm'
|
|
@@ -532,12 +537,12 @@ export default {
|
|
queryRepairProject({ repairId: this.model.id }).then(res => {
|
|
queryRepairProject({ repairId: this.model.id }).then(res => {
|
|
this.data = res.data
|
|
this.data = res.data
|
|
})
|
|
})
|
|
- /*selectSparePartUsedListByRepairId({ id: this.model.id }).then(res => {
|
|
|
|
- this.dataSpare = res.data
|
|
|
|
- })*/
|
|
|
|
- selectSparePartUsedListBySbId({ id: this.model.sbId }).then(res => {
|
|
|
|
|
|
+ selectSparePartUsedListByRepairId({ id: this.model.id }).then(res => {
|
|
this.dataSpare = res.data
|
|
this.dataSpare = res.data
|
|
})
|
|
})
|
|
|
|
+ /*selectSparePartUsedListBySbId({ id: this.model.sbId }).then(res => {
|
|
|
|
+ this.dataSpare = res.data
|
|
|
|
+ })*/
|
|
queryRepairFee({ repairId: this.model.id }).then(res => {
|
|
queryRepairFee({ repairId: this.model.id }).then(res => {
|
|
this.dataFee = res.data
|
|
this.dataFee = res.data
|
|
})
|
|
})
|
|
@@ -560,6 +565,11 @@ export default {
|
|
this.confirmLoading = false
|
|
this.confirmLoading = false
|
|
this.$emit('ok')
|
|
this.$emit('ok')
|
|
},
|
|
},
|
|
|
|
+ handleAddSpare () {
|
|
|
|
+ const id = this.model.sbId
|
|
|
|
+ const routeUrl = this.$router.resolve({ path: '/spare/used/record', query: { id: id } })
|
|
|
|
+ window.open(routeUrl.href, '_blank')
|
|
|
|
+ },
|
|
receive () {
|
|
receive () {
|
|
this.model.status = this.DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING
|
|
this.model.status = this.DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING
|
|
receive(this.model).then(() => {
|
|
receive(this.model).then(() => {
|
|
@@ -782,23 +792,30 @@ export default {
|
|
},
|
|
},
|
|
handleSpareStoreSelect (isSpecial) {
|
|
handleSpareStoreSelect (isSpecial) {
|
|
//this.$refs.spareStoreSelectModal.base({}, { storeId: this.storeId, isSpecial: isSpecial, sbId: this.model.sbId })
|
|
//this.$refs.spareStoreSelectModal.base({}, { storeId: this.storeId, isSpecial: isSpecial, sbId: this.model.sbId })
|
|
- this.$refs.spareStoreSelectModal.base({}, { storeId: this.storeId, isSpecial: isSpecial })
|
|
|
|
|
|
+ this.$refs.spareStoreSelectModal.base({}, { repairFlag: 1, storeId: this.storeId, isSpecial: isSpecial, sbId: this.model.sbId })
|
|
},
|
|
},
|
|
handleSpareStoreSelected (record, keys, rows) {
|
|
handleSpareStoreSelected (record, keys, rows) {
|
|
const data = []
|
|
const data = []
|
|
for (let i = 0; i < rows.length; i++) {
|
|
for (let i = 0; i < rows.length; i++) {
|
|
data.push({ isSpecial: record.isSpecial, sbId: this.model.sbId, spareId: rows[i].spareId, repairId: this.model.id, num: 1, price: rows[i].price, totalPrice: rows[i].price, startDate: BaseTool.Date.formatter(new Date(), BaseTool.Date.PICKER_NORM_DATE_PATTERN) })
|
|
data.push({ isSpecial: record.isSpecial, sbId: this.model.sbId, spareId: rows[i].spareId, repairId: this.model.id, num: 1, price: rows[i].price, totalPrice: rows[i].price, startDate: BaseTool.Date.formatter(new Date(), BaseTool.Date.PICKER_NORM_DATE_PATTERN) })
|
|
}
|
|
}
|
|
- addSparePartUsedBatch(data)
|
|
|
|
- .then((response) => {
|
|
|
|
- this.$message.info('成功添加个数:' + response.data[0] + ',添加失败个数:' + response.data[1])
|
|
|
|
- if (response.data[1] > 0) {
|
|
|
|
- this.$message.error('失败原因:该备件已存在更换列表,请点击更换备件')
|
|
|
|
- }
|
|
|
|
- this.handleOk()
|
|
|
|
- }).catch(() => {
|
|
|
|
- this.confirmLoading = false
|
|
|
|
- })
|
|
|
|
|
|
+ if (record.isSpecial === 1) {
|
|
|
|
+ updateSpare(data)
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.$message.info('更换成功')
|
|
|
|
+ this.handleOk()
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ this.confirmLoading = false
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ addSparePartUsedBatch(data)
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.$message.info('更换成功')
|
|
|
|
+ this.handleOk()
|
|
|
|
+ }).catch(() => {
|
|
|
|
+ this.confirmLoading = false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
},
|
|
},
|
|
onSelectChange (selectedRowKeys) {
|
|
onSelectChange (selectedRowKeys) {
|
|
console.log('selectedRowKeys changed: ', selectedRowKeys)
|
|
console.log('selectedRowKeys changed: ', selectedRowKeys)
|