¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | //è·åæ åæ¹æ³å表 |
| | | export function selectStandardMethodList(query) { |
| | | return request({ |
| | | url: "/standardMethod/selectStandardMethodList", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | //å 餿 åæ¹æ³ |
| | | export function delStandardMethod(query) { |
| | | return request({ |
| | | url: "/standardMethod/delStandardMethod", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ·»å æ åæ¹æ³ |
| | | export function addStandardMethod(data) { |
| | | return request({ |
| | | url: "/standardMethod/addStandardMethod", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ä¿®æ¹æ åæ¹æ³ |
| | | export function upStandardMethod(data) { |
| | | return request({ |
| | | url: "/standardMethod/upStandardMethod", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | //è·åäº§åæ¶æ |
| | | export function getStandardTree2(query) { |
| | | return request({ |
| | | url: "/standardTree/getStandardTree2", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // 导å
¥æ åæç» |
| | | export function importStandardDetails(data) { |
| | | return request({ |
| | | url: "/standardMethod/importStandardDetails", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | // è·åç¨æ·å表 (ç¨äºç次,å·¥æ¶) |
| | | export function selectUserList(query) { |
| | | // è·åç¨æ·å表 |
| | | export function selectUserCondition(query) { |
| | | return request({ |
| | | url: "/user/selectUserList", |
| | | url: "/system/newUser/selectUserCondition", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | |
| | | @current-change="currentChange" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <template v-if="isSelection"> |
| | | <el-table-column type="selection" width="55" /> |
| | | </template> |
| | | <template> |
| | | <el-table-column |
| | | align="center" |
| | | label="åºå·" |
| | | type="index" |
| | | width="60" |
| | | :index="indexMethod" |
| | | /> |
| | | </template> |
| | | <el-table-column type="selection" width="55" v-if="isSelection" /> |
| | | <el-table-column |
| | | align="center" |
| | | label="åºå·" |
| | | type="index" |
| | | width="60" |
| | | :index="indexMethod" |
| | | /> |
| | | |
| | | <template v-for="(item, index) in column"> |
| | | <el-table-column |
| | | :column-key="item.columnKey" |
| | | :filter-method="item.filterHandler" |
| | | :filter-multiple="item.filterMultiple" |
| | | :filtered-value="item.filteredValue" |
| | | :filters="item.filters" |
| | | :fixed="item.fixed" |
| | | :label="item.label" |
| | | :min-width="item.minWidth" |
| | | :prop="item.prop" |
| | | show-overflow-tooltip |
| | | :sortable="item.sortable ? true : false" |
| | | :type="item.type" |
| | | :width="item.width" |
| | | align="center" |
| | | <el-table-column |
| | | v-for="(item, index) in column" |
| | | :key="index" |
| | | :column-key="item.columnKey" |
| | | :filter-method="item.filterHandler" |
| | | :filter-multiple="item.filterMultiple" |
| | | :filtered-value="item.filteredValue" |
| | | :filters="item.filters" |
| | | :fixed="item.fixed" |
| | | :label="item.label" |
| | | :min-width="item.minWidth" |
| | | :prop="item.prop" |
| | | show-overflow-tooltip |
| | | :sortable="item.sortable ? true : false" |
| | | :type="item.type" |
| | | :width="item.width" |
| | | align="center" |
| | | > |
| | | <!-- <div class="123" v-if="item.type == ''"> --> |
| | | <template |
| | | v-if="item.hasOwnProperty('colunmTemplate')" |
| | | :slot="item.colunmTemplate" |
| | | slot-scope="scope" |
| | | > |
| | | <!-- <div class="123" v-if="item.type == ''"> --> |
| | | <template |
| | | v-if="item.hasOwnProperty('colunmTemplate')" |
| | | :slot="item.colunmTemplate" |
| | | slot-scope="scope" |
| | | > |
| | | <slot |
| | | v-if="item.theadSlot" |
| | | :index="index" |
| | | :name="item.theadSlot" |
| | | :row="scope.row" |
| | | /> |
| | | </template> |
| | | |
| | | <template slot-scope="scope"> |
| | | <!-- ææ§½ --> |
| | | <div v-if="item.dataType == 'slot'"> |
| | | <slot |
| | | v-if="item.theadSlot" |
| | | :index="index" |
| | | :name="item.theadSlot" |
| | | v-if="item.slot" |
| | | :index="scope.$index" |
| | | :name="item.slot" |
| | | :row="scope.row" |
| | | /> |
| | | </template> |
| | | </div> |
| | | <!-- è¿åº¦æ¡ --> |
| | | <div v-else-if="item.dataType == 'progress'"> |
| | | <el-progress :percentage="Number(scope.row[item.prop])" /> |
| | | </div> |
| | | <!-- å¾ç --> |
| | | <div v-else-if="item.dataType == 'image'"> |
| | | <img |
| | | :src="javaApi + '/img/' + item.prop" |
| | | alt="" |
| | | style="width: 40px; height: 40px; margin-top: 10px" |
| | | /> |
| | | </div> |
| | | |
| | | <template slot-scope="scope"> |
| | | <!-- ææ§½ --> |
| | | <div v-if="item.dataType == 'slot'"> |
| | | <slot |
| | | v-if="item.slot" |
| | | :index="scope.$index" |
| | | :name="item.slot" |
| | | :row="scope.row" |
| | | /> |
| | | </div> |
| | | <!-- è¿åº¦æ¡ --> |
| | | <div v-else-if="item.dataType == 'progress'"> |
| | | <el-progress :percentage="Number(scope.row[item.prop])" /> |
| | | </div> |
| | | <!-- å¾ç --> |
| | | <div v-else-if="item.dataType == 'image'"> |
| | | <img :src="javaApi+'/img/'+item.prop" |
| | | alt="" style="width: 40px;height: 40px;margin-top: 10px;"> |
| | | </div> |
| | | |
| | | <!-- tag --> |
| | | <div v-else-if="item.dataType == 'tag'"> |
| | | <el-tag |
| | | v-if=" |
| | | typeof dataTypeFn(scope.row[item.prop], item.formatData) == |
| | | 'string' |
| | | " |
| | | :title="scope.row[item.prop] | formatters(item.formatData)" |
| | | :type="formatType(scope.row[item.prop], item.formatType)" |
| | | >{{ |
| | | scope.row[item.prop] | formatters(item.formatData) |
| | | }}</el-tag |
| | | > |
| | | <el-tag |
| | | v-for="(tag, index) in dataTypeFn( |
| | | scope.row[item.prop], |
| | | item.formatData |
| | | )" |
| | | v-else-if=" |
| | | typeof dataTypeFn(scope.row[item.prop], item.formatData) == |
| | | 'object' |
| | | " |
| | | :key="index" |
| | | :title="scope.row[item.prop] | formatters(item.formatData)" |
| | | :type="formatType(tag, item.formatType)" |
| | | >{{ |
| | | item.tagGroup |
| | | <!-- tag --> |
| | | <div v-else-if="item.dataType == 'tag'"> |
| | | <el-tag |
| | | v-if=" |
| | | typeof dataTypeFn(scope.row[item.prop], item.formatData) == |
| | | 'string' |
| | | " |
| | | :title="scope.row[item.prop] | formatters(item.formatData)" |
| | | :type="formatType(scope.row[item.prop], item.formatType)" |
| | | >{{ scope.row[item.prop] | formatters(item.formatData) }}</el-tag |
| | | > |
| | | <el-tag |
| | | v-for="(tag, index) in dataTypeFn( |
| | | scope.row[item.prop], |
| | | item.formatData |
| | | )" |
| | | v-else-if=" |
| | | typeof dataTypeFn(scope.row[item.prop], item.formatData) == |
| | | 'object' |
| | | " |
| | | :key="index" |
| | | :title="scope.row[item.prop] | formatters(item.formatData)" |
| | | :type="formatType(tag, item.formatType)" |
| | | >{{ |
| | | item.tagGroup |
| | | ? tag[item.tagGroup.label] |
| | | ? tag[item.tagGroup.label] |
| | | ? tag[item.tagGroup.label] |
| | | : tag |
| | | : tag |
| | | }}</el-tag |
| | | > |
| | | <el-tag |
| | | v-else |
| | | :title="scope.row[item.prop] | formatters(item.formatData)" |
| | | :type="formatType(scope.row[item.prop], item.formatType)" |
| | | >{{ |
| | | scope.row[item.prop] | formatters(item.formatData) |
| | | }}</el-tag |
| | | > |
| | | </div> |
| | | : tag |
| | | }}</el-tag |
| | | > |
| | | <el-tag |
| | | v-else |
| | | :title="scope.row[item.prop] | formatters(item.formatData)" |
| | | :type="formatType(scope.row[item.prop], item.formatType)" |
| | | >{{ scope.row[item.prop] | formatters(item.formatData) }}</el-tag |
| | | > |
| | | </div> |
| | | |
| | | <!-- æé® --> |
| | | <div v-else-if="item.dataType == 'action'"> |
| | | <template v-for="(o, key) in item.operation"> |
| | | <!-- æé® --> |
| | | <div v-else-if="item.dataType == 'action'"> |
| | | <template v-for="(o, key) in item.operation"> |
| | | <el-button |
| | | v-if="o.type != 'upload'" |
| | | size="mini" |
| | | v-show="o.showHide ? o.showHide(scope.row) : true" |
| | | :disabled="o.disabled ? o.disabled(scope.row) : false" |
| | | :icon="iconFn(o)" |
| | | :plain="o.plain" |
| | | :style="{ color: o.name === 'å é¤' ? '#f56c6c' : o.color }" |
| | | :type="o.type | typeFn(scope.row)" |
| | | @click="o.clickFun(scope.row)" |
| | | :key="key" |
| | | > |
| | | {{ o.name }} |
| | | </el-button> |
| | | <el-upload |
| | | action="#" |
| | | size="mini" |
| | | :on-change=" |
| | | (file, fileList) => o.clickFun(scope.row, file, fileList) |
| | | " |
| | | :multiple="o.multiple ? o.multiple : false" |
| | | :limit="o.limit ? o.limit : 1" |
| | | :disabled="o.disabled ? o.disabled(scope.row) : false" |
| | | :accept=" |
| | | o.accept |
| | | ? o.accept |
| | | : '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' |
| | | " |
| | | v-if="o.type == 'upload'" |
| | | style="display: inline-block; width: 50px" |
| | | v-show="o.showHide ? o.showHide(scope.row) : true" |
| | | :auto-upload="false" |
| | | :on-exceed="onExceed" |
| | | :show-file-list="false" |
| | | :key="key" |
| | | > |
| | | <el-button |
| | | v-if="o.type != 'upload'" |
| | | size="mini" |
| | | v-show="o.showHide ? o.showHide(scope.row) : true" |
| | | :size="o.size ? o.size : 'small'" |
| | | type="text" |
| | | :disabled="o.disabled ? o.disabled(scope.row) : false" |
| | | :icon="iconFn(o)" |
| | | :plain="o.plain" |
| | | :style="{ color: o.name === 'å é¤' ? '#f56c6c' : o.color }" |
| | | :type="o.type | typeFn(scope.row)" |
| | | @click="o.clickFun(scope.row)" |
| | | >{{ o.name }}</el-button |
| | | > |
| | | {{ o.name }} |
| | | </el-button> |
| | | <el-upload |
| | | action="#" |
| | | size="mini" |
| | | :on-change=" |
| | | (file, fileList) => o.clickFun(scope.row, file, fileList) |
| | | " |
| | | :multiple="o.multiple ? o.multiple : false" |
| | | :limit="o.limit ? o.limit : 1" |
| | | :disabled="o.disabled ? o.disabled(scope.row) : false" |
| | | :accept=" |
| | | o.accept |
| | | ? o.accept |
| | | : '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar' |
| | | " |
| | | v-if="o.type == 'upload'" |
| | | style="display: inline-block; width: 50px" |
| | | v-show="o.showHide ? o.showHide(scope.row) : true" |
| | | :auto-upload="false" |
| | | :on-exceed="onExceed" |
| | | :show-file-list="false" |
| | | > |
| | | <el-button |
| | | :size="o.size ? o.size : 'small'" |
| | | type="text" |
| | | :disabled="o.disabled ? o.disabled(scope.row) : false" |
| | | >{{ o.name }}</el-button |
| | | > |
| | | </el-upload> |
| | | </template> |
| | | </div> |
| | | <!-- é»è®¤çº¯å±ç¤ºæ°æ® --> |
| | | <div v-else> |
| | | <span v-if="!item.formatData">{{ scope.row[item.prop] }}</span> |
| | | <span v-else>{{ |
| | | scope.row[item.prop] | formatters(item.formatData) |
| | | }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </template> |
| | | </el-upload> |
| | | </template> |
| | | </div> |
| | | <!-- é»è®¤çº¯å±ç¤ºæ°æ® --> |
| | | <div v-else class="cell" style="width: 100%"> |
| | | <span v-if="!item.formatData">{{ scope.row[item.prop] }}</span> |
| | | <span v-else>{{ |
| | | scope.row[item.prop] | formatters(item.formatData) |
| | | }}</span> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | v-show="page.total > 0" |
| | |
| | | .el-table >>> .el-table__empty-text { |
| | | text-align: center; |
| | | } |
| | | .cell { |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | padding-right: 4px; |
| | | padding-left: 4px; |
| | | } |
| | | >>> .cell { |
| | | padding: 0 !important; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <style scoped> |
| | | .search { |
| | | background-color: #fff; |
| | | height: 80px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search_thing { |
| | | width: 350px; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | .search_label { |
| | | width: 110px; |
| | | font-size: 14px; |
| | | text-align: right; |
| | | } |
| | | |
| | | .search_input { |
| | | width: calc(100% - 110px); |
| | | } |
| | | |
| | | .table { |
| | | margin-top: 10px; |
| | | background-color: #fff; |
| | | width: calc(100% - 40px); |
| | | height: calc(100% - 60px - 80px - 10px - 40px); |
| | | padding: 20px; |
| | | } |
| | | </style> |
| | | |
| | | <template> |
| | | <div class="standard_method"> |
| | | <div class="search"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æ åç¼å·ï¼</div> |
| | | <div class="search_input"> |
| | | <el-input |
| | | size="small" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | v-model="queryParams.code" |
| | | @keyup.enter.native="refreshTable()" |
| | | ></el-input> |
| | | </div> |
| | | </div> |
| | | <div class="search_thing"> |
| | | <div class="search_label">æ ååç§°ï¼</div> |
| | | <div class="search_input"> |
| | | <el-input |
| | | size="small" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | v-model="queryParams.name" |
| | | @keyup.enter.native="refreshTable()" |
| | | ></el-input> |
| | | </div> |
| | | </div> |
| | | <div class="search_thing" style="padding-left: 30px"> |
| | | <el-button size="small" @click="refresh()">é ç½®</el-button> |
| | | <el-button size="small" type="primary" @click="refreshTable()" |
| | | >æ¥ è¯¢</el-button |
| | | > |
| | | </div> |
| | | <div class="btn"> |
| | | <el-button |
| | | size="small" |
| | | @click="$refs.ValueTable.openUpload()" |
| | | v-if="inPower" |
| | | > |
| | | <i class="el-icon-upload2" style="color: #3a7bfa"></i> |
| | | <span style="color: #3a7bfa">导å
¥</span></el-button |
| | | > |
| | | <el-button size="small" type="primary" @click="openAdd" v-if="addPower" |
| | | >æ°å¢</el-button |
| | | > |
| | | </div> |
| | | </div> |
| | | <lims-table |
| | | :tableData="tableData" |
| | | :column="column" |
| | | :page="page" |
| | | :tableLoading="tableLoading" |
| | | :height="'calc(100vh - 250px)'" |
| | | style="padding: 20px; padding-top: 0" |
| | | @pagination="pagination" |
| | | ></lims-table> |
| | | <!-- æ°å¢/ç¼è¾ --> |
| | | <el-dialog :title="title" :visible.sync="addDlog" width="500px"> |
| | | <el-form |
| | | :model="addForm" |
| | | ref="addForm" |
| | | :rules="addRules" |
| | | label-position="right" |
| | | label-width="120px" |
| | | > |
| | | <el-form-item label="é¢å" prop="field"> |
| | | <el-input |
| | | size="small" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | v-model="addForm.field" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ åç¼å·" prop="code"> |
| | | <el-input |
| | | size="small" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | v-model="addForm.code" |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ£éªå¯¹è±¡" prop="structureTestObjectId"> |
| | | <el-cascader |
| | | size="small" |
| | | :options="tandardTree" |
| | | v-model="addForm.structureTestObjectId" |
| | | collapse-tags |
| | | :props="{ multiple: true, checkStrictly: true }" |
| | | clearable |
| | | style="width: 100%" |
| | | ></el-cascader> |
| | | </el-form-item> |
| | | <el-form-item label="æ åæè¿°" prop="name"> |
| | | <el-input |
| | | size="small" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | v-model="addForm.name" |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="æ åæè¿°EN" prop="nameEn"> |
| | | <el-input |
| | | size="small" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | v-model="addForm.nameEn" |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" prop="remark"> |
| | | <el-input |
| | | size="small" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | v-model="addForm.remark" |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="èµè´¨" prop="qualificationId"> |
| | | <el-select |
| | | v-model="addForm.qualificationId" |
| | | size="small" |
| | | clearable |
| | | placeholder="è¯·éæ©" |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in qualificationList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦äº§åæ å" prop="isProduct"> |
| | | <el-select |
| | | v-model="addForm.isProduct" |
| | | size="small" |
| | | clearable |
| | | placeholder="è¯·éæ©" |
| | | style="width: 100%" |
| | | > |
| | | <el-option label="å¦" :value="0"> </el-option> |
| | | <el-option label="æ¯" :value="1"> </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦å¯ç¨" prop="isUse"> |
| | | <el-select |
| | | v-model="addForm.isUse" |
| | | size="small" |
| | | clearable |
| | | placeholder="è¯·éæ©" |
| | | style="width: 100%" |
| | | > |
| | | <el-option label="å¦" :value="0"> </el-option> |
| | | <el-option label="æ¯" :value="1"> </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="addDlog = false">å æ¶</el-button> |
| | | <el-button |
| | | :loading="addLoading" |
| | | type="primary" |
| | | @click="submitProduct('addForm')" |
| | | >确 认</el-button |
| | | > |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import { |
| | | selectStandardMethodList, |
| | | getStandardTree2, |
| | | delStandardMethod, |
| | | addStandardMethod, |
| | | upStandardMethod, |
| | | } from "@/api/cnas/process/method/standardMethod"; |
| | | export default { |
| | | components: { |
| | | limsTable, |
| | | }, |
| | | data() { |
| | | return { |
| | | addPower: true, |
| | | title: "æ°å¢", |
| | | inPower: true, |
| | | queryParams: {}, |
| | | tableData: [], |
| | | column: [ |
| | | { label: "é¢å", prop: "field", width: "100px" }, |
| | | { label: "æ åç¼å·", prop: "code", width: "100px" }, |
| | | { label: "æ£éªå¯¹è±¡", prop: "structureTestObjectId", width: "140px" }, |
| | | { label: "æ åæè¿°", prop: "name", width: "100px" }, |
| | | { label: "æ åæè¿°EN", prop: "nameEn", width: "100px" }, |
| | | { label: "夿³¨", prop: "remark" }, |
| | | { label: "èµè´¨", prop: "qualificationId" }, |
| | | { |
| | | label: "æ¯å¦äº§åæ å", |
| | | prop: "isProduct", |
| | | width: "100px", |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | if (params == 0) { |
| | | return "å¦"; |
| | | } else { |
| | | return "æ¯"; |
| | | } |
| | | }, |
| | | formatType: (params) => { |
| | | if (params == 0) { |
| | | return "danger"; |
| | | } else { |
| | | return "primary"; |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | label: "æ¯å¦å¯ç¨", |
| | | prop: "isUse", |
| | | formatData: (params) => { |
| | | if (params == 0) { |
| | | return "å¦"; |
| | | } else { |
| | | return "æ¯"; |
| | | } |
| | | }, |
| | | formatType: (params) => { |
| | | if (params == 0) { |
| | | return "danger"; |
| | | } else { |
| | | return "primary"; |
| | | } |
| | | }, |
| | | }, |
| | | { label: "å建人", prop: "createUserName" }, |
| | | { label: "å建æ¶é´", prop: "createTime" }, |
| | | { label: "æ´æ°äºº", prop: "updateUserName" }, |
| | | { label: "æ´æ°æ¶é´", prop: "updateTime" }, |
| | | { |
| | | dataType: "action", |
| | | fixed: "right", |
| | | label: "æä½", |
| | | width: "120px", |
| | | operation: [ |
| | | { |
| | | name: "ç¼è¾", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.title = "ç¼è¾"; |
| | | this.addForm = row; |
| | | this.addForm.structureTestObjectId = JSON.parse( |
| | | this.addForm.structureTestObjectId |
| | | ); |
| | | this.addDlog = true; |
| | | }, |
| | | }, |
| | | { |
| | | name: "å é¤", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleDelete(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 1, |
| | | }, |
| | | tableLoading: false, |
| | | addForm: {}, |
| | | addDlog: false, |
| | | addLoading: false, |
| | | qualificationList: [], |
| | | tandardTree: [], |
| | | addRules: { |
| | | code: [{ required: true, message: "请è¾å
¥æ åç¼å·", trigger: "blur" }], |
| | | name: [{ required: true, message: "请è¾å
¥æ åæè¿°", trigger: "blur" }], |
| | | nameEn: [ |
| | | { required: true, message: "请è¾å
¥æ åæè¿°EN", trigger: "blur" }, |
| | | ], |
| | | isProduct: [ |
| | | { required: true, message: "è¯·éæ©æ¯å¦äº§åæ å", trigger: "change" }, |
| | | ], |
| | | isUse: [ |
| | | { required: true, message: "è¯·éæ©æ¯å¦å¯ç¨", trigger: "change" }, |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.getQualificationList(); |
| | | this.selectTestObjectByName(); |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | getList() { |
| | | this.tableLoading = true; |
| | | let param = { ...this.queryParams, ...this.page }; |
| | | delete param.total; |
| | | selectStandardMethodList({ ...param }) |
| | | .then((res) => { |
| | | this.tableLoading = false; |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.records; |
| | | this.page.total = res.data.total; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | this.tableLoading = false; |
| | | }); |
| | | }, |
| | | pagination({ page, limit }) { |
| | | this.page.current = page; |
| | | this.page.size = limit; |
| | | this.getList(); |
| | | }, |
| | | refreshTable() { |
| | | this.page.current = 1; |
| | | this.getList(); |
| | | this.selectTestObjectByName(); |
| | | }, |
| | | refresh() { |
| | | this.selectTestObjectByName(); |
| | | this.page.current = 1; |
| | | this.queryParams = {}; |
| | | this.getList(); |
| | | }, |
| | | // æéåé
|
| | | getPower() { |
| | | let power = JSON.parse(sessionStorage.getItem("power")); |
| | | let up = false; |
| | | let del = false; |
| | | let add = false; |
| | | let inPower = false; |
| | | for (var i = 0; i < power.length; i++) { |
| | | if (power[i].menuMethod == "addStandardMethod") { |
| | | add = true; |
| | | } |
| | | if (power[i].menuMethod == "delStandardMethod") { |
| | | del = true; |
| | | } |
| | | if (power[i].menuMethod == "upStandardMethod") { |
| | | up = true; |
| | | } |
| | | if (power[i].menuMethod == "importStandardDetails") { |
| | | inPower = true; |
| | | } |
| | | } |
| | | this.addPower = add; |
| | | this.inPower = inPower; |
| | | }, |
| | | openAdd() { |
| | | this.title = "æ°å¢"; |
| | | this.addForm = {}; |
| | | this.addDlog = true; |
| | | }, |
| | | getQualificationList() { |
| | | this.getDicts("cnas_method_qualification").then((response) => { |
| | | let arr = response.data.map((m) => { |
| | | return { |
| | | label: m.dictLabel, |
| | | value: m.dictValue, |
| | | }; |
| | | }); |
| | | this.qualificationList = arr; |
| | | }); |
| | | }, |
| | | selectTestObjectByName() { |
| | | getStandardTree2().then((res) => { |
| | | res.data.forEach((a) => { |
| | | this.cascaderFieldData(a); |
| | | }); |
| | | this.tandardTree = res.data; |
| | | }); |
| | | }, |
| | | cascaderFieldData(val) { |
| | | if (val.children === undefined) { |
| | | return; |
| | | } else if (val.children.length == 0) { |
| | | delete val.children; |
| | | } else { |
| | | val.children.forEach((a) => { |
| | | this.cascaderFieldData(a); |
| | | }); |
| | | } |
| | | }, |
| | | submitProduct(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | this.addLoading = true; |
| | | let addForm = JSON.parse(JSON.stringify(this.addForm)); |
| | | addForm.structureTestObjectId = JSON.stringify( |
| | | addForm.structureTestObjectId |
| | | ); |
| | | if (this.title == "æ°å¢") { |
| | | addStandardMethod(addForm) |
| | | .then((res) => { |
| | | this.addLoading = false; |
| | | if (res.code != 200) { |
| | | return; |
| | | } |
| | | this.$message.success("æäº¤æå"); |
| | | this.getList(); |
| | | this.addDlog = false; |
| | | }) |
| | | .catch((err) => { |
| | | this.addLoading = false; |
| | | }); |
| | | } else { |
| | | upStandardMethod(addForm) |
| | | .then((res) => { |
| | | this.addLoading = false; |
| | | if (res.code != 200) { |
| | | return; |
| | | } |
| | | this.$message.success("æäº¤æå"); |
| | | this.getList(); |
| | | this.addDlog = false; |
| | | }) |
| | | .catch((err) => { |
| | | this.addLoading = false; |
| | | }); |
| | | } |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }, |
| | | handleDelete(row) { |
| | | this.$confirm("æ¯å¦å é¤è¯¥æ¡æ°æ®?", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | delStandardMethod({ id: row.id }).then((res) => { |
| | | if (res.code == 201) return; |
| | | this.$message.success("å 餿å"); |
| | | this.getList(); |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | <el-button |
| | | size="small" |
| | | type="primary" |
| | | v-if="listPower" |
| | | v-if="checkPermi(['performance:class:time'])" |
| | | @click="configTime" |
| | | :loading="downLoading" |
| | | >æ¶é´é
ç½®</el-button |
| | | > |
| | | <el-button |
| | | size="small" |
| | | type="primary" |
| | | v-if="downPower" |
| | | v-if="checkPermi(['performance:class:down'])" |
| | | @click="handleDown" |
| | | :loading="downLoading" |
| | | >导 åº</el-button |
| | |
| | | size="small" |
| | | type="primary" |
| | | @click="schedulingVisible = true" |
| | | v-if="addPower" |
| | | v-if="checkPermi(['performance:class:add'])" |
| | | >æ ç</el-button |
| | | > |
| | | </div> |
| | |
| | | v-on:mouseenter="onMouseEnter(index)" |
| | | v-on:mouseleave="currentUserIndex = null" |
| | | > |
| | | <div class="user-pic">{{ item.name.charAt(0) }}</div> |
| | | <div class="user-pic"> |
| | | {{ item.name ? item.name.charAt(0) : "" }} |
| | | </div> |
| | | <div class="user-info"> |
| | | <p style="font-size: 14px; color: #3a7bfa; line-height: 24px"> |
| | | <p |
| | | style=" |
| | | font-size: 14px; |
| | | color: #3a7bfa; |
| | | line-height: 24px; |
| | | margin: 0; |
| | | " |
| | | > |
| | | {{ item.name }} |
| | | </p> |
| | | <p |
| | |
| | | white-space: nowrap; |
| | | width: 150px; |
| | | overflow-x: show; |
| | | margin: 0; |
| | | " |
| | | > |
| | | æ©:{{ item.day0 }},ä¸:{{ item.day1 }},å¤:{{ item.day2 }},ä¼:{{ |
| | | item.day3 |
| | | }},å:{{ item.day4 }},å·®:{{ item.day6 }} |
| | | </p> |
| | | <p style="margin-top: 4px"> |
| | | <p style="margin-top: 4px; margin: 0"> |
| | | <span |
| | | style=" |
| | | color: #999999; |
| | |
| | | > |
| | | <span |
| | | class="month" |
| | | style="position: absolute; top: 4px" |
| | | style="position: absolute; top: 0px" |
| | | v-if="item.week == '卿¥'" |
| | | >{{ item.weekNum }}å¨</span |
| | | > |
| | |
| | | trigger="click" |
| | | placement="bottom" |
| | | @command="(e) => handleCommand(e, m)" |
| | | :disabled="!upPower" |
| | | :disabled="!checkPermi(['performance:class:edit'])" |
| | | style="width: 100%; height: 100%; cursor: pointer" |
| | | > |
| | | <div |
| | |
| | | <el-dropdown-item |
| | | v-for="(n, j) in classType" |
| | | :key="'h' + j" |
| | | :command="n.value" |
| | | >{{ n.label }}</el-dropdown-item |
| | | :command="n.dictValue" |
| | | >{{ n.dictLabel }}</el-dropdown-item |
| | | > |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | |
| | | v-on:mouseenter="onMouseEnter(index)" |
| | | v-on:mouseleave="currentUserIndex = null" |
| | | > |
| | | <div class="user-pic">{{ item.name.charAt(0) }}</div> |
| | | <div class="user-pic"> |
| | | {{ item.name ? item.name.charAt(0) : "" }} |
| | | </div> |
| | | <div class="user-info"> |
| | | <p style="font-size: 14px; color: #3a7bfa; line-height: 24px"> |
| | | <p |
| | | style=" |
| | | font-size: 14px; |
| | | color: #3a7bfa; |
| | | line-height: 24px; |
| | | margin: 0; |
| | | " |
| | | > |
| | | {{ item.name }} |
| | | </p> |
| | | <p |
| | |
| | | white-space: nowrap; |
| | | width: 150px; |
| | | overflow-x: show; |
| | | margin: 0; |
| | | " |
| | | > |
| | | æ©:{{ item.day0 }},ä¸:{{ item.day1 }},å¤:{{ item.day2 }},ä¼:{{ |
| | | item.day3 |
| | | }},å:{{ item.day4 }},å·®:{{ item.day6 }} |
| | | </p> |
| | | <p style="margin-top: 4px"> |
| | | <p style="margin-top: 4px; margin: 0"> |
| | | <span |
| | | style=" |
| | | color: #999999; |
| | |
| | | > |
| | | <el-option |
| | | v-for="obj in timeTypeList" |
| | | :key="obj.value" |
| | | :label="obj.label" |
| | | :value="obj.value" |
| | | :key="obj.dictValue" |
| | | :label="obj.dictLabel" |
| | | :value="obj.dictValue" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | > |
| | | <el-option |
| | | v-for="item in classType" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | :key="item.dictValue" |
| | | :label="item.dictLabel" |
| | | :value="item.dictValue" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | |
| | | exportFile, |
| | | obtainItemParameterList, |
| | | update, |
| | | selectUserList, |
| | | selectUserCondition, |
| | | } from "@/api/performance/class"; |
| | | export default { |
| | | data() { |
| | | return { |
| | | addPower: true, |
| | | upPower: true, |
| | | downPower: true, |
| | | query: { |
| | | userName: "", |
| | | laboratory: "", |
| | |
| | | configTimeVisibleLoading: false, // æ¶é´é
置弹æ¡loading |
| | | timeTypeList: [], |
| | | timeQuery: [], |
| | | listPower: false, |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | this.monthList.push(i); |
| | | } |
| | | this.monthList.reverse(); |
| | | this.getPower(); |
| | | // this.getPower(); |
| | | }, |
| | | methods: { |
| | | refresh() { |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | getPower() { |
| | | let power = JSON.parse(sessionStorage.getItem("power")); |
| | | let add = false; |
| | | let up = false; |
| | | let down = false; |
| | | let listPower = false; |
| | | for (var i = 0; i < power.length; i++) { |
| | | if (power[i].menuMethod == "performanceShiftUpdate") { |
| | | up = true; |
| | | } |
| | | if (power[i].menuMethod == "delDeviceParameter") { |
| | | down = true; |
| | | } |
| | | if (power[i].menuMethod == "performanceShiftAdd") { |
| | | add = true; |
| | | } |
| | | if (power[i].menuMethod == "shiftTimeList") { |
| | | listPower = true; |
| | | } |
| | | } |
| | | this.addPower = add; |
| | | this.upPower = up; |
| | | this.downPower = down; |
| | | this.listPower = listPower; |
| | | }, |
| | | onMouseEnter(index) { |
| | | this.currentUserIndex = index; |
| | | }, |
| | |
| | | endWeek, |
| | | userId: this.schedulingQuery.userId.join(","), |
| | | shift: this.schedulingQuery.shift, |
| | | }).then((res) => { |
| | | this.loading = false; |
| | | if (res.code == 201) return; |
| | | this.$message.success("æä½æå"); |
| | | this.schedulingVisible = false; |
| | | this.schedulingQuery = { |
| | | week: "", |
| | | userId: null, |
| | | shift: "", |
| | | }; |
| | | this.refresh(); |
| | | }); |
| | | }) |
| | | .then((res) => { |
| | | this.loading = false; |
| | | if (res.code == 201) return; |
| | | this.$message.success("æä½æå"); |
| | | this.schedulingVisible = false; |
| | | this.schedulingQuery = { |
| | | week: "", |
| | | userId: null, |
| | | shift: "", |
| | | }; |
| | | this.refresh(); |
| | | }) |
| | | .catch((err) => { |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | configTime() { |
| | | this.getDicts("sys_class_type").then((response) => { |
| | |
| | | res.data.forEach((item) => { |
| | | item.isEdit = false; |
| | | const index = this.timeTypeList.findIndex( |
| | | (val) => val.value === item.shift |
| | | (val) => val.dictValue === item.shift |
| | | ); |
| | | if (index > -1) { |
| | | item.type = this.timeTypeList[index].label; |
| | | item.type = this.timeTypeList[index].dictLabel; |
| | | } |
| | | }); |
| | | this.timeQuery = res.data; |
| | |
| | | saveEdit(item, index) { |
| | | if (item.shift) { |
| | | const index = this.timeTypeList.findIndex( |
| | | (val) => val.value === item.shift |
| | | (val) => val.dictValue === item.shift |
| | | ); |
| | | if (index > -1) { |
| | | item.type = this.timeTypeList[index].label; |
| | | item.type = this.timeTypeList[index].dictLabel; |
| | | } |
| | | } |
| | | delete item.orderBy; |
| | |
| | | userName: this.query.userName, |
| | | laboratory: this.query.laboratory, |
| | | isMonth: this.query.month ? true : false, |
| | | }).then((res) => { |
| | | this.$message.success("ä¸è½½æå"); |
| | | this.downLoading = false; |
| | | const blob = new Blob([res], { |
| | | type: "application/force-download", |
| | | }) |
| | | .then((res) => { |
| | | this.$message.success("ä¸è½½æå"); |
| | | this.downLoading = false; |
| | | const blob = new Blob([res], { |
| | | type: "application/force-download", |
| | | }); |
| | | let fileName = ""; |
| | | if (this.query.month) { |
| | | fileName = year + "-" + this.query.month + " çæ¬¡ä¿¡æ¯"; |
| | | } else { |
| | | fileName = year + " çæ¬¡æ±æ»"; |
| | | } |
| | | this.$download.saveAs(blob, fileName + ".xlsx"); |
| | | }) |
| | | .catch((err) => { |
| | | this.downLoading = false; |
| | | }); |
| | | let fileName = ""; |
| | | if (this.query.month) { |
| | | fileName = year + "-" + this.query.month + " çæ¬¡ä¿¡æ¯"; |
| | | } else { |
| | | fileName = year + " çæ¬¡æ±æ»"; |
| | | } |
| | | this.$download.saveAs(blob, fileName + ".xlsx"); |
| | | }); |
| | | }, |
| | | selectEnumByCategory() { |
| | | this.getDicts("sys_class_type").then((response) => { |
| | |
| | | } |
| | | }, |
| | | getUsers() { |
| | | selectUserList({ |
| | | current: -1, |
| | | size: -1, |
| | | }).then((res) => { |
| | | selectUserCondition().then((res) => { |
| | | if (res.code === 201) { |
| | | return; |
| | | } |
| | | let arr = res.data.body.records; |
| | | let arr = res.data; |
| | | this.personList = arr; |
| | | }); |
| | | }, |
| | | getDayByDic(e) { |
| | | let obj = this.classType.find((m) => m.label == e); |
| | | let obj = this.classType.find((m) => m.dictLabel == e); |
| | | if (obj) { |
| | | return obj.value; |
| | | return obj.dictValue; |
| | | } |
| | | }, |
| | | getShiftByDic(e) { |
| | | let obj = this.classType.find((m) => m.value == e); |
| | | let obj = this.classType.find((m) => m.dictValue == e); |
| | | if (obj) { |
| | | return obj.label; |
| | | return obj.dictLabel; |
| | | } |
| | | return "æ "; |
| | | }, |
| | | scrollInit() { |
| | | // è·åè¦ç»å®äºä»¶çå
ç´ |
| | | const nav = document.getElementById("nav"); |
| | | var flag; // é¼ æ æä¸ |
| | | var downX; // é¼ æ ç¹å»çx䏿 |
| | | var scrollLeft; // å½åå
ç´ æ»å¨æ¡çåç§»é |
| | | nav.addEventListener("mousedown", function (event) { |
| | | flag = true; |
| | | downX = event.clientX; // è·åå°ç¹å»çx䏿 |
| | | scrollLeft = this.scrollLeft; // è·åå½åå
ç´ æ»å¨æ¡çåç§»é |
| | | }); |
| | | nav.addEventListener("mousemove", function (event) { |
| | | if (flag) { |
| | | // 夿æ¯å¦æ¯é¼ æ æä¸æ»å¨å
ç´ åºå |
| | | var moveX = event.clientX; // è·åç§»å¨çxè½´ |
| | | var scrollX = moveX - downX; // å½åç§»å¨çxè½´ä¸æ åå»åç¹å»ä¸å»çxè½´ä¸æ å¾å°é¼ æ æ»å¨è·ç¦» |
| | | this.scrollLeft = scrollLeft - scrollX; // é¼ æ æä¸çæ»å¨æ¡åç§»éåå»å½åé¼ æ çæ»å¨è·ç¦» |
| | | } |
| | | }); |
| | | // é¼ æ æ¬èµ·åæ¢æå¨ |
| | | nav.addEventListener("mouseup", function () { |
| | | flag = false; |
| | | }); |
| | | // é¼ æ 离å¼å
ç´ åæ¢æå¨ |
| | | nav.addEventListener("mouseleave", function (event) { |
| | | flag = false; |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .class-page { |
| | | padding: 10px; |
| | | } |
| | | .form_title { |
| | | height: 36px; |
| | | display: flex; |
| | |
| | | } |
| | | .center { |
| | | width: 100%; |
| | | height: calc(100% - 100px); |
| | | height: calc(100vh - 220px); |
| | | background-color: #fff; |
| | | overflow-y: auto; |
| | | display: flex; |
| | |
| | | min-height: calc(100% - 10px); /* è§å£é«åº¦ */ |
| | | } |
| | | .content-title { |
| | | height: 52px; |
| | | line-height: 52px; |
| | | height: 58px; |
| | | line-height: 58px; |
| | | border-bottom: 1px solid #eeeeee; |
| | | } |
| | | .content-title-right { |
| | |
| | | .content-title-item .day { |
| | | font-size: 14px; |
| | | color: #333333; |
| | | margin-right: 4px; |
| | | } |
| | | .content-title-item .week { |
| | | font-size: 12px; |