|
@@ -1,57 +1,66 @@
|
|
|
<template>
|
|
|
<a-modal
|
|
|
:title="modalTitle"
|
|
|
- :width="600"
|
|
|
+ :width="1000"
|
|
|
:visible="visible"
|
|
|
:confirmLoading="confirmLoading"
|
|
|
class="ant-modal2"
|
|
|
@cancel="handleCancel"
|
|
|
>
|
|
|
<a-form :form="form">
|
|
|
- <row-list :col="1">
|
|
|
- <row-item>
|
|
|
- <a-form-item
|
|
|
- label="备件"
|
|
|
- :labelCol="BaseTool.Constant.labelCol2"
|
|
|
- :wrapperCol="BaseTool.Constant.wrapperCol2"
|
|
|
- >
|
|
|
- <a-input
|
|
|
- style="width: 70%"
|
|
|
- disabled
|
|
|
- v-model="spareName" />
|
|
|
- <a-button style="width: 30%" type="primary" @click="handleSpareLongYanSelect">选择备件</a-button>
|
|
|
- </a-form-item>
|
|
|
- </row-item>
|
|
|
|
|
|
- <row-item>
|
|
|
- <a-form-item
|
|
|
- label="备件寿命"
|
|
|
- :labelCol="BaseTool.Constant.labelCol2"
|
|
|
- :wrapperCol="BaseTool.Constant.wrapperCol2"
|
|
|
- >
|
|
|
- <a-input
|
|
|
- style="width: 100%"
|
|
|
- suffix="天"
|
|
|
- v-decorator="['sparePeriod']" />
|
|
|
- </a-form-item>
|
|
|
- </row-item>
|
|
|
- <row-item>
|
|
|
- <a-form-item
|
|
|
- label="更换备注"
|
|
|
- :labelCol="BaseTool.Constant.labelCol2"
|
|
|
- :wrapperCol="BaseTool.Constant.wrapperCol2"
|
|
|
- >
|
|
|
- <a-textarea
|
|
|
- :rows="4"
|
|
|
- v-decorator="['remark']"/>
|
|
|
- </a-form-item>
|
|
|
- </row-item>
|
|
|
- </row-list>
|
|
|
+ <a-form-item
|
|
|
+ label="备件"
|
|
|
+ :labelCol="BaseTool.Constant.labelCol2"
|
|
|
+ :wrapperCol="BaseTool.Constant.wrapperCol2"
|
|
|
+ >
|
|
|
+ <a-input
|
|
|
+ style="width: 300px"
|
|
|
+ disabled
|
|
|
+ v-model="spareName" />
|
|
|
+ <a-button style="width: 100px" type="primary" @click="handleSpareLongYanSelect">选择备件</a-button>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
</a-form>
|
|
|
+ <a-table
|
|
|
+ :columns="columns"
|
|
|
+ :data-source="spareRows"
|
|
|
+ bordered
|
|
|
+ :defaultExpandAllRows="true"
|
|
|
+ >
|
|
|
+ <template v-slot:index="text,record,index">
|
|
|
+ {{ index+1 }}
|
|
|
+ </template>
|
|
|
+ <template v-slot:startDate="text,record">
|
|
|
+ <div>
|
|
|
+ <a-date-picker
|
|
|
+ style="width: 150px"
|
|
|
+ :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
|
|
|
+ v-model="record.startDate" />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-slot:num="text,record">
|
|
|
+ <div>
|
|
|
+ <a-input
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="record.num"/>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-slot:remark="text,record">
|
|
|
+ <div>
|
|
|
+ <a-input
|
|
|
+ type="textarea"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="record.remark"/>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
<template slot="footer">
|
|
|
<a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
|
|
|
</template>
|
|
|
- <spare-long-yan-select-modal ref='spareLongYanSelectModal' @selected="handleSpareLongYanSelected"/>
|
|
|
+ <spare-long-yan-select-modal ref="spareLongYanSelectModal" @selected="handleSpareLongYanSelected"/>
|
|
|
</a-modal>
|
|
|
</template>
|
|
|
|
|
@@ -70,7 +79,49 @@ export default {
|
|
|
spareRows: [],
|
|
|
// 下拉框map
|
|
|
isSpecial: 0,
|
|
|
- spareName: null
|
|
|
+ spareName: null,
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ title: '序号',
|
|
|
+ key: 'index',
|
|
|
+ align: 'center',
|
|
|
+ width: 50,
|
|
|
+ scopedSlots: { customRender: 'index' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '备件名称',
|
|
|
+ width: 100,
|
|
|
+ dataIndex: 'spareName'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '备件编码',
|
|
|
+ dataIndex: 'no',
|
|
|
+ width: 120
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '规格型号',
|
|
|
+ dataIndex: 'ggxh',
|
|
|
+ width: 150
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '更换日期',
|
|
|
+ dataIndex: 'startDate',
|
|
|
+ width: 150,
|
|
|
+ scopedSlots: { customRender: 'startDate' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '更换数量',
|
|
|
+ dataIndex: 'num',
|
|
|
+ width: 150,
|
|
|
+ scopedSlots: { customRender: 'num' }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '备注',
|
|
|
+ dataIndex: 'remark',
|
|
|
+ width: 150,
|
|
|
+ scopedSlots: { customRender: 'remark' }
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
@@ -84,6 +135,7 @@ export default {
|
|
|
methods: {
|
|
|
base (queryParam, model) {
|
|
|
this.visible = true
|
|
|
+ this.spareName = null
|
|
|
this.spareRows = []
|
|
|
this.isSpecial = queryParam.isSpecial
|
|
|
this.model = model
|
|
@@ -98,7 +150,7 @@ export default {
|
|
|
}
|
|
|
const data = []
|
|
|
for (let i = 0; i < this.spareRows.length; i++) {
|
|
|
- data.push({ remark: values.remark, sparePeriod: values.sparePeriod, isSpecial: this.isSpecial, sbId: this.model.sbId, spareId: this.spareRows[i].id, repairId: this.model.id, num: 1, spareName: this.spareRows[i].name, ggxh: this.spareRows[i].ggxh })
|
|
|
+ data.push({ remark: this.spareRows[i].remark, isSpecial: this.isSpecial, sbId: this.model.sbId, no: this.spareRows[i].no, repairId: this.model.id, spareName: this.spareRows[i].spareName, ggxh: this.spareRows[i].ggxh, num: this.spareRows[i].num, startDate: this.BaseTool.Date.formatter(this.spareRows[i].startDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) })
|
|
|
}
|
|
|
addLongYanSparePartUsedBatch(data)
|
|
|
.then((response) => {
|
|
@@ -119,10 +171,13 @@ export default {
|
|
|
this.$refs.spareLongYanSelectModal.base({ isSpecial: this.isSpecial }, { isSpecial: this.isSpecial, sbId: this.model.sbId })
|
|
|
},
|
|
|
handleSpareLongYanSelected (record, keys, rows) {
|
|
|
- this.spareRows = rows
|
|
|
- for (let i = 0; i < rows.length; i++) {
|
|
|
- this.spareName = this.spareName + ',' + rows[i].name
|
|
|
- }
|
|
|
+ this.spareRows = rows.map(item => {
|
|
|
+ item.num = 1
|
|
|
+ item.remark = ''
|
|
|
+ return item
|
|
|
+ })
|
|
|
+
|
|
|
+ this.spareName = rows.length
|
|
|
}
|
|
|
}
|
|
|
}
|