维修管理接口

This commit is contained in:
2022-06-30 15:25:40 +08:00
parent ee5b1d0ac0
commit a59f5168fb
10 changed files with 460 additions and 96 deletions

View File

@@ -21,11 +21,11 @@
<tr>
<th>是否完成</th>
</tr>
<tr v-for="e in dataList" :key="e.worktask_id">
<tr v-for="e in dataList" :key="e.maint_dtl_id">
<td>
<for-dropdown-menu
:value="e.is"
:id="e.worktask_id"
:value="e.isfinish"
:id="e.maint_dtl_id"
@getValue="getValue">
</for-dropdown-menu>
</td>
@@ -40,19 +40,19 @@
<th>保养内容</th>
<th>要求</th>
</tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}">
<td>{{e.workorder_code}}</td>
<td>{{e.material_code}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.status_name}}</td>
<tr v-for="e in dataList" :key="e.maint_dtl_id" @click="toCheck(e)" :class="{'checked': e.maint_dtl_id === pkId}">
<td>{{e.maint_item_name}}</td>
<td>{{e.item_level}}</td>
<td>{{e.contents}}</td>
<td>{{e.requirement}}</td>
</tr>
</table>
</div>
</div>
</section>
<section class="submit-bar">
<button class="btn submit-button">确认</button>
<button class="btn submit-button">取消</button>
<button class="btn submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled1" @click="toSure">确认</button>
<button class="btn submit-button" @click="toCancle">取消</button>
</section>
</section>
</template>
@@ -61,6 +61,7 @@
import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue'
import ForDropdownMenu from '@components/ForDropdownMenu.vue'
import {queryMaintenanceDtl, dtlConfirm} from '@config/getData2.js'
export default {
name: 'MaintainResults',
components: {
@@ -70,13 +71,17 @@ export default {
},
data () {
return {
val1: '',
val2: '',
dataList: [{worktask_id: '1', is: '2', pcsn: '00000'}],
val1: JSON.stringify(this.$store.getters.materObj) !== '{}' ? this.$store.getters.materObj.device_code : '',
val2: JSON.stringify(this.$store.getters.materObj) !== '{}' ? this.$store.getters.materObj.maint_code : '',
dataList: [],
pkId: '',
pkObj: {}
pkObj: {},
disabled1: false
}
},
mounted () {
this._queryMaintenanceDtl()
},
methods: {
handleChange1 (e, type) {
if (type) {
@@ -84,15 +89,49 @@ export default {
}
},
toCheck (e) {
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id
this.pkObj = this.pkId === e.worktask_id ? e : {}
this.pkId = this.pkId === e.maint_dtl_id ? '' : e.maint_dtl_id
this.pkObj = this.pkId === e.maint_dtl_id ? e : {}
},
getValue (p) {
this.dataList.map(el => {
if (el.worktask_id === p[0]) {
el.is = p[1]
if (el.maint_dtl_id === p[0]) {
el.isfinish = p[1]
}
})
},
/** 明细查询 */
async _queryMaintenanceDtl () {
let res = await queryMaintenanceDtl(this.$store.getters.materObj)
if (res.code === '1') {
this.dataList = [...res.content.rows]
} else {
this.Dialog(res.desc)
}
},
async _dtlConfirm () {
try {
let res = await dtlConfirm(this.dataList)
if (res.code === '1') {
this.toast(res.desc)
} else {
this.Dialog(res.desc)
}
this.disabled1 = false
this.disabled2 = false
} catch (e) {
this.disabled1 = false
this.disabled2 = false
}
},
toSure () {
this.disabled1 = true
if (!this.dataList.length) {
this.disabled1 = false
return
}
this._dtlConfirm()
},
toCancle () {
}
}
}