维修管理接口

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

@@ -26,7 +26,7 @@ export default {
}, },
data () { data () {
return { return {
option: [{value: '1', label: ''}, {value: '2', label: ''}], option: [{value: '0', label: ''}, {value: '1', label: ''}],
active: '', active: '',
open: false, open: false,
up: false up: false

View File

@@ -471,3 +471,37 @@ export const queryMaintenanceDtl = (row) => post('api/pda/sb/queryMaintenanceDtl
row: row row: row
}) })
// 1.4确认 // 1.4确认
export const dtlConfirm = (row) => post('api/pda/sb/dtlConfirm', {
rows: row
})
// 1.5故障类型
export const errorType = (row) => post('api/pda/sb/errorType', {})
// 1.6故障等级
export const errorLevel = (row) => post('api/pda/sb/errorLevel', {})
// 1.7报修
export const repairs = (code, id, desc, level) => post('api/pda/sb/repairs', {
device_code: code,
device_faultclass_id: id,
fault_desc: desc,
fault_level: level
})
// 1.8查询设备维修执行
export const queryRepairs = (code, mflag) => post('api/pda/sb/queryRepairs', {
device_code: code,
maintenance_flag: mflag
})
// 1.9设备保养单操作
export const repairOpeate = (row, operate) => post('api/pda/sb/repairOpeate', {
row: row,
operate: operate
})
// 1.10维修明细查询
export const queryRepairDtl = (row) => post('api/pda/sb/queryRepairDtl', {
row: row
})
// 1.11确认
export const repaireDtlConfirm = (form, row, pname) => post('api/pda/sb/repaireDtlConfirm', {
form: form,
rows: row,
product_person_name: pname
})

View File

@@ -21,6 +21,11 @@
<img src="../../images/xinrui/menu/password.png" alt=""> <img src="../../images/xinrui/menu/password.png" alt="">
<p class="fxcol">修改密码</p> <p class="fxcol">修改密码</p>
</div> </div>
<!-- <div class="menu-col fxrow" @click="goInner('/MaintainExecution')"><p class="fxcol">设备保养执行-维修工</p></div>
<div class="menu-col fxrow" @click="goInner('/MaintainConfirm')"><p class="fxcol">设备保养确认-生产员</p></div>
<div class="menu-col fxrow" @click="goInner('/EquipRepair')"><p class="fxcol">设备报修</p></div>
<div class="menu-col fxrow" @click="goInner('/EquipRepairExecute')"><p class="fxcol">设备维修执行</p></div>
<div class="menu-col fxrow" @click="goInner('/MaintainResultFill')"><p class="fxcol">设备维修确认</p></div> -->
<!-- <div class="menu-col fxrow" @click="goInner('/ProcessMakePowder')"><p class="fxcol">配粉工序</p></div> <!-- <div class="menu-col fxrow" @click="goInner('/ProcessMakePowder')"><p class="fxcol">配粉工序</p></div>
<div class="menu-col fxrow" @click="goInner('/ProcessGrindBall')"><p class="fxcol">球磨工序</p></div> <div class="menu-col fxrow" @click="goInner('/ProcessGrindBall')"><p class="fxcol">球磨工序</p></div>
<div class="menu-col fxrow" @click="goInner('/ProcessSpray')"><p class="fxcol">喷雾工序</p></div> <div class="menu-col fxrow" @click="goInner('/ProcessSpray')"><p class="fxcol">喷雾工序</p></div>

View File

@@ -69,8 +69,8 @@
</div> </div>
</section> </section>
<section class="submit-bar"> <section class="submit-bar">
<button class="btn submit-button">拍照</button> <button class="btn submit-button" @click="UploadPict">拍照</button>
<button class="btn submit-button">报修</button> <button class="btn submit-button" :class="{'btn-disabled': val1 === '' || active1 === '' || active2 === '' || val2 === ''}" :disabled="disabled1" @click="_repairs">报修</button>
</section> </section>
</section> </section>
</template> </template>
@@ -79,6 +79,7 @@
import NavBar from '@components/NavBar.vue' import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue' import SearchBox from '@components/SearchBox.vue'
import DropdownMenu from '@components/DropdownMenu.vue' import DropdownMenu from '@components/DropdownMenu.vue'
import {errorType, errorLevel, repairs} from '@config/getData2.js'
export default { export default {
name: 'EquipRepair', name: 'EquipRepair',
components: { components: {
@@ -99,7 +100,8 @@ export default {
open1: false, open1: false,
option2: [], option2: [],
active2: '', active2: '',
open2: false open2: false,
disabled1: false
} }
}, },
methods: { methods: {
@@ -108,6 +110,51 @@ export default {
console.log(e) console.log(e)
} }
}, },
/** 故障类型 */
async _errorType () {
let res = await errorType()
if (res.code === '1') {
this.option1 = [...res.rows]
} else {
this.Dialog(res.desc)
}
},
/** 故障登记 */
async _errorLevel () {
let res = await errorLevel()
if (res.code === '1') {
this.option2 = [...res.rows]
} else {
this.Dialog(res.desc)
}
},
/** 报修 */
async _repairs () {
this.disabled1 = true
if (this.val1 === '' || this.active1 === '' || this.active2 === '' || this.val2 === '') {
this.disabled1 = false
return
}
try {
let type = this.active1 !== '' ? this.option1[this.active1].value : ''
let level = this.active2 !== '' ? this.option2[this.active2].value : ''
let res = await repairs(this.val1, type, this.val2, level)
if (res.code === '1') {
this.option2 = [...res.rows]
} else {
this.Dialog(res.desc)
}
this.disabled1 = false
} catch (e) {
this.disabled1 = false
}
},
UploadPict () {
this.$router.push({
path: '/UploadPict',
query: {url: 'EquipRepair'}
})
},
toCheck (e) { toCheck (e) {
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id
this.pkObj = this.pkId === e.worktask_id ? e : {} this.pkObj = this.pkId === e.worktask_id ? e : {}
@@ -122,6 +169,7 @@ export default {
dropdownMenu1 (i) { dropdownMenu1 (i) {
this.active1 = i + '' this.active1 = i + ''
this.open1 = false this.open1 = false
this.val3 = this.option1[i].solutions
}, },
toggleItem2 () { toggleItem2 () {
if (!this.open2) { if (!this.open2) {

View File

@@ -15,8 +15,8 @@
<tr> <tr>
<th>维修单</th> <th>维修单</th>
</tr> </tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}"> <tr v-for="e in dataList" :key="e.repair_id" @click="toCheck(e)" :class="{'checked': e.repair_id === pkId}">
<td>{{e.device_code}}</td> <td>{{e.repair_code}}</td>
</tr> </tr>
</table> </table>
</div> </div>
@@ -28,21 +28,21 @@
<th>状态</th> <th>状态</th>
<th>计划维修日期</th> <th>计划维修日期</th>
</tr> </tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}"> <tr v-for="e in dataList" :key="e.repair_id" @click="toCheck(e)" :class="{'checked': e.repair_id === pkId}">
<td>{{e.workorder_code}}</td> <td>{{e.device_code}}</td>
<td>{{e.material_code}}</td> <td>{{e.device_name}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.status_name}}</td> <td>{{e.status_name}}</td>
<td>{{e.plan_start_date}}</td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
</section> </section>
<section class="submit-bar"> <section class="submit-bar">
<button class="btn submit-button">开始维修</button> <button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" :disabled="disabled1" @click="toSure1">开始维修</button>
<button class="btn submit-button">填报</button> <button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" @click="toJump">填报</button>
<button class="btn submit-button">委外维修</button> <button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" :disabled="disabled2" @click="toSure2">委外维修</button>
<button class="btn submit-button">结束维修</button> <button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" :disabled="disabled3" @click="toSure3">结束维修</button>
</section> </section>
</section> </section>
</template> </template>
@@ -50,6 +50,7 @@
<script> <script>
import NavBar from '@components/NavBar.vue' import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue' import SearchBox from '@components/SearchBox.vue'
import { queryRepairs, repairOpeate } from '@config/getData2.js'
export default { export default {
name: 'EquipRepairExecute', name: 'EquipRepairExecute',
components: { components: {
@@ -61,18 +62,79 @@ export default {
val1: '', val1: '',
dataList: [], dataList: [],
pkId: '', pkId: '',
pkObj: {} pkObj: {},
disabled1: false,
disabled2: false,
disabled3: false
} }
}, },
methods: { methods: {
handleChange1 (e, type) { handleChange1 (e, type) {
if (type) { if (type) {
console.log(e) this._queryRepairs(e)
}
},
/** 设备查询 */
async _queryRepairs (e) {
let res = await queryRepairs(e, '1')
if (res.code === '1') {
this.dataList = [...res.content.rows]
} else {
this.Dialog(res.desc)
}
},
async _repairOpeate (type) {
try {
let res = await repairOpeate(this.pkObj, type)
if (res.code === '1') {
this.toast(res.desc)
} else {
this.Dialog(res.desc)
}
this.disabled1 = false
this.disabled2 = false
this.disabled3 = false
} catch (e) {
this.disabled1 = false
this.disabled2 = false
this.disabled3 = false
}
},
toSure1 () {
this.disabled1 = true
if (!this.pkId) {
this.disabled1 = false
return
}
this._repairOpeate('1')
},
toSure2 () {
this.disabled2 = true
if (!this.pkId) {
this.disabled2 = false
return
}
this._repairOpeate('2')
},
toSure3 () {
this.disabled3 = true
if (!this.pkId) {
this.disabled3 = false
return
}
this._repairOpeate('3')
},
toJump () {
if (this.pkId) {
this.$store.dispatch('materObj', this.pkObj)
this.$router.push({
path: '/MaintainResultFill'
})
} }
}, },
toCheck (e) { toCheck (e) {
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id this.pkId = this.pkId === e.repair_id ? '' : e.repair_id
this.pkObj = this.pkId === e.worktask_id ? e : {} this.pkObj = this.pkId === e.repair_id ? e : {}
} }
} }
} }

View File

@@ -15,8 +15,8 @@
<tr> <tr>
<th>保养单</th> <th>保养单</th>
</tr> </tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}"> <tr v-for="e in dataList" :key="e.maint_id" @click="toCheck(e)" :class="{'checked': e.maint_id === pkId}">
<td>{{e.device_code}}</td> <td>{{e.maint_code}}</td>
</tr> </tr>
</table> </table>
</div> </div>
@@ -28,19 +28,19 @@
<th>状态</th> <th>状态</th>
<th>计划保养日期</th> <th>计划保养日期</th>
</tr> </tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}"> <tr v-for="e in dataList" :key="e.maint_id" @click="toCheck(e)" :class="{'checked': e.maint_id === pkId}">
<td>{{e.workorder_code}}</td> <td>{{e.device_code}}</td>
<td>{{e.material_code}}</td> <td>{{e.device_name}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.status_name}}</td> <td>{{e.status_name}}</td>
<td>{{e.plan_start_date}}</td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
</section> </section>
<section class="submit-bar"> <section class="submit-bar">
<button class="btn submit-button">通过</button> <button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" :disabled="disabled1" @click="toSure1">通过</button>
<button class="btn submit-button">不通过</button> <button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" :disabled="disabled2" @click="toSure2">不通过</button>
</section> </section>
</section> </section>
</template> </template>
@@ -48,6 +48,7 @@
<script> <script>
import NavBar from '@components/NavBar.vue' import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue' import SearchBox from '@components/SearchBox.vue'
import { queryMaintenance, maintOpeate } from '@config/getData2.js'
export default { export default {
name: 'MaintainConfirm', name: 'MaintainConfirm',
components: { components: {
@@ -59,18 +60,60 @@ export default {
val1: '', val1: '',
dataList: [], dataList: [],
pkId: '', pkId: '',
pkObj: {} pkObj: {},
disabled1: false,
disabled2: false
} }
}, },
methods: { methods: {
handleChange1 (e, type) { handleChange1 (e, type) {
if (type) { if (type) {
console.log(e) this._queryMaintenance(e)
} }
}, },
toCheck (e) { toCheck (e) {
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id this.pkId = this.pkId === e.maint_id ? '' : e.maint_id
this.pkObj = this.pkId === e.worktask_id ? e : {} this.pkObj = this.pkId === e.maint_id ? e : {}
},
/** 设备查询 */
async _queryMaintenance (e) {
let res = await queryMaintenance(e, '2')
if (res.code === '1') {
this.dataList = [...res.content.rows]
} else {
this.Dialog(res.desc)
}
},
async _maintOpeate (type) {
try {
let res = await maintOpeate(this.pkObj, type)
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
}
},
toSure1 () {
this.disabled1 = true
if (!this.pkId) {
this.disabled1 = false
return
}
this._maintOpeate('3')
},
toSure2 () {
this.disabled2 = true
if (!this.pkId) {
this.disabled2 = false
return
}
this._maintOpeate('4')
} }
} }
} }

