¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <el-dialog |
| | | :visible.sync="editInspectionDia" |
| | | title="æ¥çå·¥æ¶" |
| | | width="80%" |
| | | @close="editInspectionDia = false" |
| | | > |
| | | <div> |
| | | <el-form :model="entity" :inline="true"> |
| | | <el-form-item label="æ£éªé¡¹" prop="outputWorkTime"> |
| | | <el-input v-model="entity.inspectionItem" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button size="small" type="primary" @click="getList0">æ¥è¯¢</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <lims-table :tableData="tableData0" :column="column0" |
| | | :page="page0" :tableLoading="tableLoading" |
| | | height="500" @pagination="pagination0"></lims-table> |
| | | <span slot="footer" class="dialog-footer" v-if="insState == 99"> |
| | | <el-button @click="editInspectionDia = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="handleSubmit">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="editAskDia" title="ä¿®æ¹" width="50%"> |
| | | <el-form ref="form" :model="editForm" label-width="100px"> |
| | | <el-form-item label="æ£æµäºº" prop="name"> |
| | | <el-select v-model="editForm.name" clearable size="small"> |
| | | <el-option v-for="item in responsibleOptions" :key="item.id" :label="item.name" :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="产éå·¥æ¶" prop="outputWorkTime"> |
| | | <el-input v-model="editForm.outputWorkTime" clearable size="small"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ¥æ" prop="dateTime"> |
| | | <el-date-picker |
| | | v-model="editForm.dateTime" |
| | | placeholder="éæ©æ¥æ" |
| | | size="small" |
| | | style="width: 100%;" |
| | | type="date" |
| | | format="yyyy-MM-dd" |
| | | value-format="yyyy-MM-dd"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="editAskDia = false">å æ¶</el-button> |
| | | <el-button |
| | | :loading="handleEditLoading" |
| | | type="primary" |
| | | @click="handleEdit" |
| | | >ç¡® å®</el-button |
| | | > |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import { |
| | | getWorkingHoursByOrderId, updateWorkingHours, |
| | | } from "@/api/business/inspectionTask.js"; |
| | | import {selectUserCondition} from "@/api/system/user"; |
| | | export default { |
| | | name: "EditInspectionItem", |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: { limsTable }, |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | editInspectionDia: false, |
| | | entity: { |
| | | orderId: 0, |
| | | inspectionItem: '' |
| | | }, |
| | | insState: 0, |
| | | tableData0: [], |
| | | tableLoading: false, |
| | | column0: [ |
| | | { label: "æ£æµäºº", prop: "name" }, |
| | | { label: "æ£æµé¡¹åç±»", prop: "inspectionItemClass" }, |
| | | { label: "æ£æµé¡¹", prop: "inspectionItem", width: 110 }, |
| | | { label: "æ£æµå项", prop: "inspectionItemSubclass", width: 110 }, |
| | | { label: "æ ·åç¼å·", prop: "sample", width: 160 }, |
| | | { label: "å§æåå·", prop: "orderNo", width: 160 }, |
| | | { label: "çµç¼æ è¯", prop: "cableTag" }, |
| | | { label: "产éå·¥æ¶", prop: "outputWorkTime" }, |
| | | { label: "å·¥æ¶åç»", prop: "manHourGroup" }, |
| | | { label: "åä»·", prop: "price" }, |
| | | { label: "æ¥æ", prop: "dateTime" }, |
| | | { label: "卿¬¡", prop: "week" }, |
| | | { label: "ææ", prop: "weekDay" }, |
| | | { |
| | | dataType: "action", |
| | | width: "80px", |
| | | label: "æä½", |
| | | fixed: "right", |
| | | operation: [ |
| | | { |
| | | name: "ç¼è¾", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.editIns(row); |
| | | }, |
| | | disabled: (row) => { |
| | | return this.insState == 3 || this.insState == 5 || this.insState == 99 |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | page0: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 1, |
| | | }, |
| | | editAskDia: false, |
| | | editForm: { |
| | | id: "", |
| | | name: "", |
| | | outputWorkTime: "", |
| | | inspectionValueType: "", |
| | | }, |
| | | handleEditLoading: false, |
| | | inspectionValueType: [], |
| | | responsibleOptions: [] |
| | | }; |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | showDialog(id, insState) { |
| | | this.insState = insState |
| | | this.editInspectionDia = true; |
| | | this.entity.orderId = id; |
| | | this.getList0(); |
| | | }, |
| | | getList0() { |
| | | this.tableLoading = true; |
| | | getWorkingHoursByOrderId({ ...this.entity, ...this.page0 }) |
| | | .then((res) => { |
| | | this.tableLoading = false; |
| | | if (res.code === 200) { |
| | | this.tableData0 = res.data.records; |
| | | this.page0.total = res.data.total; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | this.tableLoading = false; |
| | | }); |
| | | }, |
| | | // ä¿®æ¹å¼¹æ¡ |
| | | editIns(row) { |
| | | this.editAskDia = true; |
| | | this.editForm = { ...row }; |
| | | this.getUserList() |
| | | }, |
| | | // æäº¤ä¿®æ¹ |
| | | handleEdit() { |
| | | this.handleEditLoading = true; |
| | | updateWorkingHours({...this.editForm}) |
| | | .then((res) => { |
| | | this.handleEditLoading = false; |
| | | this.$message.success("ä¿®æ¹æå"); |
| | | this.editAskDia = false; |
| | | this.getList0(); |
| | | }) |
| | | .catch(() => { |
| | | this.handleEditLoading = false; |
| | | }); |
| | | }, |
| | | // ç¡®è®¤å·¥æ¶ |
| | | handleSubmit () { |
| | | this.editInspectionDia = false; |
| | | this.$emit("submit"); |
| | | }, |
| | | pagination0({ page, limit }) { |
| | | this.page0.current = page; |
| | | this.page0.size = limit; |
| | | this.getList0(); |
| | | }, |
| | | // è·åè´è´£äººä¿¡æ¯æ¥å£ |
| | | getUserList() { |
| | | selectUserCondition({ type: 1 }).then((res) => { |
| | | this.responsibleOptions = res.data; |
| | | }) |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .pagination { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | </style> |