|
@@ -8,7 +8,7 @@
|
|
|
</a-popconfirm>
|
|
|
<a-button v-if="$auth('repair-application-forms-dispatch') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" style="margin-left: 8px" type="primary" @click="handleDispatch">转派</a-button>
|
|
|
<a-button v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="primary" @click="handleFinish()">维修完成</a-button>
|
|
|
- <!--<a-button v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="primary" @click="handleSparePick">领用备件</a-button>-->
|
|
|
+ <!-- <a-button v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="primary" @click="handleSparePick">领用备件</a-button>-->
|
|
|
<a-button style="margin-left: 8px" @click="handleCancel">返回</a-button>
|
|
|
</span>
|
|
|
</a-col>
|
|
@@ -79,7 +79,7 @@
|
|
|
</a-layout-sider>
|
|
|
</a-layout>
|
|
|
<title-divider title="维修项目" width="90px"></title-divider>
|
|
|
- <div class="table-operator" v-if="$auth('repair-application-forms-finish')">
|
|
|
+ <div class="table-operator" v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status">
|
|
|
<a-button type="primary" @click="handleRepairProjectSelect">
|
|
|
<a-icon type="plus"/>
|
|
|
添加
|
|
@@ -98,9 +98,9 @@
|
|
|
</template>
|
|
|
</span>
|
|
|
</a-table>
|
|
|
- <title-divider title="配件清单" width="90px"></title-divider>
|
|
|
- <div class="table-operator" v-if="$auth('repair-application-forms-finish')">
|
|
|
- <a-button type="primary" @click="handleSpareSelect">
|
|
|
+ <title-divider title="备件清单" width="90px"></title-divider>
|
|
|
+ <div class="table-operator" v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status">
|
|
|
+ <a-button type="primary" @click="handleSpareStoreSelect">
|
|
|
<a-icon type="plus"/>
|
|
|
添加
|
|
|
</a-button>
|
|
@@ -108,6 +108,7 @@
|
|
|
<a-table
|
|
|
:data-source="dataSpare"
|
|
|
:columns="columnsSpare"
|
|
|
+ :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
|
|
tableLayout="auto"
|
|
|
rowKey="id">
|
|
|
<span slot="actionSpare" slot-scope="record">
|
|
@@ -120,10 +121,10 @@
|
|
|
</template>
|
|
|
</span>
|
|
|
</a-table>
|
|
|
- <!--<q-tabs :activeKey="activeKey" @change="changeTab">
|
|
|
+ <!-- <q-tabs :activeKey="activeKey" @change="changeTab">
|
|
|
<q-tab-pane key="a" tab="配件更换">
|
|
|
- <spare-part-used-select-table :type="2" :table-params="{sbId: model.sbId, modelId: model.modelId, repairId: model.id}" ref="sparePartUsedSelectTable"/>
|
|
|
- </q-tab-pane>
|
|
|
+ <spare-part-used-select-table :type="2" :table-params="{sbId: model.sbId, modelId: model.modelId, repairId: model.id}" ref="sparePartUsedSelectTable"/>
|
|
|
+ </q-tab-pane>
|
|
|
<q-tab-pane key="b" tab="备件领用">
|
|
|
<spare-pick-form-select-table :type="2" :table-params="{repairId: model.id, repairNo: model.no}" ref="sparePickFormSelectTable"/>
|
|
|
</q-tab-pane>
|
|
@@ -133,8 +134,9 @@
|
|
|
<dispatch-form ref="dispatchForm" @ok="handleCancel" />
|
|
|
<spare-pick-base-form ref="baseModal" @ok="handleOk"/>
|
|
|
<repair-project-select-Modal :type="'checkbox'" ref="repairProjectSelectModal" @selected="handleRepairProjectSelected"/>
|
|
|
- <spare-part-info-select-modal :type="'checkbox'" ref="spareSelectModal" @selected="handleSpareSelected"/>
|
|
|
+ <!-- <spare-part-info-select-modal :type="'checkbox'" ref="spareSelectModal" @selected="handleSpareSelected"/>-->
|
|
|
<base-form-for-repair ref="baseFormForRepair" @ok="handleOk" />
|
|
|
+ <spare-store-select-modal ref="spareStoreSelectModal" @selected="handleSpareStoreSelected"/>
|
|
|
</a-card>
|
|
|
</template>
|
|
|
|
|
@@ -152,6 +154,8 @@ import { selectRepairProjectListByRepairId, addRepairProjectRelationBatch, delet
|
|
|
import SparePartInfoSelectModal from '@/views/sqarepartmanage/sparepartinfo/modules/SparePartInfoSelectModal'
|
|
|
import BaseFormForRepair from '@/views/sqarepartmanage/sparepartused/modules/BaseFormForRepair'
|
|
|
import { selectSparePartUsedListByRepairId, addSparePartUsedBatch, deleteSparePartUseds } from '@/api/sqarepartmanage/sparepartused'
|
|
|
+import SpareStoreSelectModal from '@/views/store/sparestore/modules/SpareStoreSelectModal'
|
|
|
+import BaseTool from '@/utils/tool'
|
|
|
|
|
|
const DetailListItem = DetailList.Item
|
|
|
|
|
@@ -168,7 +172,8 @@ export default {
|
|
|
SparePickFormSelectTable,
|
|
|
RepairProjectSelectModal,
|
|
|
SparePartInfoSelectModal,
|
|
|
- BaseFormForRepair
|
|
|
+ BaseFormForRepair,
|
|
|
+ SpareStoreSelectModal
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
@@ -182,6 +187,7 @@ export default {
|
|
|
sourceMap: {},
|
|
|
levelMap: {},
|
|
|
descripitionMap: {},
|
|
|
+ selectedRowKeys: [],
|
|
|
statusMap: {},
|
|
|
repairProjectMap: {},
|
|
|
repairTechnologyMap: {},
|
|
@@ -266,6 +272,10 @@ export default {
|
|
|
title: '总价',
|
|
|
dataIndex: 'totalPrice'
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '更换日期',
|
|
|
+ dataIndex: 'startDate'
|
|
|
+ },
|
|
|
{
|
|
|
title: '操作',
|
|
|
key: 'action',
|
|
@@ -310,7 +320,6 @@ export default {
|
|
|
this.repairProjectMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_PROJECT_TYPE)
|
|
|
this.repairTechnologyMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_TECHNOLOGY_TYPE)
|
|
|
this.descripitionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIRE_ACTION)
|
|
|
-
|
|
|
},
|
|
|
methods: {
|
|
|
base (record) {
|
|
@@ -451,6 +460,26 @@ export default {
|
|
|
handleEditSpare (record) {
|
|
|
const modal = this.$refs.baseFormForRepair
|
|
|
modal.base(record)
|
|
|
+ },
|
|
|
+ handleSpareStoreSelect () {
|
|
|
+ this.$refs.spareStoreSelectModal.base({}, { storeId: this.storeId })
|
|
|
+ },
|
|
|
+ handleSpareStoreSelected (record, keys, rows) {
|
|
|
+ const data = []
|
|
|
+ for (let i = 0; i < rows.length; i++) {
|
|
|
+ data.push({ 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('添加成功')
|
|
|
+ this.handleOk()
|
|
|
+ }).catch(() => {
|
|
|
+ this.confirmLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onSelectChange (selectedRowKeys) {
|
|
|
+ console.log('selectedRowKeys changed: ', selectedRowKeys)
|
|
|
+ this.selectedRowKeys = selectedRowKeys
|
|
|
}
|
|
|
}
|
|
|
}
|