¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search"> |
| | | <el-form :model="entity" ref="entity" size="small" :inline="true"> |
| | | <el-form-item label="产ååå·" prop="productType" v-if="tabIndex === 0"> |
| | | <el-input v-model="entity.productType" clearable placeholder="请è¾å
¥" size="small" |
| | | @keyup.enter.native="goSearch($event)"> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="åè¾
æåç§°" prop="entrustCode" v-if="tabIndex === 1"> |
| | | <el-input v-model="entity.entrustCode" clearable placeholder="请è¾å
¥" size="small" |
| | | @keyup.enter.native="goSearch($event)"> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button size="mini" type="primary" @click="goSearch()">æ¥è¯¢</el-button> |
| | | <el-button size="mini" @click="refresh()">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="table"> |
| | | <div class="table-tab"> |
| | | <div> |
| | | <ul class="tab"> |
| | | <li :class="{ active: tabIndex === 0 }" @click="handleTab(0)">æå</li> |
| | | <li :class="{ active: tabIndex === 1 }" @click="handleTab(1)">åè¾
æ</li> |
| | | </ul> |
| | | </div> |
| | | <div> |
| | | <el-button size="small" type="primary" @click="openAddDia('add')">æ°å¢</el-button> |
| | | </div> |
| | | </div> |
| | | <!--æå--> |
| | | <div class="table"> |
| | | <lims-table :tableData="tableData" :column="column" |
| | | v-if="tabIndex === 0" |
| | | @pagination="pagination" |
| | | ref="tableData" |
| | | :height="'calc(100vh - 290px)'" |
| | | key="tableData" :page="page" |
| | | :tableLoading="tableLoading"></lims-table> |
| | | </div> |
| | | <!--åè¾
æ--> |
| | | <div class="table"> |
| | | <lims-table :tableData="tableData1" :column="column1" |
| | | v-if="tabIndex === 1" :isSelection="true" |
| | | @pagination="pagination1" |
| | | :height="'calc(100vh - 290px)'" |
| | | key="tableData1" :page="page1" :tableLoading="tableLoading1"></lims-table> |
| | | </div> |
| | | </div> |
| | | <el-dialog :visible.sync="proPlanDia" title="æå计å"> |
| | | <el-form :model="proPlanForm" ref="proPlanForm" :rules="proPlanRules" label-width="80px" size="small"> |
| | | <el-form-item label="产ååå·" prop="productType"> |
| | | <el-input v-model="proPlanForm.productType" placeholder="请填å产ååå·" :disabled="operationType === 'review'"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="产ååç§°" prop="productName"> |
| | | <el-input v-model="proPlanForm.productName" placeholder="请填å产ååç§°" :disabled="operationType === 'review'"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="é¶ä»¶å·" prop="partNo"> |
| | | <el-input v-model="proPlanForm.partNo" placeholder="请填åé¶ä»¶å·" :disabled="operationType === 'review'"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å®¡æ ¸äºº" prop="reviewerId"> |
| | | <el-select v-model="proPlanForm.reviewerId" clearable filterable size="small" style="width: 50%;" :disabled="operationType === 'review'"> |
| | | <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> |
| | | <div slot="footer" class="foot"> |
| | | <el-button v-if="operationType !== 'review'" @click="closeProDia">å æ¶</el-button> |
| | | <el-button v-if="operationType !== 'review'" type="primary" :loading="submitProLoading" @click="submitProForm">ä¿ å</el-button> |
| | | <el-button v-if="operationType === 'review'" :loading="submitProLoading" @click="submitProForm(0)">ä¸éè¿</el-button> |
| | | <el-button v-if="operationType === 'review'" type="primary" :loading="submitProLoading" @click="submitProForm(1)">éè¿</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog :visible.sync="materialDia" title="åè¾
æè®¡å"> |
| | | <el-form :model="materialForm" ref="materialForm" :rules="materialRules" label-width="90px" size="small"> |
| | | <el-form-item label="åè¾
æåç§°" prop="materialName"> |
| | | <el-input v-model="materialForm.materialName" placeholder="请填å产ååç§°" :disabled="operationType === 'review'"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="é¶ä»¶å·" prop="partNo"> |
| | | <el-input v-model="materialForm.partNo" placeholder="请填åé¶ä»¶å·" :disabled="operationType === 'review'"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å®¡æ ¸äºº" prop="reviewerId"> |
| | | <el-select v-model="proPlanForm.reviewerId" clearable filterable size="small" style="width: 50%;" :disabled="operationType === 'review'"> |
| | | <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> |
| | | <div slot="footer" class="foot"> |
| | | <el-button v-if="operationType !== 'review'" @click="closeMaterialRulesDia">å æ¶</el-button> |
| | | <el-button v-if="operationType !== 'review'" type="primary" :loading="submitMatLoading" @click="submitMaterialRulesForm">ä¿ å</el-button> |
| | | <el-button v-if="operationType === 'review'" :loading="submitMatLoading" @click="submitMaterialRulesForm(0)">ä¸éè¿</el-button> |
| | | <el-button v-if="operationType === 'review'" type="primary" :loading="submitMatLoading" @click="submitMaterialRulesForm(1)">éè¿</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import { |
| | | addOrUpdateMaterial, |
| | | addOrUpdateProduct, delMaterial, |
| | | delProduct, |
| | | selectMaterial, |
| | | selectProduct |
| | | } from "@/api/business/reliabilityPlan"; |
| | | import {selectUserCondition} from "@/api/system/user"; |
| | | import {deleteAuxiliaryWorkingHours} from "@/api/performance/manHour"; |
| | | |
| | | export default { |
| | | name: '', |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {limsTable}, |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | entity: { |
| | | productType: null, |
| | | entrustCode: null, |
| | | }, |
| | | tabIndex: 0, |
| | | // æåtableæ°æ® |
| | | tableData: [], |
| | | tableLoading: false, |
| | | column: [ |
| | | { label: '产ååå·', prop: 'productType' }, |
| | | { label: '产ååç§°', prop: 'productName' }, |
| | | { label: 'é¶ä»¶å·', prop: 'partNo' }, |
| | | { |
| | | dataType: 'tag', |
| | | label: 'å®¡æ ¸ç¶æ', |
| | | prop: 'state', |
| | | formatData: (params) => { |
| | | if (params == 1) { |
| | | return 'éè¿' |
| | | } else if (params == 0) { |
| | | return 'ä¸éè¿' |
| | | } else { |
| | | return null |
| | | } |
| | | }, |
| | | formatType: (params) => { |
| | | if (params == 1) { |
| | | return 'success' |
| | | } else if (params == 0) { |
| | | return 'danger' |
| | | } else { |
| | | return null |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | dataType: 'action', |
| | | label: 'æä½', |
| | | fixed: 'right', |
| | | operation: [ |
| | | { |
| | | name: 'ç¼è¾', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.openAddDia('edit',row); |
| | | } |
| | | }, |
| | | { |
| | | name: 'å®¡æ ¸', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.openAddDia('review',row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "å é¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleDelete(row); |
| | | }, |
| | | disabled: (row) => { |
| | | return row.state == 1 |
| | | }, |
| | | }, |
| | | ] |
| | | } |
| | | ], |
| | | page: { |
| | | total: 0, |
| | | size: 20, |
| | | current: 1 |
| | | }, |
| | | // |
| | | // åè¾
ætableæ°æ® |
| | | tableData1: [], |
| | | tableLoading1: false, |
| | | column1: [ |
| | | { label: 'åè¾
æåç§°', prop: 'materialName' }, |
| | | { label: 'é¶ä»¶å·', prop: 'partNo' }, |
| | | { |
| | | dataType: 'tag', |
| | | label: 'å®¡æ ¸ç¶æ', |
| | | prop: 'state', |
| | | formatData: (params) => { |
| | | if (params == 1) { |
| | | return 'éè¿' |
| | | } else if (params == 0) { |
| | | return 'ä¸éè¿' |
| | | } else { |
| | | return null |
| | | } |
| | | }, |
| | | formatType: (params) => { |
| | | if (params == 1) { |
| | | return 'success' |
| | | } else if (params == 0) { |
| | | return 'danger' |
| | | } else { |
| | | return null |
| | | } |
| | | } |
| | | }, |
| | | { |
| | | dataType: 'action', |
| | | fixed: 'right', |
| | | label: 'æä½', |
| | | operation: [ |
| | | { |
| | | name: 'ç¼è¾', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.openAddDia('edit',row); |
| | | } |
| | | }, |
| | | { |
| | | name: 'å®¡æ ¸', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.openAddDia('review',row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "å é¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleDeleteM(row); |
| | | }, |
| | | disabled: (row) => { |
| | | return row.state == 1 |
| | | }, |
| | | }, |
| | | ] |
| | | } |
| | | ], |
| | | page1: { |
| | | total: 0, |
| | | size: 20, |
| | | current: 1 |
| | | }, |
| | | proPlanDia: false, |
| | | responsibleOptions: [], |
| | | proPlanForm: { |
| | | id: '', |
| | | productName: '', |
| | | productType: '', |
| | | partNo: '', |
| | | }, |
| | | proPlanRules: { |
| | | |
| | | }, |
| | | submitProLoading: false, |
| | | operationType: '', |
| | | materialDia: false, |
| | | materialForm: { |
| | | id: '', |
| | | materialName: '', |
| | | partNo: '', |
| | | state: '', |
| | | }, |
| | | materialRules: {}, |
| | | submitMatLoading: false, |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.goSearch() |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | // ç¹å»æ¥è¯¢åè° |
| | | goSearch(event) { |
| | | if (event && typeof event.preventDefault === 'function') { |
| | | event.preventDefault(); // 黿¢é»è®¤è¡ä¸º |
| | | } |
| | | this.page.current = 1 |
| | | this.page1.current = 1 |
| | | this.refreshTable() |
| | | }, |
| | | // 忢ä¸åtabè¡¨æ ¼ |
| | | handleTab(m) { |
| | | this.tabIndex = m; |
| | | this.refreshTable() |
| | | }, |
| | | pagination(page) { |
| | | this.page.size = page.limit |
| | | this.refreshTable() |
| | | }, |
| | | pagination1(page) { |
| | | this.page1.size = page.limit |
| | | this.refreshTable() |
| | | }, |
| | | // æ¥è¯¢åè° |
| | | refreshTable() { |
| | | if (this.tabIndex === 0) { |
| | | // æåæ¥è¯¢ |
| | | this.getProductOrderList() |
| | | } else if (this.tabIndex === 1) { |
| | | // åè¾
ææ¥è¯¢ |
| | | this.getMaterialOrderList() |
| | | } |
| | | }, |
| | | getProductOrderList () { |
| | | this.tableLoading = true |
| | | selectProduct({...this.entity, ...this.page}).then(response => { |
| | | this.tableLoading = false |
| | | this.tableData = response.data.records |
| | | }).catch(error => { |
| | | this.tableLoading = false |
| | | }) |
| | | }, |
| | | getMaterialOrderList () { |
| | | this.tableLoading1 = true |
| | | selectMaterial({...this.entity, ...this.page}).then(response => { |
| | | this.tableLoading1 = false |
| | | this.tableData1 = response.data.records |
| | | }).catch(err => { |
| | | this.tableLoading1 = false |
| | | }) |
| | | }, |
| | | // é ç½® |
| | | refresh() { |
| | | this.resetForm('entity') |
| | | this.refreshTable() |
| | | }, |
| | | // æå¼æ°å¢å¼¹æ¡ |
| | | openAddDia(type, row) { |
| | | this.operationType = type |
| | | // this.getUserList() |
| | | if (this.tabIndex === 0) { |
| | | this.proPlanDia = true |
| | | if (this.operationType !== 'add') { |
| | | this.proPlanForm = {...row} |
| | | } |
| | | } else { |
| | | this.materialDia = true |
| | | if (this.operationType !== 'add') { |
| | | this.materialForm = {...row} |
| | | } |
| | | } |
| | | }, |
| | | // æåä¿¡æ¯æäº¤ |
| | | submitProForm (state) { |
| | | this.submitProLoading = true |
| | | if (this.operationType === 'add') { |
| | | this.proPlanForm.state = '' |
| | | } else { |
| | | this.proPlanForm.state = state |
| | | } |
| | | addOrUpdateProduct(this.proPlanForm).then(res => { |
| | | if (res.code === 200) { |
| | | this.closeProDia() |
| | | this.$message.success('æä½æå') |
| | | this.goSearch() |
| | | } |
| | | this.submitProLoading = false |
| | | }).catch(err => { |
| | | console.log(err) |
| | | this.submitProLoading = false |
| | | }) |
| | | }, |
| | | // å
³éæåä¿¡æ¯å¼¹æ¡ |
| | | closeProDia () { |
| | | this.resetForm('proPlanDia') |
| | | this.proPlanDia = false |
| | | }, |
| | | // åè¾
æä¿¡æ¯æäº¤ |
| | | submitMaterialRulesForm (state) { |
| | | this.submitMatLoading = true |
| | | if (this.operationType === 'add') { |
| | | this.materialForm.state = '' |
| | | } else { |
| | | this.materialForm.state = state |
| | | } |
| | | addOrUpdateMaterial(this.materialForm).then(res => { |
| | | if (res.code === 200) { |
| | | this.closeMaterialRulesDia() |
| | | this.$message.success('æä½æå') |
| | | this.goSearch() |
| | | } |
| | | this.submitMatLoading = false |
| | | }).catch(err => { |
| | | console.log(err) |
| | | this.submitMatLoading = false |
| | | }) |
| | | }, |
| | | // å
³éåè¾
æä¿¡æ¯å¼¹æ¡ |
| | | closeMaterialRulesDia() { |
| | | this.resetForm('materialForm') |
| | | this.materialDia = false |
| | | }, |
| | | handleDelete (row) { |
| | | this.$confirm("æ¯å¦å é¤è¯¥æ¡æ°æ®?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }).then(() => { |
| | | delProduct({ id: row.id }).then((res) => { |
| | | if (res.code == 200){ |
| | | this.$message.success("å 餿å"); |
| | | this.goSearch(); |
| | | } |
| | | }); |
| | | }).catch(() => { |
| | | |
| | | }); |
| | | }, |
| | | handleDeleteM (row) { |
| | | this.$confirm("æ¯å¦å é¤è¯¥æ¡æ°æ®?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }).then(() => { |
| | | delMaterial({ id: row.id }).then((res) => { |
| | | if (res.code == 200){ |
| | | this.$message.success("å 餿å"); |
| | | this.goSearch(); |
| | | } |
| | | }); |
| | | }).catch(() => { |
| | | |
| | | }); |
| | | }, |
| | | // è·åè´è´£äººä¿¡æ¯æ¥å£ |
| | | getUserList() { |
| | | selectUserCondition().then(res => { |
| | | if (res.code == 200) { |
| | | this.responsibleOptions = res.data |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .table-tab { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .tab { |
| | | list-style-type: none; |
| | | display: flex; |
| | | margin-bottom: 12px; |
| | | margin-top: 0; |
| | | padding-left: 0; |
| | | } |
| | | |
| | | .tab li { |
| | | line-height: 24px; |
| | | padding: 6px 14px; |
| | | font-size: 14px; |
| | | color: #333333; |
| | | border: 1px solid #EEEEEE; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .tab li:nth-child(1) { |
| | | border-radius: 8px 0 0 8px; |
| | | } |
| | | |
| | | .tab li:nth-child(2) { |
| | | border-radius: 0 8px 8px 0; |
| | | } |
| | | |
| | | .tab li.active { |
| | | border-color: #3A7BFA; |
| | | color: #3A7BFA; |
| | | } |
| | | </style> |