View File

@@ -21,8 +21,8 @@
<tr> <tr>
<th>是否完成</th> <th>是否完成</th>
</tr> </tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}"> <tr v-for="e in dataList" :key="e.maint_dtl_id" @click="toCheck(e)" :class="{'checked': e.maint_dtl_id === pkId}">
<td></td> <td>{{maint_dtl_id === '0' ? '否' : '是'}}</td>
</tr> </tr>
</table> </table>
</div> </div>
@@ -34,19 +34,19 @@
<th>保养内容</th> <th>保养内容</th>
<th>要求</th> <th>要求</th>
</tr> </tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}"> <tr v-for="e in dataList" :key="e.maint_dtl_id" @click="toCheck(e)" :class="{'checked': e.maint_dtl_id === pkId}">
<td>{{e.workorder_code}}</td> <td>{{e.maint_item_name}}</td>
<td>{{e.material_code}}</td> <td>{{e.item_level}}</td>
<td>{{e.pcsn}}</td> <td>{{e.contents}}</td>
<td>{{e.status_name}}</td> <td>{{e.requirement}}</td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
</section> </section>
<section class="submit-bar"> <section class="submit-bar">
<button class="btn submit-button">确认</button> <button class="btn submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled1" @click="toSure1">>确认</button>
<button class="btn submit-button">取消</button> <button class="btn submit-button" :class="{'btn-disabled': dataList.length === 0}" :disabled="disabled2" @click="toSure2">取消</button>
</section> </section>
</section> </section>
</template> </template>
@@ -54,6 +54,7 @@
<script> <script>
import NavBar from '@components/NavBar.vue' import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue' import SearchBox from '@components/SearchBox.vue'
import {queryMaintenanceDtl, dtlConfirm} from '@config/getData2.js'
export default { export default {
name: 'MaintainDetails', name: 'MaintainDetails',
components: { components: {
@@ -62,11 +63,13 @@ export default {
}, },
data () { data () {
return { return {
val1: '', val1: JSON.stringify(this.$store.getters.materObj) !== '{}' ? this.$store.getters.materObj.device_code : '',
val2: '', val2: JSON.stringify(this.$store.getters.materObj) !== '{}' ? this.$store.getters.materObj.maint_code : '',
dataList: [], dataList: [],
pkId: '', pkId: '',
pkObj: {} pkObj: {},
disabled1: false,
disabled2: false
} }
}, },
methods: { methods: {
@@ -76,8 +79,48 @@ export default {
} }
}, },
toCheck (e) { toCheck (e) {
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id this.pkId = this.pkId === e.maint_dtl_id ? '' : e.maint_dtl_id
this.pkObj = this.pkId === e.worktask_id ? e : {} this.pkObj = this.pkId === e.maint_dtl_id ? e : {}
},
/** 明细查询 */
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
}
},
toSure1 () {
this.disabled1 = true
if (!this.dataList.length) {
this.disabled1 = false
return
}
this._dtlConfirm()
},
toSure2 () {
this.disabled2 = true
if (!this.dataList.length) {
this.disabled2 = false
return
}
this._dtlConfirm()
} }
} }
} }

View File

@@ -15,8 +15,8 @@
<tr> <tr>
<th>保养单</th> <th>保养单</th>
</tr> </tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}"> <tr v-for="e in dataList" :key="e.maint_id" @click="toCheck(e)" :class="{'checked': e.maint_id === pkId}">
<td>{{e.device_code}}</td> <td>{{e.maint_code}}</td>
</tr> </tr>
</table> </table>
</div> </div>
@@ -28,20 +28,20 @@
<th>状态</th> <th>状态</th>
<th>计划保养日期</th> <th>计划保养日期</th>
</tr> </tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}"> <tr v-for="e in dataList" :key="e.maint_id" @click="toCheck(e)" :class="{'checked': e.maint_id === pkId}">
<td>{{e.workorder_code}}</td> <td>{{e.device_code}}</td>
<td>{{e.material_code}}</td> <td>{{e.device_name}}</td>
<td>{{e.pcsn}}</td>
<td>{{e.status_name}}</td> <td>{{e.status_name}}</td>
<td>{{e.plan_start_date}}</td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
</section> </section>
<section class="submit-bar"> <section class="submit-bar">
<button class="btn submit-button">保养开始</button> <button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" :disabled="disabled1" @click="toSure1">保养开始</button>
<button class="btn submit-button">填报</button> <button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" @click="toJump">填报</button>
<button class="btn submit-button">结束保养</button> <button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" :disabled="disabled2" @click="toSure2">结束保养</button>
</section> </section>
</section> </section>
</template> </template>
@@ -49,6 +49,7 @@
<script> <script>
import NavBar from '@components/NavBar.vue' import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue' import SearchBox from '@components/SearchBox.vue'
import { queryMaintenance, maintOpeate } from '@config/getData2.js'
export default { export default {
name: 'MaintainExecution', name: 'MaintainExecution',
components: { components: {
@@ -60,18 +61,68 @@ export default {
val1: '', val1: '',
dataList: [], dataList: [],
pkId: '', pkId: '',
pkObj: {} pkObj: {},
disabled1: false,
disabled2: false
} }
}, },
methods: { methods: {
handleChange1 (e, type) { handleChange1 (e, type) {
if (type) { if (type) {
console.log(e) this._queryMaintenance(e)
} }
}, },
toCheck (e) { toCheck (e) {
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id this.pkId = this.pkId === e.maint_id ? '' : e.maint_id
this.pkObj = this.pkId === e.worktask_id ? e : {} this.pkObj = this.pkId === e.maint_id ? e : {}
},
/** 设备查询 */
async _queryMaintenance (e) {
let res = await queryMaintenance(e, '1')
if (res.code === '1') {
this.dataList = [...res.content.rows]
} else {
this.Dialog(res.desc)
}
},
async _maintOpeate (type) {
try {
let res = await maintOpeate(this.pkObj, type)
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
}
},
toSure1 () {
this.disabled1 = true
if (!this.pkId) {
this.disabled1 = false
return
}
this._maintOpeate('1')
},
toSure2 () {
this.disabled2 = true
if (!this.pkId) {
this.disabled2 = false
return
}
this._maintOpeate('2')
},
toJump () {
if (this.pkId) {
this.$store.dispatch('materObj', this.pkObj)
this.$router.push({
path: '/MaintainResults'
})
}
} }
} }
} }

View File

@@ -27,13 +27,9 @@
<tr> <tr>
<th>序号</th> <th>序号</th>
</tr> </tr>
<tr v-for="e in dataList" :key="e.worktask_id"> <tr v-for="e in dataList" :key="e.repair_dtl_id">
<td> <td>
<for-dropdown-menu {{parseInt(i) + 1}}
:value="e.is"
:id="e.worktask_id"
@getValue="getValue">
</for-dropdown-menu>
</td> </td>
</tr> </tr>
</table> </table>
@@ -46,19 +42,25 @@
<th>维修项目名称</th> <th>维修项目名称</th>
<th>要求</th> <th>要求</th>
</tr> </tr>
<tr v-for="e in dataList" :key="e.worktask_id" @click="toCheck(e)" :class="{'checked': e.worktask_id === pkId}"> <tr v-for="e in dataList" :key="e.repair_dtl_id" @click="toCheck(e)" :class="{'checked': e.repair_dtl_id === pkId}">
<td>{{e.workorder_code}}</td> <td>
<td>{{e.material_code}}</td> <for-dropdown-menu
<td>{{e.pcsn}}</td> :value="e.isfinish"
<td>{{e.status_name}}</td> :id="e.repair_dtl_id"
@getValue="getValue">
</for-dropdown-menu>
</td>
<td>{{e.repair_item_code}}</td>
<td>{{e.repair_item_name}}</td>
<td>{{e.requirement}}</td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
</section> </section>
<section class="submit-bar"> <section class="submit-bar">
<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">取消</button> <button class="btn submit-button" @click="toCancle">取消</button>
</section> </section>
</section> </section>
</template> </template>
@@ -67,6 +69,7 @@
import NavBar from '@components/NavBar.vue' import NavBar from '@components/NavBar.vue'
import SearchBox from '@components/SearchBox.vue' import SearchBox from '@components/SearchBox.vue'
import ForDropdownMenu from '@components/ForDropdownMenu.vue' import ForDropdownMenu from '@components/ForDropdownMenu.vue'
import {queryRepairDtl, repaireDtlConfirm} from '@config/getData2.js'
export default { export default {
name: 'MaintainResultFill', name: 'MaintainResultFill',
components: { components: {
@@ -76,17 +79,21 @@ export default {
}, },
data () { data () {
return { return {
val1: '', val1: JSON.stringify(this.$store.getters.materObj) !== '{}' ? this.$store.getters.materObj.device_code : '',
val2: '', val2: JSON.stringify(this.$store.getters.materObj) !== '{}' ? this.$store.getters.materObj.repair_code : '',
val3: '', val3: '',
dataList: [{worktask_id: '1'}, {worktask_id: '2'}], dataList: [],
pkId: '', pkId: '',
pkObj: {}, pkObj: {},
option: [{value: '1', label: '是'}, {value: '2', label: '否'}], option: [{value: '1', label: '是'}, {value: '2', label: '否'}],
active: '0', active: '0',
open: false open: false,
disabled1: false
} }
}, },
mounted () {
this._queryRepairDtl()
},
methods: { methods: {
handleChange1 (e, type) { handleChange1 (e, type) {
if (type) { if (type) {
@@ -94,13 +101,45 @@ export default {
} }
}, },
toCheck (e) { toCheck (e) {
this.pkId = this.pkId === e.worktask_id ? '' : e.worktask_id this.pkId = this.pkId === e.repair_dtl_id ? '' : e.repair_dtl_id
this.pkObj = this.pkId === e.worktask_id ? e : {} this.pkObj = this.pkId === e.repair_dtl_id ? e : {}
},
/** 明细查询 */
async _queryRepairDtl () {
let res = await queryRepairDtl(this.$store.getters.materObj)
if (res.code === '1') {
this.dataList = [...res.content.rows]
} else {
this.Dialog(res.desc)
}
},
async _repaireDtlConfirm () {
try {
let res = await repaireDtlConfirm(this.$store.getters.materObj, this.dataList, this.val3)
if (res.code === '1') {
this.toast(res.desc)
} else {
this.Dialog(res.desc)
}
this.disabled1 = false
} catch (e) {
this.disabled1 = false
}
},
toSure () {
this.disabled1 = true
if (!this.dataList.length) {
this.disabled1 = false
return
}
this._dtlConfirm()
},
toCancle () {
}, },
getValue (p) { getValue (p) {
this.dataList.map(el => { this.dataList.map(el => {
if (el.worktask_id === p[0]) { if (el.repair_dtl_id === p[0]) {
el.is = p[1] el.isfinish = p[1]
} }
}) })
} }

View File

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