| ¶Ô±ÈÐÂÎļþ |
| | |
| | | // åæ°ç»´æ¤é¡µé¢æ¥å£ |
| | | import request from "@/utils/request"; |
| | | |
| | | // æ¥è¯¢åæ°å表 |
| | | export function parameterListPage(query) { |
| | | return request({ |
| | | url: "/basic/parameter/listPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢åæ° |
| | | export function addParameter(data) { |
| | | return request({ |
| | | url: "/basic/parameter/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ç¼è¾åæ° |
| | | export function updateParameter(data) { |
| | | return request({ |
| | | url: "/basic/parameter/update", |
| | | method: "put", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // å é¤åæ° |
| | | export function delParameter(ids) { |
| | | return request({ |
| | | url: "/basic/parameter/del", |
| | | method: "delete", |
| | | data: Array.isArray(ids) ? ids : [ids], |
| | | }); |
| | | } |
| | | |
| | | // è·å产åç±»åå表 |
| | | export function getProductTypes() { |
| | | return request({ |
| | | url: "/basic/product/typeList", |
| | | method: "get", |
| | | }); |
| | | } |
| | | |
| | | // æ°å¢åºç¡åæ° |
| | | export function addBaseParam(data) { |
| | | return request({ |
| | | url: "/technologyParam/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ç¼è¾åºç¡åæ° |
| | | export function editBaseParam(data) { |
| | | return request({ |
| | | url: "/technologyParam/edit", |
| | | method: "put", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // æ¥è¯¢åºç¡åæ°å表 |
| | | export function getBaseParamList(query) { |
| | | return request({ |
| | | url: "/technologyParam/list", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // å é¤åºç¡åæ° |
| | | export function removeBaseParam(ids) { |
| | | return request({ |
| | | url: `/technologyParam/remove/` + ids, |
| | | method: "delete", |
| | | }); |
| | | } |
| | |
| | | method: "delete", |
| | | }); |
| | | } |
| | | // è·åå·¥åºåæ°å表 |
| | | export function getProcessParamList(query) { |
| | | return request({ |
| | | url: `/ProcessRouteItemParam/pageList`, |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | // å·¥èºè·¯çº¿åæ°æ°å¢ |
| | | export function addProcessRouteItemParam(data) { |
| | | return request({ |
| | | url: "/ProcessRouteItemParam/save", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | // å·¥èºè·¯çº¿åæ°ä¿®æ¹ |
| | | export function editProcessRouteItemParam(data) { |
| | | return request({ |
| | | url: "/ProcessRouteItemParam/edit", |
| | | method: "put", |
| | | data: data, |
| | | }); |
| | | } |
| | | // å·¥èºè·¯çº¿åæ°å é¤ |
| | | export function delProcessRouteItemParam(id) { |
| | | return request({ |
| | | url: `/ProcessRouteItemParam/remove/${id}`, |
| | | method: "delete", |
| | | }); |
| | | } |
| | |
| | | data, |
| | | }); |
| | | } |
| | | // è·åå·¥åºåæ°å表-ç产订å |
| | | export function findProcessParamListOrder(query) { |
| | | return request({ |
| | | url: `/productionOrderRouteItemParam/list`, |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | // å·¥èºè·¯çº¿åæ°æ°å¢-ç产订å |
| | | export function addProcessRouteItemParamOrder(data) { |
| | | return request({ |
| | | url: "/productionOrderRouteItemParam/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | // å·¥èºè·¯çº¿åæ°ä¿®æ¹-ç产订å |
| | | export function editProcessRouteItemParamOrder(data) { |
| | | return request({ |
| | | url: "/productionOrderRouteItemParam/update", |
| | | method: "put", |
| | | data: data, |
| | | }); |
| | | } |
| | | // å·¥èºè·¯çº¿åæ°å é¤-ç产订å |
| | | export function delProcessRouteItemParamOrder(id) { |
| | | return request({ |
| | | url: `/productionOrderRouteItemParam/delete/${id}`, |
| | | method: "delete", |
| | | }); |
| | | } |
| | |
| | | method: "get", |
| | | }); |
| | | } |
| | | |
| | | export function add(data) { |
| | | return request({ |
| | | url: "/productStructure", |
| | | url: "/productStructure/" + data.bomId, |
| | | method: "post", |
| | | data: data, |
| | | data: data.children, |
| | | }); |
| | | } |
| | | |
| | | // export function add(data) { |
| | | // return request({ |
| | | // url: "/productStructure", |
| | | // method: "post", |
| | | // data: data, |
| | | // }); |
| | | // } |
| | | // å页æ¥è¯¢-产å订å |
| | | export function queryList2(id) { |
| | | return request({ |
| | | url: "/productionOrderStructure/getBomStructs/" + id, |
| | | method: "get", |
| | | }); |
| | | } |
| | | |
| | | export function add2(data) { |
| | | return request({ |
| | | url: "/productionOrderStructure/addOrUpdateBomStructs/" + data.orderId, |
| | | method: "put", |
| | | data: data.children, |
| | | }); |
| | | } |
| | |
| | | |
| | | export function processList(query) { |
| | | return request({ |
| | | url: "/productProcess/list", |
| | | url: "/technologyOperation/listPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | |
| | | |
| | | export function add(data) { |
| | | return request({ |
| | | url: "/productProcess", |
| | | url: "/technologyOperation/", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | |
| | | |
| | | export function del(data) { |
| | | return request({ |
| | | url: '/productProcess/batchDelete', |
| | | method: 'delete', |
| | | url: "/technologyOperation/batchDelete", |
| | | method: "delete", |
| | | data: data, |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | export function update(data) { |
| | | return request({ |
| | | url: '/productProcess/update', |
| | | method: 'put', |
| | | url: "/technologyOperation/update", |
| | | method: "put", |
| | | data: data, |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // å·¥åºæ¥è¯¢ |
| | | export function list() { |
| | | return request({ |
| | | url: "/productProcess/list", |
| | | method: "get", |
| | | }); |
| | | export function list(query) { |
| | | return request({ |
| | | url: "/technologyOperation/listPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // 导å
¥æ°æ® |
| | |
| | | method: "post", |
| | | responseType: "blob", |
| | | }); |
| | | } |
| | | } |
| | | |
| | | // è·åå·¥åºåæ°å表 |
| | | export function getProcessParamList(processId, params) { |
| | | return request({ |
| | | url: `/productProcessParam/list/${processId}`, |
| | | method: "get", |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | // æ·»å å·¥åºåæ° |
| | | export function addProcessParam(data) { |
| | | return request({ |
| | | url: "/productProcessParam/add", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // ç¼è¾å·¥åºåæ° |
| | | export function editProcessParam(data) { |
| | | return request({ |
| | | url: "/productProcessParam/edit", |
| | | method: "put", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // å é¤å·¥åºåæ° |
| | | export function deleteProcessParam(id) { |
| | | return request({ |
| | | url: `/productProcessParam/${id}`, |
| | | method: "delete", |
| | | }); |
| | | } |
| | |
| | | <template> |
| | | <el-table |
| | | ref="multipleTable" |
| | | v-loading="tableLoading" |
| | | :border="border" |
| | | :data="tableData" |
| | | :header-cell-style="mergedHeaderCellStyle" |
| | | :height="height" |
| | | :highlight-current-row="highlightCurrentRow" |
| | | :row-class-name="rowClassName" |
| | | :row-style="rowStyle" |
| | | :row-key="rowKey" |
| | | :style="tableStyle" |
| | | tooltip-effect="dark" |
| | | :expand-row-keys="expandRowKeys" |
| | | :show-summary="isShowSummary" |
| | | :summary-method="summaryMethod" |
| | | @row-click="rowClick" |
| | | @current-change="currentChange" |
| | | @selection-change="handleSelectionChange" |
| | | @expand-change="expandChange" |
| | | class="lims-table" |
| | | > |
| | | <el-table-column |
| | | align="center" |
| | | type="selection" |
| | | width="55" |
| | | v-if="isSelection" |
| | | /> |
| | | <el-table-column align="center" label="åºå·" type="index" width="60" /> |
| | | |
| | | <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" |
| | | :prop="item.prop" |
| | | :show-overflow-tooltip="item.dataType !== 'action' && item.dataType !== 'slot'" |
| | | :align="item.align" |
| | | :sortable="!!item.sortable" |
| | | :type="item.type" |
| | | :width="item.width" |
| | | :minWidth="item.minWidth" |
| | | > |
| | | <el-table ref="multipleTable" |
| | | v-loading="tableLoading" |
| | | :border="border" |
| | | :data="tableData" |
| | | :header-cell-style="mergedHeaderCellStyle" |
| | | :height="height" |
| | | :highlight-current-row="highlightCurrentRow" |
| | | :row-class-name="rowClassName" |
| | | :row-style="rowStyle" |
| | | :row-key="rowKey" |
| | | :style="tableStyle" |
| | | tooltip-effect="dark" |
| | | :expand-row-keys="expandRowKeys" |
| | | :show-summary="isShowSummary" |
| | | :summary-method="summaryMethod" |
| | | @row-click="rowClick" |
| | | @current-change="currentChange" |
| | | @selection-change="handleSelectionChange" |
| | | @expand-change="expandChange" |
| | | class="lims-table"> |
| | | <el-table-column align="center" |
| | | type="selection" |
| | | width="55" |
| | | v-if="isSelection" /> |
| | | <el-table-column align="center" |
| | | label="åºå·" |
| | | type="index" |
| | | width="60" /> |
| | | <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" |
| | | :prop="item.prop" |
| | | :show-overflow-tooltip="item.dataType !== 'action' && item.dataType !== 'slot'" |
| | | :align="item.align" |
| | | :sortable="!!item.sortable" |
| | | :type="item.type" |
| | | :width="item.width" |
| | | :minWidth="item.minWidth"> |
| | | <template #header="scope"> |
| | | <div class="pim-table-header-cell" :class="{ 'has-extra': item.headerSlot }"> |
| | | <div class="pim-table-header-cell" |
| | | :class="{ 'has-extra': item.headerSlot }"> |
| | | <div class="pim-table-header-title"> |
| | | {{ item.label }} |
| | | </div> |
| | | <div v-if="item.headerSlot" class="pim-table-header-extra"> |
| | | <slot :name="item.headerSlot" :column="scope.column" /> |
| | | <div v-if="item.headerSlot" |
| | | class="pim-table-header-extra"> |
| | | <slot :name="item.headerSlot" |
| | | :column="scope.column" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <template |
| | | v-if="item.hasOwnProperty('colunmTemplate')" |
| | | #[item.colunmTemplate]="scope" |
| | | > |
| | | <slot |
| | | v-if="item.theadSlot" |
| | | :name="item.theadSlot" |
| | | :index="scope.$index" |
| | | :row="scope.row" |
| | | /> |
| | | <template v-if="item.hasOwnProperty('colunmTemplate')" |
| | | #[item.colunmTemplate]="scope"> |
| | | <slot v-if="item.theadSlot" |
| | | :name="item.theadSlot" |
| | | :index="scope.$index" |
| | | :row="scope.row" /> |
| | | </template> |
| | | |
| | | <template #default="scope"> |
| | | <!-- ææ§½ --> |
| | | <div v-if="item.dataType == 'slot'"> |
| | | <slot |
| | | v-if="item.slot" |
| | | :index="scope.$index" |
| | | :name="item.slot" |
| | | :row="scope.row" |
| | | /> |
| | | <slot v-if="item.slot" |
| | | :index="scope.$index" |
| | | :name="item.slot" |
| | | :row="scope.row" /> |
| | | </div> |
| | | <!-- è¿åº¦æ¡ --> |
| | | <div v-else-if="item.dataType == 'progress'"> |
| | |
| | | </div> |
| | | <!-- å¾ç --> |
| | | <div v-else-if="item.dataType == 'image'"> |
| | | <img |
| | | :src="javaApi + '/img/' + scope.row[item.prop]" |
| | | alt="" |
| | | style="width: 40px; height: 40px; margin-top: 10px" |
| | | /> |
| | | <img :src="javaApi + '/img/' + scope.row[item.prop]" |
| | | alt="" |
| | | style="width: 40px; height: 40px; margin-top: 10px" /> |
| | | </div> |
| | | |
| | | <!-- tag --> |
| | | <div v-else-if="item.dataType == 'tag'"> |
| | | <el-tag |
| | | v-if=" |
| | | <el-tag v-if=" |
| | | typeof dataTypeFn(scope.row[item.prop], item.formatData) === |
| | | 'string' |
| | | " |
| | | :title="formatters(scope.row[item.prop], item.formatData)" |
| | | :type="formatType(scope.row[item.prop], item.formatType)" |
| | | > |
| | | :title="formatters(scope.row[item.prop], item.formatData)" |
| | | :type="formatType(scope.row[item.prop], item.formatType)"> |
| | | {{ formatters(scope.row[item.prop], item.formatData) }} |
| | | </el-tag> |
| | | |
| | | <el-tag |
| | | v-for="(tag, index) in dataTypeFn( |
| | | <el-tag v-for="(tag, index) in dataTypeFn( |
| | | scope.row[item.prop], |
| | | item.formatData |
| | | )" |
| | | v-else-if=" |
| | | v-else-if=" |
| | | typeof dataTypeFn(scope.row[item.prop], item.formatData) === |
| | | 'object' |
| | | " |
| | | :key="index" |
| | | :title="formatters(scope.row[item.prop], item.formatData)" |
| | | :type="formatType(tag, item.formatType)" |
| | | > |
| | | :key="index" |
| | | :title="formatters(scope.row[item.prop], item.formatData)" |
| | | :type="formatType(tag, item.formatType)"> |
| | | {{ item.tagGroup ? tag[item.tagGroup.label] ?? tag : tag }} |
| | | </el-tag> |
| | | |
| | | <el-tag |
| | | v-else |
| | | :title="formatters(scope.row[item.prop], item.formatData)" |
| | | :type="formatType(scope.row[item.prop], item.formatType)" |
| | | > |
| | | <el-tag v-else |
| | | :title="formatters(scope.row[item.prop], item.formatData)" |
| | | :type="formatType(scope.row[item.prop], item.formatType)"> |
| | | {{ formatters(scope.row[item.prop], item.formatData) }} |
| | | </el-tag> |
| | | </div> |
| | | |
| | | <!-- æé® --> |
| | | <div v-else-if="item.dataType == 'action'" @click.stop> |
| | | <template v-for="(o, key) in item.operation" :key="key"> |
| | | <el-button |
| | | v-show="o.type != 'upload'" |
| | | v-if="o.showHide ? o.showHide(scope.row) : true" |
| | | :disabled="isOperationDisabled(o, scope.row)" |
| | | :plain="o.plain" |
| | | type="primary" |
| | | :style="{ |
| | | <div v-else-if="item.dataType == 'action'" |
| | | @click.stop> |
| | | <template v-for="(o, key) in item.operation" |
| | | :key="key"> |
| | | <el-button v-show="o.type != 'upload'" |
| | | v-if="o.showHide ? o.showHide(scope.row) : true" |
| | | :disabled="isOperationDisabled(o, scope.row)" |
| | | :plain="o.plain" |
| | | type="primary" |
| | | :style="{ |
| | | color: getOperationColor(o, scope.row), |
| | | fontWeight: 'bold', |
| | | }" |
| | | link |
| | | @click.stop="o.clickFun(scope.row)" |
| | | :key="key" |
| | | > |
| | | link |
| | | @click.stop="o.clickFun(scope.row)" |
| | | :key="key"> |
| | | {{ o.name }} |
| | | </el-button> |
| | | <el-upload |
| | | :action=" |
| | | <el-upload :action=" |
| | | javaApi + |
| | | o.url + |
| | | '?id=' + |
| | | (o.uploadIdFun ? o.uploadIdFun(scope.row) : scope.row.id) |
| | | " |
| | | ref="uploadRef" |
| | | :multiple="o.multiple ? o.multiple : false" |
| | | :limit="1" |
| | | :disabled="isOperationDisabled(o, scope.row)" |
| | | :accept=" |
| | | ref="uploadRef" |
| | | :multiple="o.multiple ? o.multiple : false" |
| | | :limit="1" |
| | | :disabled="isOperationDisabled(o, scope.row)" |
| | | :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" |
| | | :headers="uploadHeader" |
| | | :before-upload="(file) => beforeUpload(file, scope.$index)" |
| | | :on-change=" |
| | | v-if="o.type == 'upload'" |
| | | style="display: inline-block; width: 50px" |
| | | v-show="o.showHide ? o.showHide(scope.row) : true" |
| | | :headers="uploadHeader" |
| | | :before-upload="(file) => beforeUpload(file, scope.$index)" |
| | | :on-change=" |
| | | (file, fileList) => handleChange(file, fileList, scope.$index) |
| | | " |
| | | :on-error=" |
| | | :on-error=" |
| | | (error, file, fileList) => |
| | | onError(error, file, fileList, scope.$index) |
| | | " |
| | | :on-success=" |
| | | :on-success=" |
| | | (response, file, fileList) => |
| | | handleSuccessUp(response, file, fileList, scope.$index) |
| | | " |
| | | :on-exceed="onExceed" |
| | | :show-file-list="false" |
| | | > |
| | | <el-button |
| | | link |
| | | type="primary" |
| | | :disabled="isOperationDisabled(o, scope.row)" |
| | | :style="{ |
| | | :on-exceed="onExceed" |
| | | :show-file-list="false"> |
| | | <el-button link |
| | | type="primary" |
| | | :disabled="isOperationDisabled(o, scope.row)" |
| | | :style="{ |
| | | color: getOperationColor(o, scope.row), |
| | | }" |
| | | >{{ o.name }}</el-button |
| | | > |
| | | }">{{ o.name }}</el-button> |
| | | </el-upload> |
| | | </template> |
| | | </div> |
| | | <!-- å¯ç¹å»çæå --> |
| | | <div |
| | | v-else-if="item.dataType == 'link'" |
| | | class="cell link" |
| | | style="width: 100%" |
| | | @click="goLink(scope.row, item.linkMethod)" |
| | | > |
| | | <div v-else-if="item.dataType == 'link'" |
| | | class="cell link" |
| | | style="width: 100%" |
| | | @click="goLink(scope.row, item.linkMethod)"> |
| | | <span v-if="!item.formatData">{{ scope.row[item.prop] }}</span> |
| | | </div> |
| | | <!-- é»è®¤çº¯å±ç¤ºæ°æ® --> |
| | | <div v-else class="cell" style="width: 100%"> |
| | | <div v-else |
| | | class="cell" |
| | | style="width: 100%"> |
| | | <span v-if="!item.formatData">{{ scope.row[item.prop] }}</span> |
| | | <span v-else>{{ |
| | | formatters(scope.row[item.prop], item.formatData) |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | v-if="isShowPagination" |
| | | :total="page.total" |
| | | :layout="page.layout" |
| | | :page="page.current" |
| | | :limit="page.size" |
| | | @pagination="paginationSearch" |
| | | /> |
| | | <pagination v-if="isShowPagination" |
| | | :total="page.total" |
| | | :layout="page.layout" |
| | | :page="page.current" |
| | | :limit="page.size" |
| | | @pagination="paginationSearch" /> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import pagination from "./Pagination.vue"; |
| | | import { computed, ref, inject, getCurrentInstance } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import pagination from "./Pagination.vue"; |
| | | import { computed, ref, inject, getCurrentInstance } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | |
| | | // è·åå
¨å±ç uploadHeader |
| | | const { proxy } = getCurrentInstance(); |
| | | const uploadHeader = proxy.uploadHeader; |
| | | const javaApi = proxy.javaApi; |
| | | // è·åå
¨å±ç uploadHeader |
| | | const { proxy } = getCurrentInstance(); |
| | | const uploadHeader = proxy.uploadHeader; |
| | | const javaApi = proxy.javaApi; |
| | | |
| | | const emit = defineEmits(["pagination", "expand-change", "selection-change", "row-click"]); |
| | | const emit = defineEmits([ |
| | | "pagination", |
| | | "expand-change", |
| | | "selection-change", |
| | | "row-click", |
| | | ]); |
| | | |
| | | // Filters |
| | | const typeFn = (val, row) => { |
| | | return typeof val === "function" ? val(row) : val; |
| | | }; |
| | | // Filters |
| | | const typeFn = (val, row) => { |
| | | return typeof val === "function" ? val(row) : val; |
| | | }; |
| | | |
| | | const formatters = (val, format) => { |
| | | return typeof format === "function" ? format(val) : val; |
| | | }; |
| | | const formatters = (val, format) => { |
| | | return typeof format === "function" ? format(val) : val; |
| | | }; |
| | | |
| | | // Propsï¼ä½¿ç¨ defineProps çé TS å½¢å¼ï¼ |
| | | const props = defineProps({ |
| | | tableLoading: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | height: { |
| | | type: [Number, String], |
| | | default: "calc(100vh - 22em)", |
| | | }, |
| | | expandRowKeys: { |
| | | type: Array, |
| | | default: () => [], |
| | | }, |
| | | summaryMethod: { |
| | | type: Function, |
| | | default: () => {}, |
| | | }, |
| | | rowClick: { |
| | | type: Function, |
| | | default: () => {}, |
| | | }, |
| | | currentChange: { |
| | | type: Function, |
| | | default: () => {}, |
| | | }, |
| | | border: { |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | isSelection: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | isShowPagination: { |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | isShowSummary: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | highlightCurrentRow: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | headerCellStyle: { |
| | | type: Object, |
| | | default: () => ({}), |
| | | }, |
| | | column: { |
| | | type: Array, |
| | | default: () => [], |
| | | }, |
| | | rowClassName: { |
| | | type: Function, |
| | | default: () => "", |
| | | }, |
| | | rowStyle: { |
| | | type: [Object, Function], |
| | | default: () => ({}), |
| | | }, |
| | | tableData: { |
| | | type: Array, |
| | | default: () => [], |
| | | }, |
| | | rowKey: { |
| | | type: String, |
| | | default: 'id', |
| | | }, |
| | | page: { |
| | | type: Object, |
| | | default: () => ({ |
| | | total: 0, |
| | | current: 0, |
| | | size: 10, |
| | | layout: "total, sizes, prev, pager, next, jumper", |
| | | }), |
| | | }, |
| | | total: { |
| | | type: Number, |
| | | default: 0, |
| | | }, |
| | | tableStyle: { |
| | | type: [String, Object], |
| | | default: () => ({ width: "100%" }), |
| | | }, |
| | | }); |
| | | // Propsï¼ä½¿ç¨ defineProps çé TS å½¢å¼ï¼ |
| | | const props = defineProps({ |
| | | tableLoading: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | height: { |
| | | type: [Number, String], |
| | | default: "calc(100vh - 22em)", |
| | | }, |
| | | expandRowKeys: { |
| | | type: Array, |
| | | default: () => [], |
| | | }, |
| | | summaryMethod: { |
| | | type: Function, |
| | | default: () => {}, |
| | | }, |
| | | rowClick: { |
| | | type: Function, |
| | | default: () => {}, |
| | | }, |
| | | currentChange: { |
| | | type: Function, |
| | | default: () => {}, |
| | | }, |
| | | border: { |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | isSelection: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | isShowPagination: { |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | isShowSummary: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | highlightCurrentRow: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | headerCellStyle: { |
| | | type: Object, |
| | | default: () => ({}), |
| | | }, |
| | | column: { |
| | | type: Array, |
| | | default: () => [], |
| | | }, |
| | | rowClassName: { |
| | | type: Function, |
| | | default: () => "", |
| | | }, |
| | | rowStyle: { |
| | | type: [Object, Function], |
| | | default: () => ({}), |
| | | }, |
| | | tableData: { |
| | | type: Array, |
| | | default: () => [], |
| | | }, |
| | | rowKey: { |
| | | type: String, |
| | | default: "id", |
| | | }, |
| | | page: { |
| | | type: Object, |
| | | default: () => ({ |
| | | total: 0, |
| | | current: 0, |
| | | size: 10, |
| | | layout: "total, sizes, prev, pager, next, jumper", |
| | | }), |
| | | }, |
| | | total: { |
| | | type: Number, |
| | | default: 0, |
| | | }, |
| | | tableStyle: { |
| | | type: [String, Object], |
| | | default: () => ({ width: "100%" }), |
| | | }, |
| | | }); |
| | | |
| | | const mergedHeaderCellStyle = computed(() => ({ |
| | | background: "var(--surface-soft)", |
| | | color: "var(--text-secondary)", |
| | | fontWeight: 600, |
| | | ...props.headerCellStyle, |
| | | })); |
| | | const mergedHeaderCellStyle = computed(() => ({ |
| | | background: "var(--surface-soft)", |
| | | color: "var(--text-secondary)", |
| | | fontWeight: 600, |
| | | ...props.headerCellStyle, |
| | | })); |
| | | |
| | | // Data |
| | | const uploadRefs = ref([]); |
| | | const currentFiles = ref({}); |
| | | const uploadKeys = ref({}); |
| | | // Data |
| | | const uploadRefs = ref([]); |
| | | const currentFiles = ref({}); |
| | | const uploadKeys = ref({}); |
| | | |
| | | const indexMethod = (index) => { |
| | | return (props.page.current - 1) * props.page.size + index + 1; |
| | | }; |
| | | const indexMethod = index => { |
| | | return (props.page.current - 1) * props.page.size + index + 1; |
| | | }; |
| | | |
| | | // ç¹å» link äºä»¶ |
| | | const goLink = (row, linkMethod) => { |
| | | if (!linkMethod) { |
| | | return ElMessage.warning("请é
ç½® link äºä»¶"); |
| | | } |
| | | const parentMethod = getParentMethod(linkMethod); |
| | | if (typeof parentMethod === "function") { |
| | | parentMethod(row); |
| | | } else { |
| | | console.warn(`ç¶ç»ä»¶ä¸æªæ¾å°æ¹æ³: ${linkMethod}`); |
| | | } |
| | | }; |
| | | |
| | | // è·åç¶ç»ä»¶æ¹æ³ï¼ç¤ºä¾å®ç°ï¼ |
| | | const getParentMethod = (methodName) => { |
| | | const parentMethods = inject("parentMethods", {}); |
| | | return parentMethods[methodName]; |
| | | }; |
| | | |
| | | const dataTypeFn = (val, format) => { |
| | | if (typeof format === "function") { |
| | | return format(val); |
| | | } else return val; |
| | | }; |
| | | const validTagTypes = ["primary", "success", "info", "warning", "danger"]; |
| | | |
| | | const formatType = (val, format) => { |
| | | const type = typeof format === "function" ? format(val) : undefined; |
| | | return validTagTypes.includes(type) ? type : undefined; |
| | | }; |
| | | |
| | | const isOperationDisabled = (operation, row) => { |
| | | if (!operation?.disabled) return false; |
| | | return typeof operation.disabled === "function" |
| | | ? !!operation.disabled(row) |
| | | : !!operation.disabled; |
| | | }; |
| | | |
| | | const parseHexToRgb = (hex) => { |
| | | const normalized = String(hex || "").trim().replace("#", ""); |
| | | if (normalized.length === 3) { |
| | | const r = parseInt(normalized[0] + normalized[0], 16); |
| | | const g = parseInt(normalized[1] + normalized[1], 16); |
| | | const b = parseInt(normalized[2] + normalized[2], 16); |
| | | if ([r, g, b].some((n) => Number.isNaN(n))) return null; |
| | | return { r, g, b }; |
| | | } |
| | | if (normalized.length === 6 || normalized.length === 8) { |
| | | const r = parseInt(normalized.slice(0, 2), 16); |
| | | const g = parseInt(normalized.slice(2, 4), 16); |
| | | const b = parseInt(normalized.slice(4, 6), 16); |
| | | if ([r, g, b].some((n) => Number.isNaN(n))) return null; |
| | | return { r, g, b }; |
| | | } |
| | | return null; |
| | | }; |
| | | |
| | | const fadeColor = (color, alpha = 0.35) => { |
| | | const c = String(color || "").trim(); |
| | | if (!c) return undefined; |
| | | if (c.startsWith("#")) { |
| | | const rgb = parseHexToRgb(c); |
| | | if (!rgb) return c; |
| | | return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha})`; |
| | | } |
| | | const rgbMatch = c.match(/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)(?:\s*,\s*[\d.]+\s*)?\)$/i); |
| | | if (rgbMatch) { |
| | | const r = Number(rgbMatch[1]); |
| | | const g = Number(rgbMatch[2]); |
| | | const b = Number(rgbMatch[3]); |
| | | if ([r, g, b].some((n) => Number.isNaN(n))) return c; |
| | | return `rgba(${r}, ${g}, ${b}, ${alpha})`; |
| | | } |
| | | if (c.includes("--el-color-primary")) { |
| | | return "var(--el-color-primary-light-5)"; |
| | | } |
| | | if (c.includes("--el-color-danger")) { |
| | | return "var(--el-color-danger-light-5)"; |
| | | } |
| | | return "var(--el-text-color-disabled)"; |
| | | }; |
| | | |
| | | const getOperationColor = (operation, row) => { |
| | | const baseColor = |
| | | operation?.name === "å é¤" || operation?.name === "delete" |
| | | ? "#D93025" |
| | | : operation?.name === "详æ
" |
| | | ? "#67C23A" |
| | | : operation?.color || "var(--el-color-primary)"; |
| | | |
| | | if (isOperationDisabled(operation, row)) { |
| | | return fadeColor(baseColor, 0.35); |
| | | } |
| | | return baseColor; |
| | | }; |
| | | |
| | | // æä»¶ååå¤ç |
| | | const handleChange = (file, fileList, index) => { |
| | | if (fileList.length > 1) { |
| | | const earliestFile = fileList[0]; |
| | | uploadRefs.value[index]?.handleRemove(earliestFile); |
| | | } |
| | | currentFiles.value[index] = file; |
| | | }; |
| | | |
| | | // æä»¶ä¸ä¼ åæ ¡éª |
| | | const beforeUpload = (rawFile, index) => { |
| | | currentFiles.value[index] = {}; |
| | | if (rawfile.size > 1024 * 1024 * 10 * 10) { |
| | | ElMessage.error("ä¸ä¼ æä»¶ä¸è¶
è¿10M"); |
| | | return false; |
| | | } |
| | | return true; |
| | | }; |
| | | |
| | | // ä¸ä¼ æå |
| | | const handleSuccessUp = (response, file, fileList, index) => { |
| | | if (response.code == 200) { |
| | | if (uploadRefs[index]) { |
| | | uploadRefs[index].clearFiles(); |
| | | // ç¹å» link äºä»¶ |
| | | const goLink = (row, linkMethod) => { |
| | | if (!linkMethod) { |
| | | return ElMessage.warning("请é
ç½® link äºä»¶"); |
| | | } |
| | | currentFiles[index] = file; |
| | | ElMessage.success("ä¸ä¼ æå"); |
| | | resetUploadComponent(index); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | }; |
| | | const parentMethod = getParentMethod(linkMethod); |
| | | if (typeof parentMethod === "function") { |
| | | parentMethod(row); |
| | | } else { |
| | | console.warn(`ç¶ç»ä»¶ä¸æªæ¾å°æ¹æ³: ${linkMethod}`); |
| | | } |
| | | }; |
| | | |
| | | const resetUploadComponent = (index) => { |
| | | uploadKeys[index] = Date.now(); |
| | | }; |
| | | // è·åç¶ç»ä»¶æ¹æ³ï¼ç¤ºä¾å®ç°ï¼ |
| | | const getParentMethod = methodName => { |
| | | const parentMethods = inject("parentMethods", {}); |
| | | return parentMethods[methodName]; |
| | | }; |
| | | |
| | | // ä¸ä¼ 失败 |
| | | const onError = (error, file, fileList, index) => { |
| | | ElMessage.error("æä»¶ä¸ä¼ 失败ï¼è¯·éè¯"); |
| | | if (uploadRefs.value[index]) { |
| | | uploadRefs.value[index].clearFiles(); |
| | | } |
| | | }; |
| | | const dataTypeFn = (val, format) => { |
| | | if (typeof format === "function") { |
| | | return format(val); |
| | | } else return val; |
| | | }; |
| | | const validTagTypes = ["primary", "success", "info", "warning", "danger"]; |
| | | |
| | | // æä»¶æ°éè¶
éæç¤º |
| | | const onExceed = () => { |
| | | ElMessage.warning("è¶
åºæä»¶ä¸ªæ°"); |
| | | }; |
| | | const formatType = (val, format) => { |
| | | const type = typeof format === "function" ? format(val) : undefined; |
| | | return validTagTypes.includes(type) ? type : undefined; |
| | | }; |
| | | |
| | | const paginationSearch = ({ page, limit }) => { |
| | | emit("pagination", { page: page, limit: limit }); |
| | | }; |
| | | const isOperationDisabled = (operation, row) => { |
| | | if (!operation?.disabled) return false; |
| | | return typeof operation.disabled === "function" |
| | | ? !!operation.disabled(row) |
| | | : !!operation.disabled; |
| | | }; |
| | | |
| | | const rowClick = (row) => { |
| | | emit("row-click", row); |
| | | }; |
| | | const parseHexToRgb = hex => { |
| | | const normalized = String(hex || "") |
| | | .trim() |
| | | .replace("#", ""); |
| | | if (normalized.length === 3) { |
| | | const r = parseInt(normalized[0] + normalized[0], 16); |
| | | const g = parseInt(normalized[1] + normalized[1], 16); |
| | | const b = parseInt(normalized[2] + normalized[2], 16); |
| | | if ([r, g, b].some(n => Number.isNaN(n))) return null; |
| | | return { r, g, b }; |
| | | } |
| | | if (normalized.length === 6 || normalized.length === 8) { |
| | | const r = parseInt(normalized.slice(0, 2), 16); |
| | | const g = parseInt(normalized.slice(2, 4), 16); |
| | | const b = parseInt(normalized.slice(4, 6), 16); |
| | | if ([r, g, b].some(n => Number.isNaN(n))) return null; |
| | | return { r, g, b }; |
| | | } |
| | | return null; |
| | | }; |
| | | |
| | | const expandChange = (row, expandedRows) => { |
| | | emit("expand-change", row, expandedRows); |
| | | }; |
| | | const fadeColor = (color, alpha = 0.35) => { |
| | | const c = String(color || "").trim(); |
| | | if (!c) return undefined; |
| | | if (c.startsWith("#")) { |
| | | const rgb = parseHexToRgb(c); |
| | | if (!rgb) return c; |
| | | return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${alpha})`; |
| | | } |
| | | const rgbMatch = c.match( |
| | | /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)(?:\s*,\s*[\d.]+\s*)?\)$/i |
| | | ); |
| | | if (rgbMatch) { |
| | | const r = Number(rgbMatch[1]); |
| | | const g = Number(rgbMatch[2]); |
| | | const b = Number(rgbMatch[3]); |
| | | if ([r, g, b].some(n => Number.isNaN(n))) return c; |
| | | return `rgba(${r}, ${g}, ${b}, ${alpha})`; |
| | | } |
| | | if (c.includes("--el-color-primary")) { |
| | | return "var(--el-color-primary-light-5)"; |
| | | } |
| | | if (c.includes("--el-color-danger")) { |
| | | return "var(--el-color-danger-light-5)"; |
| | | } |
| | | return "var(--el-text-color-disabled)"; |
| | | }; |
| | | |
| | | const handleSelectionChange = (newSelection) => { |
| | | emit("selection-change", newSelection); |
| | | }; |
| | | const getOperationColor = (operation, row) => { |
| | | const baseColor = |
| | | operation?.name === "å é¤" || operation?.name === "delete" |
| | | ? "#D93025" |
| | | : operation?.name === "详æ
" |
| | | ? "#67C23A" |
| | | : operation?.color || "var(--el-color-primary)"; |
| | | |
| | | if (isOperationDisabled(operation, row)) { |
| | | return fadeColor(baseColor, 0.35); |
| | | } |
| | | return baseColor; |
| | | }; |
| | | |
| | | // æä»¶ååå¤ç |
| | | const handleChange = (file, fileList, index) => { |
| | | if (fileList.length > 1) { |
| | | const earliestFile = fileList[0]; |
| | | uploadRefs.value[index]?.handleRemove(earliestFile); |
| | | } |
| | | currentFiles.value[index] = file; |
| | | }; |
| | | |
| | | // æä»¶ä¸ä¼ åæ ¡éª |
| | | const beforeUpload = (rawFile, index) => { |
| | | currentFiles.value[index] = {}; |
| | | if (rawfile.size > 1024 * 1024 * 10 * 10) { |
| | | ElMessage.error("ä¸ä¼ æä»¶ä¸è¶
è¿10M"); |
| | | return false; |
| | | } |
| | | return true; |
| | | }; |
| | | |
| | | // ä¸ä¼ æå |
| | | const handleSuccessUp = (response, file, fileList, index) => { |
| | | if (response.code == 200) { |
| | | if (uploadRefs[index]) { |
| | | uploadRefs[index].clearFiles(); |
| | | } |
| | | currentFiles[index] = file; |
| | | ElMessage.success("ä¸ä¼ æå"); |
| | | resetUploadComponent(index); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | }; |
| | | |
| | | const resetUploadComponent = index => { |
| | | uploadKeys[index] = Date.now(); |
| | | }; |
| | | |
| | | // ä¸ä¼ 失败 |
| | | const onError = (error, file, fileList, index) => { |
| | | ElMessage.error("æä»¶ä¸ä¼ 失败ï¼è¯·éè¯"); |
| | | if (uploadRefs.value[index]) { |
| | | uploadRefs.value[index].clearFiles(); |
| | | } |
| | | }; |
| | | |
| | | // æä»¶æ°éè¶
éæç¤º |
| | | const onExceed = () => { |
| | | ElMessage.warning("è¶
åºæä»¶ä¸ªæ°"); |
| | | }; |
| | | |
| | | const paginationSearch = ({ page, limit }) => { |
| | | emit("pagination", { page: page, limit: limit }); |
| | | }; |
| | | |
| | | const rowClick = row => { |
| | | emit("row-click", row); |
| | | }; |
| | | |
| | | const expandChange = (row, expandedRows) => { |
| | | emit("expand-change", row, expandedRows); |
| | | }; |
| | | |
| | | const handleSelectionChange = newSelection => { |
| | | emit("selection-change", newSelection); |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .lims-table { |
| | | border: 1px solid var(--surface-border); |
| | | border-radius: 18px; |
| | | background: rgba(255, 255, 255, 0.9); |
| | | } |
| | | .lims-table { |
| | | border: 1px solid var(--surface-border); |
| | | border-radius: 18px; |
| | | background: rgba(255, 255, 255, 0.9); |
| | | } |
| | | |
| | | .cell { |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | padding-right: 0 !important; |
| | | padding-left: 0 !important; |
| | | } |
| | | .cell { |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | padding-right: 0 !important; |
| | | padding-left: 0 !important; |
| | | } |
| | | |
| | | .pim-table-header-extra :deep(.el-input), |
| | | .pim-table-header-extra :deep(.el-select) { |
| | | width: 100%; |
| | | } |
| | | .pim-table-header-extra :deep(.el-input), |
| | | .pim-table-header-extra :deep(.el-select) { |
| | | width: 100%; |
| | | } |
| | | |
| | | .pim-table-header-title { |
| | | font-weight: 600; |
| | | } |
| | | .pim-table-header-title { |
| | | font-weight: 600; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog v-model="visible" |
| | | :title="title" |
| | | width="800px" |
| | | destroy-on-close> |
| | | <div class="param-list-container"> |
| | | <div class="params-header"> |
| | | <span>åæ°å表</span> |
| | | <el-button v-if="editable" |
| | | type="primary" |
| | | link |
| | | size="small" |
| | | @click="handleAddParam"> |
| | | <el-icon> |
| | | <Plus /> |
| | | </el-icon>æ°å¢ |
| | | </el-button> |
| | | </div> |
| | | <div class="params-list"> |
| | | <div v-for="param in paramList" |
| | | :key="param.id" |
| | | class="param-item"> |
| | | <div class="param-info"> |
| | | <span class="param-code">{{ param.paramName }}</span> |
| | | <span class="param-value"> |
| | | æ åå¼ï¼{{ param.standardValue || "-" }} {{ param.unit }} |
| | | </span> |
| | | </div> |
| | | <div class="param-actions"> |
| | | <el-button v-if="editable" |
| | | link |
| | | type="primary" |
| | | size="small" |
| | | @click="handleEditParam(param)"> |
| | | ç¼è¾ |
| | | </el-button> |
| | | <el-button v-if="editable" |
| | | link |
| | | type="danger" |
| | | size="small" |
| | | @click="handleDeleteParam(param)"> |
| | | å é¤ |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | <el-empty v-if="!paramList || paramList.length === 0" |
| | | description="ææ åæ°" |
| | | :image-size="50" /> |
| | | </div> |
| | | </div> |
| | | <!-- éæ©åæ°å¯¹è¯æ¡ --> |
| | | <el-dialog v-model="selectParamDialogVisible" |
| | | title="鿩忰" |
| | | width="1000px"> |
| | | <div class="param-select-container"> |
| | | <!-- 左侧忰å表 --> |
| | | <div class="param-list-area"> |
| | | <div class="area-title">å¯éåæ°</div> |
| | | <div class="search-box"> |
| | | <el-input v-model="paramSearchKeyword" |
| | | placeholder="请è¾å
¥åæ°åç§°æç´¢" |
| | | clearable |
| | | size="small" |
| | | @input="getBaseParamListData"> |
| | | <template #prefix> |
| | | <el-icon> |
| | | <Search /> |
| | | </el-icon> |
| | | </template> |
| | | </el-input> |
| | | </div> |
| | | <el-table :data="filteredParamList" |
| | | height="400" |
| | | border |
| | | highlight-current-row |
| | | @current-change="handleSelectParam"> |
| | | <el-table-column prop="paramName" |
| | | label="åæ°åç§°" /> |
| | | <el-table-column prop="paramType" |
| | | label="åæ°ç±»å"> |
| | | <template #default="scope"> |
| | | <el-tag size="small" |
| | | :type="getParamTypeTag(scope.row.paramType)">{{ getParamTypeText(scope.row.paramType) }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- å页æ§ä»¶ --> |
| | | <div class="pagination-container" |
| | | style="margin-top: 10px;"> |
| | | <el-pagination v-model:current-page="paramPage.current" |
| | | v-model:page-size="paramPage.size" |
| | | :page-sizes="[10, 20, 50, 100]" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="paramPage.total" |
| | | @size-change="getBaseParamListData" |
| | | @current-change="getBaseParamListData" |
| | | size="small" /> |
| | | </div> |
| | | </div> |
| | | <!-- å³ä¾§åæ°è¯¦æ
--> |
| | | <div class="param-detail-area"> |
| | | <div class="area-title">åæ°è¯¦æ
</div> |
| | | <el-form v-if="selectedParam" |
| | | :model="selectedParam" |
| | | label-width="100px" |
| | | class="param-detail-form"> |
| | | <el-form-item label="åæ°åç§°"> |
| | | <span class="detail-text">{{ selectedParam.paramName }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="åæ°ç±»å"> |
| | | <el-tag size="small" |
| | | :type="getParamTypeTag(selectedParam.paramType)">{{ getParamTypeText(selectedParam.paramType) }}</el-tag> |
| | | </el-form-item> |
| | | <el-form-item label="åæ°æ ¼å¼"> |
| | | <span class="detail-text">{{ selectedParam.paramFormat || '-' }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="åä½"> |
| | | <span class="detail-text">{{ selectedParam.unit || '-' }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="æ åå¼" |
| | | v-if="selectedParam.paramType == '1'"> |
| | | <el-input v-model="selectedParam.standardValue" |
| | | type="number" |
| | | placeholder="请è¾å
¥é»è®¤å¼" /> |
| | | </el-form-item> |
| | | <el-form-item label="æåº"> |
| | | <el-input v-model="selectedParam.sort" |
| | | type="number" |
| | | placeholder="请è¾å
¥æåº" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦å¿
å¡«"> |
| | | <el-switch :active-value="true" |
| | | :inactive-value="false" |
| | | v-model="selectedParam.isRequired" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-empty v-else |
| | | description="请ä»å·¦ä¾§éæ©åæ°" |
| | | :image-size="100" /> |
| | | </div> |
| | | </div> |
| | | <template #footer> |
| | | <el-button @click="selectParamDialogVisible = false">åæ¶</el-button> |
| | | <el-button type="primary" |
| | | @click="handleParamSelectSubmit">ç¡®å®</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- ç¼è¾åæ°å¯¹è¯æ¡ --> |
| | | <el-dialog v-model="editParamDialogVisible" |
| | | title="ç¼è¾åæ°" |
| | | width="600px"> |
| | | <el-form :model="editParamForm" |
| | | :rules="editParamRules" |
| | | ref="editParamFormRef" |
| | | label-width="120px"> |
| | | <el-form-item label="åæ°åç§°"> |
| | | <span class="detail-text">{{ editParamForm.paramName }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="åæ°ç±»å"> |
| | | <el-tag size="small" |
| | | :type="getParamTypeTag(editParamForm.paramType)"> |
| | | {{ getParamTypeText(editParamForm.paramType) }} |
| | | </el-tag> |
| | | </el-form-item> |
| | | <el-form-item label="åæ°æ ¼å¼"> |
| | | <span class="detail-text">{{ editParamForm.paramFormat || '-' }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="åä½"> |
| | | <span class="detail-text">{{ editParamForm.unit || '-' }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="æ åå¼" |
| | | v-if="editParamForm.paramType == '1'" |
| | | prop="standardValue"> |
| | | <el-input v-model="editParamForm.standardValue" |
| | | type="number" |
| | | placeholder="请è¾å
¥æ åå¼" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button @click="editParamDialogVisible = false">åæ¶</el-button> |
| | | <el-button type="primary" |
| | | @click="handleEditParamSubmit">ç¡®å®</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, computed, watch } from "vue"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import { Plus, Search } from "@element-plus/icons-vue"; |
| | | import { |
| | | delProcessRouteItemParam, |
| | | editProcessRouteItemParam, |
| | | addProcessRouteItemParam, |
| | | } from "@/api/productionManagement/processRouteItem.js"; |
| | | import { |
| | | addProcessRouteItemParamOrder, |
| | | delProcessRouteItemParamOrder, |
| | | editProcessRouteItemParamOrder, |
| | | } from "@/api/productionManagement/productProcessRoute.js"; |
| | | |
| | | import { getBaseParamList } from "@/api/basicData/parameterMaintenance.js"; |
| | | |
| | | const props = defineProps({ |
| | | modelValue: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | title: { |
| | | type: String, |
| | | default: "åæ°å表", |
| | | }, |
| | | routeId: { |
| | | type: Number, |
| | | default: 0, |
| | | }, |
| | | process: { |
| | | type: Object, |
| | | default: () => ({}), |
| | | }, |
| | | paramList: { |
| | | type: Array, |
| | | default: () => [], |
| | | }, |
| | | editable: { |
| | | type: Boolean, |
| | | default: true, |
| | | }, |
| | | orderId: { |
| | | type: Number, |
| | | default: 0, |
| | | }, |
| | | pageType: { |
| | | type: String, |
| | | default: "route", |
| | | }, |
| | | }); |
| | | |
| | | const emit = defineEmits(["update:modelValue", "refresh"]); |
| | | |
| | | const visible = computed({ |
| | | get: () => props.modelValue, |
| | | set: value => emit("update:modelValue", value), |
| | | }); |
| | | |
| | | // ååºå¼æ°æ® |
| | | const selectParamDialogVisible = ref(false); |
| | | const editParamDialogVisible = ref(false); |
| | | const paramSearchKeyword = ref(""); |
| | | const selectedParam = ref(null); |
| | | const filteredParamList = ref([]); |
| | | const paramPage = ref({ |
| | | current: 1, |
| | | size: 10, |
| | | total: 0, |
| | | }); |
| | | const editParamForm = ref({ |
| | | id: null, |
| | | processId: null, |
| | | paramId: null, |
| | | paramName: "", |
| | | standardValue: null, |
| | | sort: 1, |
| | | isRequired: false, |
| | | paramType: null, |
| | | paramFormat: "", |
| | | unit: "", |
| | | }); |
| | | const editParamRules = ref({ |
| | | standardValue: [{ required: true, message: "请è¾å
¥æ åå¼", trigger: "blur" }], |
| | | }); |
| | | const editParamFormRef = ref(null); |
| | | |
| | | // æ°å¢åæ° |
| | | const handleAddParam = () => { |
| | | selectedParam.value = null; |
| | | paramSearchKeyword.value = ""; |
| | | paramPage.current = 1; |
| | | // è·åå¯éåæ°å表 |
| | | getBaseParamListData(); |
| | | selectParamDialogVisible.value = true; |
| | | }; |
| | | |
| | | // ç¼è¾åæ° |
| | | const handleEditParam = param => { |
| | | editParamForm.value = { |
| | | id: param.id, |
| | | processId: props.process.id, |
| | | paramId: param.paramId, |
| | | paramName: param.parameterName || param.paramName, |
| | | standardValue: param.standardValue, |
| | | sort: param.sort || 1, |
| | | isRequired: param.isRequired || false, |
| | | paramType: param.parameterType || param.paramType, |
| | | paramFormat: param.parameterFormat || param.paramFormat, |
| | | unit: param.unit || param.unit, |
| | | }; |
| | | editParamDialogVisible.value = true; |
| | | }; |
| | | |
| | | // å é¤åæ° |
| | | const handleDeleteParam = param => { |
| | | ElMessageBox.confirm("ç¡®å®è¦å é¤è¯¥åæ°åï¼", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | // è°ç¨APIå é¤åæ° |
| | | if (props.pageType === "order") { |
| | | delProcessRouteItemParamOrder(param.id) |
| | | .then(res => { |
| | | ElMessage.success("å 餿å"); |
| | | emit("refresh"); |
| | | }) |
| | | .catch(err => { |
| | | ElMessage.error("å é¤åæ°å¤±è´¥"); |
| | | console.error("å é¤åæ°å¤±è´¥ï¼", err); |
| | | }); |
| | | } else { |
| | | delProcessRouteItemParam(param.id) |
| | | .then(res => { |
| | | ElMessage.success("å 餿å"); |
| | | emit("refresh"); |
| | | }) |
| | | .catch(err => { |
| | | ElMessage.error("å é¤åæ°å¤±è´¥"); |
| | | console.error("å é¤åæ°å¤±è´¥ï¼", err); |
| | | }); |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | |
| | | // è·åå¯éåæ°å表 |
| | | const getBaseParamListData = () => { |
| | | getBaseParamList({ |
| | | paramName: paramSearchKeyword.value, |
| | | current: paramPage.current, |
| | | size: paramPage.size, |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | filteredParamList.value = res.data?.records || []; |
| | | paramPage.total = res.data?.total || 0; |
| | | } else { |
| | | ElMessage.error(res.msg || "æ¥è¯¢å¤±è´¥"); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // 鿩忰 |
| | | const handleSelectParam = param => { |
| | | selectedParam.value = param; |
| | | }; |
| | | |
| | | // æäº¤éæ©åæ° |
| | | const handleParamSelectSubmit = () => { |
| | | if (!selectedParam.value) { |
| | | ElMessage.warning("请å
éæ©ä¸ä¸ªåæ°"); |
| | | return; |
| | | } |
| | | |
| | | if (!props.process || !props.process.id) { |
| | | ElMessage.error("å·¥èºè·¯çº¿é¡¹ç®ä¿¡æ¯ä¸å®æ´"); |
| | | return; |
| | | } |
| | | |
| | | // å¤æåæ°ç±»åï¼åªææ°å¼ç±»åæä¼ æ åå¼ãæå¤§å¼åæå°å¼ |
| | | const isNumericMode = selectedParam.value.paramType == 1; |
| | | console.log(isNumericMode, "isNumericMode"); |
| | | // è°ç¨APIæ°å¢åæ° |
| | | if (props.pageType === "order") { |
| | | addProcessRouteItemParamOrder({ |
| | | orderId: Number(props.orderId), |
| | | // processId: props.process.id, |
| | | routeItemId: props.process.id, |
| | | // routeItemId: Number(props.routeId), |
| | | paramId: selectedParam.value.id, |
| | | standardValue: isNumericMode |
| | | ? selectedParam.value.standardValue || "" |
| | | : "", |
| | | isRequired: selectedParam.value.isRequired || false, |
| | | sort: selectedParam.value.sort || 1, |
| | | }) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success("æ·»å åæ°æå"); |
| | | selectParamDialogVisible.value = false; |
| | | emit("refresh"); |
| | | } else { |
| | | ElMessage.error(res.msg || "æ·»å åæ°å¤±è´¥"); |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | ElMessage.error("æ·»å åæ°å¤±è´¥"); |
| | | console.error("æ·»å åæ°å¤±è´¥ï¼", err); |
| | | }); |
| | | } else { |
| | | addProcessRouteItemParam({ |
| | | routeItemId: props.process.id, |
| | | paramId: selectedParam.value.id, |
| | | standardValue: isNumericMode |
| | | ? selectedParam.value.standardValue || "" |
| | | : "", |
| | | isRequired: selectedParam.value.isRequired || false, |
| | | sort: selectedParam.value.sort || 1, |
| | | }) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success("æ·»å åæ°æå"); |
| | | selectParamDialogVisible.value = false; |
| | | emit("refresh"); |
| | | } else { |
| | | ElMessage.error(res.msg || "æ·»å åæ°å¤±è´¥"); |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | ElMessage.error("æ·»å åæ°å¤±è´¥"); |
| | | console.error("æ·»å åæ°å¤±è´¥ï¼", err); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // æäº¤ç¼è¾åæ° |
| | | const handleEditParamSubmit = () => { |
| | | if (!editParamFormRef.value) return; |
| | | editParamFormRef.value.validate(valid => { |
| | | if (valid) { |
| | | // å¤æåæ°ç±»åï¼åªææ°å¼ç±»åæä¼ æ åå¼ãæå¤§å¼åæå°å¼ |
| | | const isNumericMode = editParamForm.value.paramType == 1; |
| | | console.log(isNumericMode, "isNumericMode"); |
| | | if (props.pageType === "order") { |
| | | editProcessRouteItemParamOrder({ |
| | | id: editParamForm.value.id, |
| | | // routeItemId: props.process.id, |
| | | // paramId: editParamForm.value.paramId, |
| | | standardValue: isNumericMode |
| | | ? editParamForm.value.standardValue || "" |
| | | : "", |
| | | isRequired: editParamForm.value.isRequired || false, |
| | | }) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success("ç¼è¾æå"); |
| | | editParamDialogVisible.value = false; |
| | | emit("refresh"); |
| | | } else { |
| | | ElMessage.error(res.msg || "ç¼è¾å¤±è´¥"); |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | ElMessage.error("ç¼è¾åæ°å¤±è´¥"); |
| | | console.error("ç¼è¾åæ°å¤±è´¥ï¼", err); |
| | | }); |
| | | } else { |
| | | // è°ç¨APIä¿®æ¹åæ° |
| | | editProcessRouteItemParam({ |
| | | id: editParamForm.value.id, |
| | | routeItemId: props.process.id, |
| | | paramId: editParamForm.value.paramId, |
| | | standardValue: isNumericMode |
| | | ? editParamForm.value.standardValue || "" |
| | | : "", |
| | | isRequired: editParamForm.value.isRequired || false, |
| | | }) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | ElMessage.success("ç¼è¾æå"); |
| | | editParamDialogVisible.value = false; |
| | | emit("refresh"); |
| | | } else { |
| | | ElMessage.error(res.msg || "ç¼è¾å¤±è´¥"); |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | ElMessage.error("ç¼è¾åæ°å¤±è´¥"); |
| | | console.error("ç¼è¾åæ°å¤±è´¥ï¼", err); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // è·ååæ°ç±»åæ ç¾ |
| | | const getParamTypeTag = type => { |
| | | const typeMap = { |
| | | 1: "primary", |
| | | 2: "info", |
| | | 3: "warning", |
| | | 4: "success", |
| | | }; |
| | | return typeMap[type] || "default"; |
| | | }; |
| | | |
| | | // è·ååæ°ç±»åææ¬ |
| | | const getParamTypeText = type => { |
| | | const typeMap = { |
| | | 1: "æ°å¼æ ¼å¼", |
| | | 2: "ææ¬æ ¼å¼", |
| | | 3: "䏿é项", |
| | | 4: "æ¶é´æ ¼å¼", |
| | | }; |
| | | return typeMap[type] || type; |
| | | }; |
| | | |
| | | watch( |
| | | () => props.modelValue, |
| | | newVal => { |
| | | if (!newVal) { |
| | | // å¼¹çªå
³éæ¶éç½®æ°æ® |
| | | selectParamDialogVisible.value = false; |
| | | editParamDialogVisible.value = false; |
| | | selectedParam.value = null; |
| | | paramSearchKeyword.value = ""; |
| | | paramPage.current = 1; |
| | | filteredParamList.value = []; |
| | | editParamForm.value = { |
| | | id: null, |
| | | processId: null, |
| | | paramId: null, |
| | | paramName: "", |
| | | standardValue: null, |
| | | sort: 1, |
| | | isRequired: false, |
| | | paramType: null, |
| | | paramFormat: "", |
| | | unit: "", |
| | | }; |
| | | } |
| | | } |
| | | ); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .param-list-container { |
| | | padding: 10px 0; |
| | | } |
| | | |
| | | .params-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 15px; |
| | | padding-bottom: 10px; |
| | | border-bottom: 1px solid #e4e7ed; |
| | | } |
| | | |
| | | .params-header span { |
| | | font-size: 16px; |
| | | font-weight: 500; |
| | | color: #303133; |
| | | } |
| | | |
| | | .params-list { |
| | | max-height: 400px; |
| | | overflow-y: auto; |
| | | } |
| | | |
| | | .param-item { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 12px 16px; |
| | | margin-bottom: 8px; |
| | | background-color: #f9f9f9; |
| | | border-radius: 4px; |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .param-item:hover { |
| | | background-color: #ecf5ff; |
| | | box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .param-info { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 20px; |
| | | flex: 1; |
| | | } |
| | | |
| | | .param-code { |
| | | font-weight: 500; |
| | | color: #303133; |
| | | min-width: 120px; |
| | | } |
| | | |
| | | .param-value { |
| | | color: #606266; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .param-actions { |
| | | display: flex; |
| | | gap: 10px; |
| | | } |
| | | |
| | | /* æ»å¨æ¡æ ·å¼ */ |
| | | .params-list::-webkit-scrollbar { |
| | | width: 6px; |
| | | } |
| | | |
| | | .params-list::-webkit-scrollbar-track { |
| | | background: #f1f1f1; |
| | | border-radius: 3px; |
| | | } |
| | | |
| | | .params-list::-webkit-scrollbar-thumb { |
| | | background: #c1c1c1; |
| | | border-radius: 3px; |
| | | } |
| | | |
| | | .params-list::-webkit-scrollbar-thumb:hover { |
| | | background: #a8a8a8; |
| | | } |
| | | |
| | | /* éæ©åæ°å¯¹è¯æ¡æ ·å¼ */ |
| | | .param-select-container { |
| | | display: flex; |
| | | gap: 20px; |
| | | } |
| | | |
| | | .param-list-area { |
| | | flex: 1; |
| | | min-width: 400px; |
| | | } |
| | | |
| | | .param-detail-area { |
| | | flex: 1; |
| | | min-width: 300px; |
| | | } |
| | | |
| | | .area-title { |
| | | font-size: 14px; |
| | | font-weight: 500; |
| | | margin-bottom: 10px; |
| | | color: #303133; |
| | | } |
| | | |
| | | .search-box { |
| | | display: flex; |
| | | gap: 10px; |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | .param-detail-form { |
| | | background: #f9f9f9; |
| | | padding: 15px; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .detail-text { |
| | | font-weight: 500; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <div> |
| | | <span class="search_title ml10">åæ°åç§°ï¼</span> |
| | | <el-input v-model="searchForm.paramName" |
| | | style="width: 200px" |
| | | placeholder="请è¾å
¥åæ°åç§°" |
| | | clearable /> |
| | | <!-- å
³è产åç±»åæç´¢ --> |
| | | <!-- <span class="search_title ml10">å
³è产åç±»åï¼</span> |
| | | <el-input v-model="searchForm.productName" |
| | | style="width: 200px"d |
| | | placeholder="请è¾å
¥å
³è产åç±»å" |
| | | clearable /> --> |
| | | <el-button type="primary" |
| | | @click="handleQuery" |
| | | style="margin-left: 10px">æç´¢</el-button> |
| | | <el-button @click="handleReset">éç½®</el-button> |
| | | <el-button type="primary" |
| | | @click="handleAdd" |
| | | style="margin-left: 10px">æ°å¢åæ°</el-button> |
| | | <!-- 产åç±»åç»´æ¤æé® --> |
| | | <!-- <el-button type="primary" |
| | | @click="handleProductTypeMaintenance" |
| | | style="margin-left: 10px">产åç±»åç»´æ¤</el-button> --> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | | <PIMTable rowKey="paramName" |
| | | :column="tableColumn" |
| | | :tableData="tableData" |
| | | :page="page" |
| | | height="calc(100vh - 320px)" |
| | | :tableLoading="tableLoading" |
| | | :isSelection="false" |
| | | :isShowPagination="true" |
| | | @pagination="pagination"> |
| | | </PIMTable> |
| | | </div> |
| | | <!-- æ°å¢/ç¼è¾å¯¹è¯æ¡ --> |
| | | <el-dialog v-model="dialogVisible" |
| | | :title="dialogTitle" |
| | | width="500px"> |
| | | <el-form :model="formData" |
| | | :rules="rules" |
| | | ref="formRef" |
| | | label-width="120px"> |
| | | <el-form-item label="åæ°ç¼ç " |
| | | prop="paramCode"> |
| | | <el-input v-model="formData.paramCode" |
| | | disabled |
| | | placeholder="èªå¨çæ" /> |
| | | </el-form-item> |
| | | <el-form-item label="åæ°åç§°" |
| | | prop="paramName"> |
| | | <el-input v-model="formData.paramName" |
| | | placeholder="请è¾å
¥åæ°åç§°" /> |
| | | </el-form-item> |
| | | <el-form-item label="åæ°ç±»å" |
| | | prop="paramType"> |
| | | <el-select v-model="formData.paramType" |
| | | @change="handleParamTypeChange" |
| | | placeholder="è¯·éæ©åæ°ç±»å"> |
| | | <el-option label="æ°å¼æ ¼å¼" |
| | | :value="1" /> |
| | | <el-option label="ææ¬æ ¼å¼" |
| | | :value="2" /> |
| | | <el-option label="䏿é项" |
| | | :value="3" /> |
| | | <el-option label="æ¶é´æ ¼å¼" |
| | | :value="4" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="å弿¨¡å¼" |
| | | prop="valueMode"> |
| | | <el-select v-model="formData.valueMode" |
| | | placeholder="è¯·éæ©å弿¨¡å¼"> |
| | | <el-option label="åå¼" |
| | | value="1" /> |
| | | <el-option label="åºé´" |
| | | value="2" /> |
| | | </el-select> |
| | | </el-form-item> --> |
| | | <el-form-item label="åä½" |
| | | prop="unit"> |
| | | <el-input v-model="formData.unit" |
| | | placeholder="请è¾å
¥åä½" /> |
| | | </el-form-item> |
| | | <el-form-item label="å弿 ¼å¼" |
| | | v-if="formData.paramType == 1 || formData.paramType == 2" |
| | | prop="paramFormat"> |
| | | <el-input v-model="formData.paramFormat" |
| | | placeholder="请è¾å
¥å弿 ¼å¼" /> |
| | | <!-- <el-select v-model="formData.paramFormat" |
| | | placeholder="è¯·éæ©å弿¨¡å¼"> |
| | | <el-option label="#.00000" |
| | | value="#.00000" /> |
| | | <el-option label="#.0000" |
| | | value="#.0000" /> |
| | | <el-option label="#.000" |
| | | value="#.000" /> |
| | | <el-option label="#.00" |
| | | value="#.00" /> |
| | | </el-select> --> |
| | | </el-form-item> |
| | | <el-form-item label="䏿åå
¸" |
| | | v-else-if="formData.paramType == 3" |
| | | prop="paramFormat"> |
| | | <el-select v-model="formData.paramFormat" |
| | | placeholder="è¯·éæ©å弿¨¡å¼"> |
| | | <el-option v-for="item in dictTypes" |
| | | :key="item.dictType" |
| | | :label="item.dictName" |
| | | :value="item.dictType" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ¶é´æ ¼å¼" |
| | | v-else-if="formData.paramType == 4" |
| | | prop="paramFormat"> |
| | | <el-select v-model="formData.paramFormat" |
| | | placeholder="è¯·éæ©å弿¨¡å¼"> |
| | | <el-option label="YYYY-MM-DD" |
| | | value="YYYY-MM-DD" /> |
| | | <el-option label="YYYY-MM-DD HH:mm:ss" |
| | | value="YYYY-MM-DD HH:mm:ss" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦å¿
å¡«" |
| | | prop="isRequired"> |
| | | <el-switch v-model="formData.isRequired" |
| | | :active-value="1" |
| | | :inactive-value="0" /> |
| | | </el-form-item> |
| | | <el-form-item label="夿³¨" |
| | | prop="remark"> |
| | | <el-input v-model="formData.remark" |
| | | type="textarea" |
| | | :rows="3" |
| | | placeholder="请è¾å
¥å¤æ³¨" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false">åæ¶</el-button> |
| | | <el-button type="primary" |
| | | @click="handleSubmit">ç¡®å®</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- 产åç±»åç»´æ¤å¯¹è¯æ¡ --> |
| | | <!-- <el-dialog v-model="productTypeDialogVisible" |
| | | title="产åç±»åç»´æ¤" |
| | | width="600px"> |
| | | <div class="product-type-header"> |
| | | <el-button type="primary" |
| | | @click="handleAddProductType">æ°å¢äº§åç±»å</el-button> |
| | | </div> |
| | | <el-table :data="productTypeList" |
| | | border |
| | | style="width: 100%; margin-top: 10px; margin-bottom: 20px"> |
| | | <el-table-column prop="typeCode" |
| | | label="ç±»åç¼ç " |
| | | width="150" /> |
| | | <el-table-column prop="typeName" |
| | | label="ç±»ååç§°" /> |
| | | <el-table-column label="æä½" |
| | | width="150"> |
| | | <template #default="scope"> |
| | | <el-button link |
| | | type="primary" |
| | | @click="handleEditProductType(scope.row)">ç¼è¾</el-button> |
| | | <el-button link |
| | | type="danger" |
| | | @click="handleDeleteProductType(scope.row)">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-dialog> --> |
| | | <!-- æ°å¢/ç¼è¾äº§åç±»åå¯¹è¯æ¡ --> |
| | | <!-- <el-dialog v-model="productTypeFormVisible" |
| | | :title="productTypeDialogTitle" |
| | | width="400px"> |
| | | <el-form :model="productTypeForm" |
| | | :rules="productTypeRules" |
| | | ref="productTypeFormRef" |
| | | label-width="100px"> |
| | | <el-form-item label="ç±»åç¼ç " |
| | | prop="typeCode"> |
| | | <el-input v-model="productTypeForm.typeCode" |
| | | placeholder="请è¾å
¥ç±»åç¼ç " /> |
| | | </el-form-item> |
| | | <el-form-item label="ç±»ååç§°" |
| | | prop="typeName"> |
| | | <el-input v-model="productTypeForm.typeName" |
| | | placeholder="请è¾å
¥ç±»ååç§°" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="productTypeFormVisible = false">åæ¶</el-button> |
| | | <el-button type="primary" |
| | | @click="handleProductTypeSubmit">ç¡®å®</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> --> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, ref, reactive } from "vue"; |
| | | import { |
| | | parameterListPage, |
| | | addParameter, |
| | | updateParameter, |
| | | delParameter, |
| | | addBaseParam, |
| | | editBaseParam, |
| | | getBaseParamList, |
| | | removeBaseParam, |
| | | // getProductTypes as getProductTypesApi, |
| | | } from "@/api/basicData/parameterMaintenance.js"; |
| | | import { listType } from "@/api/system/dict/type"; |
| | | import { deptTreeSelect } from "@/api/system/user.js"; |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | |
| | | const tableColumn = ref([ |
| | | { |
| | | label: "åæ°ç¼ç ", |
| | | prop: "paramCode", |
| | | }, |
| | | { |
| | | label: "åæ°åç§°", |
| | | prop: "paramName", |
| | | }, |
| | | { |
| | | label: "åæ°ç±»å", |
| | | prop: "paramType", |
| | | dataType: "tag", |
| | | formatType: params => { |
| | | const typeMap = { |
| | | 1: "primary", |
| | | 2: "info", |
| | | 3: "warning", |
| | | 4: "success", |
| | | }; |
| | | return typeMap[params] || "default"; |
| | | }, |
| | | formatData: val => { |
| | | const labelMap = { |
| | | 1: "æ°å¼æ ¼å¼", |
| | | 2: "ææ¬æ ¼å¼", |
| | | 3: "䏿é项", |
| | | 4: "æ¶é´æ ¼å¼", |
| | | }; |
| | | return labelMap[val] || val; |
| | | }, |
| | | }, |
| | | // { |
| | | // label: "å弿¨¡å¼", |
| | | // prop: "valueMode", |
| | | // dataType: "tag", |
| | | // formatType: params => { |
| | | // return params === 2 ? "warning" : "success"; |
| | | // }, |
| | | // formatData: val => { |
| | | // return val === 2 ? "åºé´" : "åå¼"; |
| | | // }, |
| | | // }, |
| | | { |
| | | label: "åä½", |
| | | prop: "unit", |
| | | }, |
| | | { |
| | | label: "å弿 ¼å¼", |
| | | prop: "paramFormat", |
| | | }, |
| | | { |
| | | label: "æ¯å¦å¿
å¡«", |
| | | prop: "isRequired", |
| | | dataType: "tag", |
| | | formatType: val => { |
| | | return val === 1 ? "success" : "info"; |
| | | }, |
| | | formatData: val => { |
| | | return val === 1 ? "æ¯" : "å¦"; |
| | | }, |
| | | }, |
| | | { |
| | | label: "夿³¨", |
| | | prop: "remark", |
| | | }, |
| | | { |
| | | label: "å建æ¶é´", |
| | | prop: "createTime", |
| | | }, |
| | | { |
| | | label: "æä½", |
| | | dataType: "action", |
| | | width: "150", |
| | | operation: [ |
| | | { |
| | | name: "ç¼è¾", |
| | | clickFun: row => { |
| | | handleEdit(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "å é¤", |
| | | clickFun: row => { |
| | | handleDelete(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ]); |
| | | const tableData = ref([]); |
| | | const tableLoading = ref(false); |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | total: 0, |
| | | }); |
| | | // æç´¢è¡¨å |
| | | const searchForm = reactive({ |
| | | paramName: "", |
| | | productName: "", |
| | | }); |
| | | |
| | | // å¯¹è¯æ¡ç¸å
³ |
| | | const dialogVisible = ref(false); |
| | | const dialogTitle = ref(""); |
| | | const formRef = ref(null); |
| | | const formData = reactive({ |
| | | id: null, |
| | | paramCode: "", |
| | | paramName: "", |
| | | paramType: "", |
| | | // valueMode: "1", |
| | | unit: "", |
| | | remark: "", |
| | | isRequired: 0, |
| | | paramFormat: "", |
| | | }); |
| | | const rules = reactive({ |
| | | paramName: [{ required: true, message: "请è¾å
¥åæ°åç§°", trigger: "blur" }], |
| | | paramType: [{ required: true, message: "è¯·éæ©åæ°ç±»å", trigger: "change" }], |
| | | // valueMode: [{ required: true, message: "è¯·éæ©å弿¨¡å¼", trigger: "change" }], |
| | | unit: [ |
| | | { |
| | | required: false, |
| | | message: "请è¾å
¥åä½", |
| | | trigger: "blur", |
| | | validator: (rule, value, callback) => { |
| | | if (formData.paramType === 1 && !value) { |
| | | callback(new Error("æ°å¼ç±»åå¿
须填ååä½")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | }, |
| | | ], |
| | | }); |
| | | // const productTypes = ref([]); |
| | | const isEdit = ref(false); |
| | | |
| | | // 产åç±»åç»´æ¤ç¸å
³ - 已注é |
| | | // const productTypeDialogVisible = ref(false); |
| | | // const productTypeFormVisible = ref(false); |
| | | // const productTypeDialogTitle = ref(""); |
| | | // const productTypeFormRef = ref(null); |
| | | // const productTypeList = ref([]); |
| | | // const productTypeForm = reactive({ |
| | | // id: null, |
| | | // typeCode: "", |
| | | // typeName: "", |
| | | // }); |
| | | // const productTypeRules = reactive({ |
| | | // typeCode: [{ required: true, message: "请è¾å
¥ç±»åç¼ç ", trigger: "blur" }], |
| | | // typeName: [{ required: true, message: "请è¾å
¥ç±»ååç§°", trigger: "blur" }], |
| | | // }); |
| | | // const isProductTypeEdit = ref(false); |
| | | const handleParamTypeChange = () => { |
| | | if (formData.paramType === 1) { |
| | | formData.paramFormat = "#.00000"; |
| | | } else if (formData.paramType === 4) { |
| | | formData.paramFormat = "YYYY-MM-DD HH:mm:ss"; |
| | | } else { |
| | | formData.paramFormat = ""; |
| | | } |
| | | // 触ååä½å段éªè¯ |
| | | if (formRef.value) { |
| | | formRef.value.validateField("unit"); |
| | | } |
| | | }; |
| | | // 产åç±»åç»´æ¤æé®ç¹å»äºä»¶ - 已注é |
| | | // const handleProductTypeMaintenance = () => { |
| | | // productTypeDialogVisible.value = true; |
| | | // getProductTypeList(); |
| | | // }; |
| | | |
| | | // è·å产åç±»åå表 - 已注é |
| | | // const getProductTypeList = () => { |
| | | // productTypeList.value = [ |
| | | // { id: 1, typeCode: "TYPE001", typeName: "3.5ç å" }, |
| | | // { id: 2, typeCode: "TYPE002", typeName: "5.0ç å" }, |
| | | // { id: 3, typeCode: "TYPE003", typeName: "æ¿æ" }, |
| | | // ]; |
| | | // }; |
| | | |
| | | // æ°å¢äº§åç±»å - 已注é |
| | | // const handleAddProductType = () => { |
| | | // isProductTypeEdit.value = false; |
| | | // productTypeDialogTitle.value = "æ°å¢äº§åç±»å"; |
| | | // productTypeForm.id = null; |
| | | // productTypeForm.typeCode = ""; |
| | | // productTypeForm.typeName = ""; |
| | | // productTypeFormVisible.value = true; |
| | | // }; |
| | | |
| | | // ç¼è¾äº§åç±»å - 已注é |
| | | // const handleEditProductType = row => { |
| | | // isProductTypeEdit.value = true; |
| | | // productTypeDialogTitle.value = "ç¼è¾äº§åç±»å"; |
| | | // productTypeForm.id = row.id; |
| | | // productTypeForm.typeCode = row.typeCode; |
| | | // productTypeForm.typeName = row.typeName; |
| | | // productTypeFormVisible.value = true; |
| | | // }; |
| | | |
| | | // å é¤äº§åç±»å - 已注é |
| | | // const handleDeleteProductType = row => { |
| | | // ElMessageBox.confirm("ç¡®å®è¦å é¤è¯¥äº§åç±»ååï¼", "æç¤º", { |
| | | // confirmButtonText: "ç¡®å®", |
| | | // cancelButtonText: "åæ¶", |
| | | // type: "warning", |
| | | // }) |
| | | // .then(() => { |
| | | // ElMessage.success("å 餿å"); |
| | | // getProductTypeList(); |
| | | // }) |
| | | // .catch(() => {}); |
| | | // }; |
| | | |
| | | // æäº¤äº§åç±»å表å - 已注é |
| | | // const handleProductTypeSubmit = () => { |
| | | // productTypeFormRef.value.validate(valid => { |
| | | // if (valid) { |
| | | // ElMessage.success(isProductTypeEdit.value ? "ç¼è¾æå" : "æ°å¢æå"); |
| | | // productTypeFormVisible.value = false; |
| | | // getProductTypeList(); |
| | | // } |
| | | // }); |
| | | // }; |
| | | |
| | | // æ¥è¯¢å表 |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | | |
| | | /** éç½®æé®æä½ */ |
| | | const handleReset = () => { |
| | | searchForm.paramName = ""; |
| | | searchForm.productName = ""; |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | | const pagination = obj => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList(); |
| | | }; |
| | | |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | // è°ç¨æ°æ¥å£ /baseParam/list |
| | | getBaseParamList({ |
| | | paramName: searchForm.paramName, |
| | | current: page.current, |
| | | size: page.size, |
| | | }) |
| | | .then(res => { |
| | | tableLoading.value = false; |
| | | if (res.code === 200) { |
| | | tableData.value = res.data.records || []; |
| | | page.total = res.data.total || 0; |
| | | console.log(tableData.value, "tableData.value"); |
| | | } else { |
| | | ElMessage.error(res.msg || "æ¥è¯¢å¤±è´¥"); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | tableLoading.value = false; |
| | | ElMessage.error("æ¥è¯¢å¤±è´¥"); |
| | | }); |
| | | }; |
| | | |
| | | // è·å产åç±»åå表 - 已注é |
| | | // const getProductTypes = () => { |
| | | // productTypes.value = [ |
| | | // { label: "3.5ç å", value: "type1" }, |
| | | // { label: "5.0ç å", value: "type2" }, |
| | | // { label: "æ¿æ", value: "type3" }, |
| | | // ]; |
| | | // }; |
| | | |
| | | // æ°å¢æé®ç¹å»äºä»¶ |
| | | const handleAdd = () => { |
| | | isEdit.value = false; |
| | | dialogTitle.value = "æ°å¢åæ°"; |
| | | // é置表å |
| | | formData.id = null; |
| | | formData.paramCode = ""; |
| | | formData.paramName = ""; |
| | | formData.paramType = ""; |
| | | // formData.valueMode = "1"; |
| | | formData.unit = ""; |
| | | formData.remark = ""; |
| | | formData.isRequired = 0; |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | // ç¼è¾æé®ç¹å»äºä»¶ |
| | | const handleEdit = row => { |
| | | isEdit.value = true; |
| | | dialogTitle.value = "ç¼è¾åæ°"; |
| | | // å¡«å
è¡¨åæ°æ® |
| | | formData.id = row.id; |
| | | formData.paramCode = row.paramCode || ""; |
| | | formData.paramName = row.paramName || ""; |
| | | formData.paramType = row.paramType !== undefined ? row.paramType : null; |
| | | // formData.valueMode = |
| | | // row.valueMode !== undefined ? String(row.valueMode) : "1"; |
| | | formData.unit = row.unit || ""; |
| | | formData.remark = row.remark || ""; |
| | | formData.paramFormat = row.paramFormat || ""; |
| | | formData.isRequired = row.isRequired || 0; |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | // å 餿é®ç¹å»äºä»¶ |
| | | const handleDelete = row => { |
| | | ElMessageBox.confirm("ç¡®å®è¦å é¤è¿æ¡æ°æ®åï¼", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | // è°ç¨æ°æ¥å£ /baseParam/remove/{id} |
| | | removeBaseParam([row.id]) |
| | | .then(res => { |
| | | ElMessage.success("å 餿å"); |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("å é¤å¤±è´¥"); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | // åæ¶å é¤ |
| | | }); |
| | | }; |
| | | |
| | | // æäº¤è¡¨å |
| | | const handleSubmit = () => { |
| | | formRef.value.validate(valid => { |
| | | if (valid) { |
| | | if (formData.id) { |
| | | // ç¼è¾ä½¿ç¨æ°æ¥å£ /technologyParam/edit |
| | | editBaseParam(formData) |
| | | .then(res => { |
| | | ElMessage.success("ç¼è¾æå"); |
| | | dialogVisible.value = false; |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | // ElMessage.error("ç¼è¾å¤±è´¥"); |
| | | }); |
| | | } else { |
| | | // æ°å¢ä½¿ç¨æ°æ¥å£ /technologyParam/add |
| | | addBaseParam(formData) |
| | | .then(res => { |
| | | ElMessage.success("æ°å¢æå"); |
| | | dialogVisible.value = false; |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("æ°å¢å¤±è´¥"); |
| | | }); |
| | | } |
| | | } else { |
| | | return false; |
| | | } |
| | | }); |
| | | }; |
| | | const dictTypes = ref([]); |
| | | const getDictTypes = () => { |
| | | listType({ pageNum: 1, pageSize: 1000 }).then(res => { |
| | | dictTypes.value = res.rows || []; |
| | | }); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getDictTypes(); |
| | | getList(); |
| | | // getProductTypes(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .app-container { |
| | | padding: 24px; |
| | | background-color: #f0f2f5; |
| | | min-height: calc(100vh - 48px); |
| | | } |
| | | |
| | | .search_form { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 24px; |
| | | padding: 20px; |
| | | background-color: #ffffff; |
| | | border-radius: 6px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05); |
| | | transition: all 0.3s ease; |
| | | |
| | | &:hover { |
| | | box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.08); |
| | | } |
| | | |
| | | .search_title { |
| | | color: #606266; |
| | | font-size: 14px; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | .ml10 { |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | | |
| | | .table_list { |
| | | background-color: #ffffff; |
| | | border-radius: 6px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05); |
| | | overflow: hidden; |
| | | height: calc(100vh - 230px); |
| | | } |
| | | |
| | | :deep(.el-table) { |
| | | border: none; |
| | | border-radius: 6px; |
| | | overflow: hidden; |
| | | box-shadow: 0 4px 16px rgba(102, 126, 234, 0.1); |
| | | |
| | | .el-table__header-wrapper { |
| | | background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| | | |
| | | th { |
| | | background: transparent; |
| | | font-weight: 600; |
| | | // color: #ffffff; |
| | | border-bottom: none; |
| | | padding: 16px 0; |
| | | letter-spacing: 0.5px; |
| | | } |
| | | } |
| | | |
| | | .el-table__body-wrapper { |
| | | tr { |
| | | transition: all 0.3s ease; |
| | | |
| | | &:hover { |
| | | background: linear-gradient( |
| | | 90deg, |
| | | rgba(102, 126, 234, 0.05) 0%, |
| | | rgba(118, 75, 162, 0.05) 100% |
| | | ); |
| | | transform: scale(1.002); |
| | | box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1); |
| | | } |
| | | |
| | | td { |
| | | border-bottom: 1px solid #f0f0f0; |
| | | padding: 14px 0; |
| | | color: #303133; |
| | | } |
| | | } |
| | | |
| | | tr.current-row { |
| | | background: linear-gradient( |
| | | 90deg, |
| | | rgba(102, 126, 234, 0.08) 0%, |
| | | rgba(118, 75, 162, 0.08) 100% |
| | | ); |
| | | } |
| | | |
| | | // æ°å¼åæ®µæ ·å¼ |
| | | .quantity-cell, |
| | | .volume-cell, |
| | | .dimension-cell { |
| | | font-weight: 600; |
| | | color: #409eff; |
| | | font-family: "Courier New", monospace; |
| | | text-shadow: 0 1px 2px rgba(64, 158, 255, 0.2); |
| | | } |
| | | |
| | | // è§æ ¼åæ®µæ ·å¼ |
| | | .spec-cell { |
| | | color: #67c23a; |
| | | font-weight: 500; |
| | | padding: 4px 8px; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | // ç¼ç åæ®µæ ·å¼ |
| | | .code-cell { |
| | | color: #e6a23c; |
| | | font-family: "Courier New", monospace; |
| | | font-weight: 500; |
| | | padding: 4px 8px; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | // æ¥æåæ®µæ ·å¼ |
| | | .date-cell { |
| | | color: #909399; |
| | | font-style: italic; |
| | | } |
| | | } |
| | | |
| | | .el-table__empty-block { |
| | | padding: 60px 0; |
| | | background-color: #fafafa; |
| | | } |
| | | } |
| | | |
| | | .pagination-container { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | padding: 16px 20px; |
| | | background-color: #ffffff; |
| | | border-top: 1px solid #ebeef5; |
| | | border-radius: 0 0 12px 12px; |
| | | } |
| | | |
| | | :deep(.el-button) { |
| | | transition: all 0.3s ease; |
| | | |
| | | &:hover { |
| | | transform: translateY(-1px); |
| | | } |
| | | } |
| | | |
| | | @media (max-width: 768px) { |
| | | .app-container { |
| | | padding: 16px; |
| | | } |
| | | |
| | | .search_form { |
| | | flex-direction: column; |
| | | align-items: flex-start; |
| | | gap: 12px; |
| | | |
| | | .el-form { |
| | | width: 100%; |
| | | |
| | | .el-form-item { |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | .el-button { |
| | | margin-right: 12px; |
| | | } |
| | | } |
| | | |
| | | :deep(.el-table) { |
| | | th, |
| | | td { |
| | | padding: 10px 0; |
| | | font-size: 12px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <PageHeader content="å·¥èºè·¯çº¿é¡¹ç®" /> |
| | | |
| | | <!-- å·¥èºè·¯çº¿ä¿¡æ¯å±ç¤º --> |
| | | <el-card v-if="routeInfo.processRouteCode" class="route-info-card" shadow="hover"> |
| | | <el-card v-if="routeInfo.processRouteCode" |
| | | class="route-info-card" |
| | | shadow="hover"> |
| | | <div class="route-info"> |
| | | <div class="info-item"> |
| | | <div class="info-label-wrapper"> |
| | |
| | | <span class="info-value">{{ routeInfo.bomNo || '-' }}</span> |
| | | </div> |
| | | </div> |
| | | <div class="info-item full-width" v-if="routeInfo.description"> |
| | | <div class="info-item full-width" |
| | | v-if="routeInfo.description"> |
| | | <div class="info-label-wrapper"> |
| | | <span class="info-label">æè¿°</span> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | | |
| | | <!-- è¡¨æ ¼è§å¾ --> |
| | | <div v-if="viewMode === 'table'" class="section-header"> |
| | | <div v-if="viewMode === 'table'" |
| | | class="section-header"> |
| | | <div class="section-title">å·¥èºè·¯çº¿é¡¹ç®å表</div> |
| | | <div class="section-actions"> |
| | | <el-button |
| | | icon="Grid" |
| | | @click="toggleView" |
| | | style="margin-right: 10px;" |
| | | > |
| | | <el-button icon="Grid" |
| | | @click="toggleView" |
| | | style="margin-right: 10px;"> |
| | | å¡çè§å¾ |
| | | </el-button> |
| | | <el-button type="primary" @click="handleAdd">æ°å¢</el-button> |
| | | <el-button type="primary" |
| | | @click="handleAdd">æ°å¢</el-button> |
| | | </div> |
| | | </div> |
| | | <el-table |
| | | v-if="viewMode === 'table'" |
| | | ref="tableRef" |
| | | v-loading="tableLoading" |
| | | border |
| | | :data="tableData" |
| | | :header-cell-style="{ background: '#F0F1F5', color: '#333333' }" |
| | | row-key="id" |
| | | tooltip-effect="dark" |
| | | class="lims-table" |
| | | > |
| | | <el-table-column align="center" label="åºå·" width="60" type="index" /> |
| | | <el-table-column label="å·¥åºåç§°" prop="processId" width="200"> |
| | | <el-table v-if="viewMode === 'table'" |
| | | ref="tableRef" |
| | | v-loading="tableLoading" |
| | | border |
| | | :data="tableData" |
| | | :header-cell-style="{ background: '#F0F1F5', color: '#333333' }" |
| | | row-key="id" |
| | | tooltip-effect="dark" |
| | | class="lims-table"> |
| | | <el-table-column align="center" |
| | | label="åºå·" |
| | | width="60" |
| | | type="index" /> |
| | | <el-table-column label="å·¥åºåç§°" |
| | | prop="processId" |
| | | width="200"> |
| | | <template #default="scope"> |
| | | {{ getProcessName(scope.row.processId) || '-' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="产ååç§°" prop="productName" min-width="160" /> |
| | | <el-table-column label="è§æ ¼åç§°" prop="model" min-width="140" /> |
| | | <el-table-column label="åä½" prop="unit" width="100" /> |
| | | <el-table-column label="æ¯å¦è´¨æ£" prop="isQuality" width="100"> |
| | | <el-table-column label="åæ°å表" |
| | | min-width="160"> |
| | | <template #default="scope"> |
| | | <el-button type="primary" |
| | | link |
| | | size="small" |
| | | @click="handleViewParams(scope.row)">åæ°å表</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="产ååç§°" |
| | | prop="productName" |
| | | min-width="160" /> |
| | | <el-table-column label="è§æ ¼åç§°" |
| | | prop="model" |
| | | min-width="140" /> |
| | | <el-table-column label="åä½" |
| | | prop="unit" |
| | | width="100" /> |
| | | <el-table-column label="æ¯å¦è´¨æ£" |
| | | prop="isQuality" |
| | | width="100"> |
| | | <template #default="scope"> |
| | | {{scope.row.isQuality ? "æ¯" : "å¦"}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" align="center" fixed="right" width="150"> |
| | | <el-table-column label="æä½" |
| | | align="center" |
| | | fixed="right" |
| | | width="150"> |
| | | <template #default="scope"> |
| | | <el-button type="primary" link size="small" @click="handleEdit(scope.row)" :disabled="scope.row.isComplete">ç¼è¾</el-button> |
| | | <el-button type="danger" link size="small" @click="handleDelete(scope.row)" :disabled="scope.row.isComplete">å é¤</el-button> |
| | | <el-button type="primary" |
| | | link |
| | | size="small" |
| | | @click="handleEdit(scope.row)" |
| | | :disabled="scope.row.isComplete">ç¼è¾</el-button> |
| | | <el-button type="danger" |
| | | link |
| | | size="small" |
| | | @click="handleDelete(scope.row)" |
| | | :disabled="scope.row.isComplete">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <!-- å¡çè§å¾ --> |
| | | <template v-else> |
| | | <div class="section-header"> |
| | | <div class="section-title">å·¥èºè·¯çº¿é¡¹ç®å表</div> |
| | | <div class="section-actions"> |
| | | <el-button |
| | | icon="Menu" |
| | | @click="toggleView" |
| | | style="margin-right: 10px;" |
| | | > |
| | | <el-button icon="Menu" |
| | | @click="toggleView" |
| | | style="margin-right: 10px;"> |
| | | è¡¨æ ¼è§å¾ |
| | | </el-button> |
| | | <el-button type="primary" @click="handleAdd">æ°å¢</el-button> |
| | | <el-button type="primary" |
| | | @click="handleAdd">æ°å¢</el-button> |
| | | </div> |
| | | </div> |
| | | <div v-loading="tableLoading" class="card-container"> |
| | | <div |
| | | ref="cardsContainer" |
| | | class="cards-wrapper" |
| | | > |
| | | <div |
| | | v-for="(item, index) in tableData" |
| | | :key="item.id || index" |
| | | class="process-card" |
| | | :data-index="index" |
| | | > |
| | | <!-- åºå·åå --> |
| | | <div class="card-header"> |
| | | <div class="card-number">{{ index + 1 }}</div> |
| | | <div class="card-process-name">{{ getProcessName(item.processId) || '-' }}</div> |
| | | </div> |
| | | |
| | | <!-- 产åä¿¡æ¯ --> |
| | | <div class="card-content"> |
| | | <div v-if="item.productName" class="product-info"> |
| | | <div class="product-name">{{ item.productName }}</div> |
| | | <div v-if="item.model" class="product-model"> |
| | | {{ item.model }} |
| | | <!-- <span v-if="item.unit" class="product-unit">{{ item.unit }}</span> --> |
| | | </div> |
| | | <el-tag type="primary" class="product-tag" v-if="item.isQuality">è´¨æ£</el-tag> |
| | | <div v-loading="tableLoading" |
| | | class="card-container"> |
| | | <div ref="cardsContainer" |
| | | class="cards-wrapper"> |
| | | <div v-for="(item, index) in tableData" |
| | | :key="item.id || index" |
| | | class="process-card" |
| | | :data-index="index"> |
| | | <!-- åºå·åå --> |
| | | <div class="card-header"> |
| | | <div class="card-number">{{ index + 1 }}</div> |
| | | <div class="card-process-name">{{ getProcessName(item.processId) || '-' }}</div> |
| | | </div> |
| | | <div v-else class="product-info empty">ææ äº§åä¿¡æ¯</div> |
| | | </div> |
| | | |
| | | <!-- æä½æé® --> |
| | | <div class="card-footer"> |
| | | <el-button type="primary" link size="small" @click="handleEdit(item)" :disabled="item.isComplete">ç¼è¾</el-button> |
| | | <el-button type="danger" link size="small" @click="handleDelete(item)" :disabled="item.isComplete">å é¤</el-button> |
| | | <!-- 产åä¿¡æ¯ --> |
| | | <div class="card-content"> |
| | | <div v-if="item.productName" |
| | | class="product-info"> |
| | | <div class="product-name">{{ item.productName }}</div> |
| | | <div v-if="item.model" |
| | | class="product-model"> |
| | | {{ item.model }} |
| | | <!-- <span v-if="item.unit" class="product-unit">{{ item.unit }}</span> --> |
| | | </div> |
| | | <el-tag type="primary" |
| | | class="product-tag" |
| | | v-if="item.isQuality">è´¨æ£</el-tag> |
| | | </div> |
| | | <div v-else |
| | | class="product-info empty">ææ äº§åä¿¡æ¯</div> |
| | | </div> |
| | | <!-- æä½æé® --> |
| | | <div class="card-footer"> |
| | | <el-button type="primary" |
| | | link |
| | | size="small" |
| | | @click="handleEdit(item)" |
| | | :disabled="item.isComplete">ç¼è¾</el-button> |
| | | <el-button type="info" |
| | | link |
| | | size="small" |
| | | @click="handleViewParams(item)">åæ°å表</el-button> |
| | | <el-button type="danger" |
| | | link |
| | | size="small" |
| | | @click="handleDelete(item)" |
| | | :disabled="item.isComplete">å é¤</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <div class="section-BOM"> |
| | | <div class="section-header"> |
| | | <div class="section-title">BOM</div> |
| | | <div class="section-actions"> |
| | | <el-button type="primary" |
| | | @click="toggleBomEdit"> |
| | | {{ bomDataValue.isEdit ? 'åæ¶' : 'ç¼è¾' }} |
| | | </el-button> |
| | | <el-button v-if=" bomDataValue.isEdit" |
| | | type="success" |
| | | @click="saveBomChanges">ä¿å</el-button> |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <!-- BOMè¡¨æ ¼ --> |
| | | <el-table :data="bomTableData" |
| | | border |
| | | :preserve-expanded-content="false" |
| | | :default-expand-all="true" |
| | | style="width: 100%"> |
| | | <el-table-column type="expand"> |
| | | <template #default="props"> |
| | | <el-form ref="bomFormRef" |
| | | :model="bomDataValue"> |
| | | <el-table :data="props.row.bomList" |
| | | row-key="tempId" |
| | | default-expand-all |
| | | :tree-props="{children: 'children', hasChildren: 'hasChildren'}" |
| | | style="width: 100%"> |
| | | <el-table-column prop="productName" |
| | | label="产å" /> |
| | | <el-table-column prop="model" |
| | | label="è§æ ¼"> |
| | | <template #default="{ row }"> |
| | | <el-form-item v-if="bomDataValue.isEdit" |
| | | :rules="[{ required: true, message: 'è¯·éæ©è§æ ¼', trigger: ['blur','change'] }]" |
| | | style="margin: 0"> |
| | | <el-select v-model="row.model" |
| | | placeholder="è¯·éæ©è§æ ¼" |
| | | clearable |
| | | :disabled="!bomDataValue.isEdit" |
| | | style="width: 100%" |
| | | @visible-change="(v) => { if (v) openBomProductDialog(row.tempId) }"> |
| | | <el-option v-if="row.model" |
| | | :label="row.model" |
| | | :value="row.model" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <span v-else>{{ row.model }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="processName" |
| | | label="æ¶èå·¥åº"> |
| | | <template #default="{ row }"> |
| | | <el-form-item v-if="bomDataValue.isEdit" |
| | | :rules="[{ required: true, message: 'è¯·éæ©æ¶èå·¥åº', trigger: 'change' }]" |
| | | style="margin: 0"> |
| | | <el-select v-model="row.processId" |
| | | placeholder="è¯·éæ©" |
| | | filterable |
| | | clearable |
| | | :disabled="!bomDataValue.isEdit" |
| | | style="width: 100%"> |
| | | <el-option v-for="process in processOptions" |
| | | :key="process.id" |
| | | :label="process.name" |
| | | :value="process.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <span v-else>{{ row.processName }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="unitQuantity" |
| | | label="åä½äº§åºæéæ°é"> |
| | | <template #default="{ row }"> |
| | | <el-form-item v-if="bomDataValue.isEdit" |
| | | :rules="[{ required: true, message: '请è¾å
¥åä½äº§åºæéæ°é', trigger: ['blur','change'] }]" |
| | | style="margin: 0"> |
| | | <el-input-number v-model="row.unitQuantity" |
| | | :min="0" |
| | | :precision="2" |
| | | :step="1" |
| | | controls-position="right" |
| | | style="width: 100%" |
| | | :disabled="!bomDataValue.isEdit" /> |
| | | </el-form-item> |
| | | <span v-else>{{ row.unitQuantity }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-if="pageType === 'order'" |
| | | prop="demandedQuantity" |
| | | label="éæ±æ»é"> |
| | | <template #default="{ row }"> |
| | | <el-form-item v-if="bomDataValue.isEdit" |
| | | :rules="[{ required: true, message: '请è¾å
¥éæ±æ»é', trigger: ['blur','change'] }]" |
| | | style="margin: 0"> |
| | | <el-input-number v-model="row.demandedQuantity" |
| | | :min="0" |
| | | :precision="2" |
| | | :step="1" |
| | | controls-position="right" |
| | | style="width: 100%" |
| | | :disabled="!bomDataValue.isEdit" /> |
| | | </el-form-item> |
| | | <span v-else>{{ row.demandedQuantity }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="unit" |
| | | label="åä½"> |
| | | <template #default="{ row }"> |
| | | <el-form-item v-if="bomDataValue.isEdit" |
| | | :rules="[{ required: true, message: '请è¾å
¥åä½', trigger: ['blur','change'] }]" |
| | | style="margin: 0"> |
| | | <el-input v-model="row.unit" |
| | | placeholder="请è¾å
¥åä½" |
| | | clearable |
| | | :disabled="!bomDataValue.isEdit" /> |
| | | </el-form-item> |
| | | <span v-else>{{ row.unit }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½" |
| | | fixed="right" |
| | | width="180"> |
| | | <template #default="{ row }"> |
| | | <el-button v-if="bomDataValue.isEdit" |
| | | type="danger" |
| | | text |
| | | size="small" |
| | | @click="removeBomItem(row.tempId)">å é¤</el-button> |
| | | <el-button v-if="bomDataValue.isEdit" |
| | | type="primary" |
| | | text |
| | | size="small" |
| | | @click="addBomItem2(row.tempId)">æ·»å å项</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-form> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="BOMç¼å·" |
| | | prop="bomNo" /> |
| | | <el-table-column label="产ååç§°" |
| | | prop="productName" /> |
| | | <el-table-column label="è§æ ¼åå·" |
| | | prop="model" /> |
| | | </el-table> |
| | | <!-- <div v-if="bomDataValue.isEdit" |
| | | style="text-align: center;border: 1px solid #e4e7ed;padding: 10px;transition: all 0.3s ease;cursor: pointer;" |
| | | :class="{'hover-effect': bomDataValue.isEdit}"> |
| | | <el-button type="primary" |
| | | text |
| | | @click="addBomItem"> |
| | | <el-icon style="vertical-align: middle;margin-right: 5px;"> |
| | | <Plus /> |
| | | </el-icon> |
| | | æ·»å |
| | | </el-button> |
| | | </div> --> |
| | | </div> |
| | | </div> |
| | | <!-- æ°å¢/ç¼è¾å¼¹çª --> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | :title="operationType === 'add' ? 'æ°å¢å·¥èºè·¯çº¿é¡¹ç®' : 'ç¼è¾å·¥èºè·¯çº¿é¡¹ç®'" |
| | | width="500px" |
| | | @close="closeDialog" |
| | | > |
| | | <el-form |
| | | ref="formRef" |
| | | :model="form" |
| | | :rules="rules" |
| | | label-width="120px" |
| | | > |
| | | <el-form-item label="å·¥åº" prop="processId"> |
| | | <el-select |
| | | v-model="form.processId" |
| | | placeholder="è¯·éæ©å·¥åº" |
| | | clearable |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="process in processOptions" |
| | | :key="process.id" |
| | | :label="process.name" |
| | | :value="process.id" |
| | | /> |
| | | <el-dialog v-model="dialogVisible" |
| | | :title="operationType === 'add' ? 'æ°å¢å·¥èºè·¯çº¿é¡¹ç®' : 'ç¼è¾å·¥èºè·¯çº¿é¡¹ç®'" |
| | | width="500px" |
| | | @close="closeDialog"> |
| | | <el-form ref="formRef" |
| | | :model="form" |
| | | :rules="rules" |
| | | label-width="120px"> |
| | | <el-form-item label="å·¥åº" |
| | | prop="processId"> |
| | | <el-select v-model="form.processId" |
| | | placeholder="è¯·éæ©å·¥åº" |
| | | clearable |
| | | style="width: 100%"> |
| | | <el-option v-for="process in processOptions" |
| | | :key="process.id" |
| | | :label="process.name" |
| | | :value="process.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="产ååç§°" prop="productModelId"> |
| | | <el-button type="primary" @click="showProductSelectDialog = true"> |
| | | <el-form-item label="产ååç§°" |
| | | prop="productModelId"> |
| | | <el-button type="primary" |
| | | @click="showProductSelectDialog = true"> |
| | | {{ form.productName && form.model |
| | | ? `${form.productName} - ${form.model}` |
| | | : 'éæ©äº§å' }} |
| | | </el-button> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="åä½" prop="unit"> |
| | | <el-input |
| | | v-model="form.unit" |
| | | :placeholder="form.productModelId ? 'æ ¹æ®éæ©ç产åèªå¨å¸¦åº' : '请å
éæ©äº§å'" |
| | | clearable |
| | | :disabled="true" |
| | | /> |
| | | <el-form-item label="åä½" |
| | | prop="unit"> |
| | | <el-input v-model="form.unit" |
| | | :placeholder="form.productModelId ? 'æ ¹æ®éæ©ç产åèªå¨å¸¦åº' : '请å
éæ©äº§å'" |
| | | clearable |
| | | :disabled="true" /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="æ¯å¦è´¨æ£" prop="isQuality"> |
| | | <el-switch v-model="form.isQuality" :active-value="true" inactive-value="false"/> |
| | | <el-form-item label="æ¯å¦è´¨æ£" |
| | | prop="isQuality"> |
| | | <el-switch v-model="form.isQuality" |
| | | :active-value="true" |
| | | inactive-value="false" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <template #footer> |
| | | <el-button type="primary" @click="handleSubmit" :loading="submitLoading">ç¡®å®</el-button> |
| | | <el-button type="primary" |
| | | @click="handleSubmit" |
| | | :loading="submitLoading">ç¡®å®</el-button> |
| | | <el-button @click="closeDialog">åæ¶</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <!-- 产åéæ©å¯¹è¯æ¡ --> |
| | | <ProductSelectDialog |
| | | v-model="showProductSelectDialog" |
| | | @confirm="handleProductSelect" |
| | | single |
| | | /> |
| | | <ProductSelectDialog v-model="showProductSelectDialog" |
| | | @confirm="handleProductSelect" |
| | | single /> |
| | | <!-- BOM产åéæ©å¯¹è¯æ¡ --> |
| | | <ProductSelectDialog v-model="bomDataValue.showProductDialog" |
| | | @confirm="handleBomProductSelect" |
| | | single /> |
| | | <!-- åæ°åè¡¨å¯¹è¯æ¡ --> |
| | | <!-- :editable="!routeInfo.status" --> |
| | | <ProcessParamListDialog v-model="showParamListDialog" |
| | | :title="`${currentProcess ? (currentProcess.processName || getProcessName(currentProcess.processId)) : ''} - åæ°å表`" |
| | | :route-id="routeId" |
| | | :order-id="orderId" |
| | | :process="currentProcess" |
| | | :page-type="pageType" |
| | | :param-list="paramList" |
| | | @refresh="refreshParamList" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, computed, getCurrentInstance, onMounted, onUnmounted, nextTick } from "vue"; |
| | | import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue"; |
| | | import { findProcessRouteItemList, addOrUpdateProcessRouteItem, sortProcessRouteItem, batchDeleteProcessRouteItem } from "@/api/productionManagement/processRouteItem.js"; |
| | | import { findProductProcessRouteItemList, deleteRouteItem, addRouteItem, addOrUpdateProductProcessRouteItem, sortRouteItem } from "@/api/productionManagement/productProcessRoute.js"; |
| | | import { processList } from "@/api/productionManagement/productionProcess.js"; |
| | | import { useRoute } from 'vue-router' |
| | | import { ElMessageBox } from 'element-plus' |
| | | import Sortable from 'sortablejs' |
| | | import { |
| | | ref, |
| | | computed, |
| | | getCurrentInstance, |
| | | onMounted, |
| | | onUnmounted, |
| | | nextTick, |
| | | } from "vue"; |
| | | import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue"; |
| | | import ProcessParamListDialog from "@/components/ProcessParamListDialog.vue"; |
| | | import { |
| | | findProcessRouteItemList, |
| | | addOrUpdateProcessRouteItem, |
| | | sortProcessRouteItem, |
| | | batchDeleteProcessRouteItem, |
| | | getProcessParamList, |
| | | } from "@/api/productionManagement/processRouteItem.js"; |
| | | import { |
| | | findProductProcessRouteItemList, |
| | | deleteRouteItem, |
| | | addRouteItem, |
| | | findProcessParamListOrder, |
| | | addOrUpdateProductProcessRouteItem, |
| | | sortRouteItem, |
| | | } from "@/api/productionManagement/productProcessRoute.js"; |
| | | import { processList } from "@/api/productionManagement/productionProcess.js"; |
| | | import { |
| | | queryList2, |
| | | queryList, |
| | | add2, |
| | | } from "@/api/productionManagement/productStructure.js"; |
| | | import { useRoute } from "vue-router"; |
| | | import { ElMessageBox, ElMessage } from "element-plus"; |
| | | import Sortable from "sortablejs"; |
| | | |
| | | const route = useRoute() |
| | | const { proxy } = getCurrentInstance() || {}; |
| | | const route = useRoute(); |
| | | const { proxy } = getCurrentInstance() || {}; |
| | | |
| | | const routeId = computed(() => route.query.id); |
| | | const orderId = computed(() => route.query.orderId); |
| | | const pageType = computed(() => route.query.type); |
| | | const routeId = computed(() => route.query.id); |
| | | const orderId = computed(() => route.query.orderId); |
| | | const pageType = computed(() => route.query.type); |
| | | |
| | | const tableLoading = ref(false); |
| | | const tableData = ref([]); |
| | | const dialogVisible = ref(false); |
| | | const operationType = ref('add'); // add | edit |
| | | const formRef = ref(null); |
| | | const submitLoading = ref(false); |
| | | const cardsContainer = ref(null); |
| | | const tableRef = ref(null); |
| | | const viewMode = ref('table'); // table | card |
| | | const routeInfo = ref({ |
| | | processRouteCode: '', |
| | | productName: '', |
| | | model: '', |
| | | bomNo: '', |
| | | description: '' |
| | | }); |
| | | |
| | | const processOptions = ref([]); |
| | | const showProductSelectDialog = ref(false); |
| | | let tableSortable = null; |
| | | let cardSortable = null; |
| | | |
| | | // 忢è§å¾ |
| | | const toggleView = () => { |
| | | viewMode.value = viewMode.value === 'table' ? 'card' : 'table'; |
| | | // 忢è§å¾åéæ°åå§åææ½æåº |
| | | nextTick(() => { |
| | | initSortable(); |
| | | const tableLoading = ref(false); |
| | | const tableData = ref([]); |
| | | const dialogVisible = ref(false); |
| | | const operationType = ref("add"); // add | edit |
| | | const formRef = ref(null); |
| | | const submitLoading = ref(false); |
| | | const cardsContainer = ref(null); |
| | | const tableRef = ref(null); |
| | | const viewMode = ref("card"); // table | card |
| | | const routeInfo = ref({ |
| | | processRouteCode: "", |
| | | productName: "", |
| | | model: "", |
| | | bomNo: "", |
| | | description: "", |
| | | }); |
| | | }; |
| | | |
| | | const form = ref({ |
| | | id: undefined, |
| | | routeId: routeId.value, |
| | | processId: undefined, |
| | | productModelId: undefined, |
| | | productName: "", |
| | | model: "", |
| | | unit: "", |
| | | isQuality: false, |
| | | }); |
| | | |
| | | const rules = { |
| | | processId: [{ required: true, message: 'è¯·éæ©å·¥åº', trigger: 'change' }], |
| | | productModelId: [{ required: true, message: 'è¯·éæ©äº§å', trigger: 'change' }], |
| | | }; |
| | | |
| | | // æ ¹æ®å·¥åºIDè·åå·¥åºåç§° |
| | | const getProcessName = (processId) => { |
| | | if (!processId) return ''; |
| | | const process = processOptions.value.find(p => p.id === processId); |
| | | return process ? process.name : ''; |
| | | }; |
| | | |
| | | // è·åå表 |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | const listPromise = |
| | | pageType.value === "order" |
| | | ? findProductProcessRouteItemList({ orderId: orderId.value }) |
| | | : findProcessRouteItemList({ routeId: routeId.value }); |
| | | |
| | | listPromise |
| | | .then(res => { |
| | | tableData.value = res.data || []; |
| | | tableLoading.value = false; |
| | | // å表å è½½å®æååå§åææ½æåº |
| | | nextTick(() => { |
| | | initSortable(); |
| | | }); |
| | | }) |
| | | .catch(err => { |
| | | tableLoading.value = false; |
| | | console.error("è·åå表失败ï¼", err); |
| | | proxy?.$modal?.msgError("è·åå表失败"); |
| | | }); |
| | | }; |
| | | |
| | | // è·åå·¥åºå表 |
| | | const getProcessList = () => { |
| | | processList({}) |
| | | .then(res => { |
| | | processOptions.value = res.data || []; |
| | | }) |
| | | .catch(err => { |
| | | console.error("è·åå·¥åºå¤±è´¥ï¼", err); |
| | | }); |
| | | }; |
| | | |
| | | // è·åå·¥èºè·¯çº¿è¯¦æ
ï¼ä»è·¯ç±åæ°è·åï¼ |
| | | const getRouteInfo = () => { |
| | | routeInfo.value = { |
| | | processRouteCode: route.query.processRouteCode || '', |
| | | productName: route.query.productName || '', |
| | | model: route.query.model || '', |
| | | bomNo: route.query.bomNo || '', |
| | | description: route.query.description || '' |
| | | }; |
| | | }; |
| | | |
| | | // æ°å¢ |
| | | const handleAdd = () => { |
| | | operationType.value = 'add'; |
| | | resetForm(); |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | // ç¼è¾ |
| | | const handleEdit = (row) => { |
| | | operationType.value = 'edit'; |
| | | form.value = { |
| | | id: row.id, |
| | | routeId: routeId.value, |
| | | processId: row.processId, |
| | | productModelId: row.productModelId, |
| | | productName: row.productName || "", |
| | | model: row.model || "", |
| | | unit: row.unit || "", |
| | | isQuality: row.isQuality, |
| | | }; |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | // å é¤ |
| | | const handleDelete = (row) => { |
| | | ElMessageBox.confirm('确认å é¤è¯¥å·¥èºè·¯çº¿é¡¹ç®ï¼', 'æç¤º', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }) |
| | | .then(() => { |
| | | // ç产订åä¸ä½¿ç¨ productProcessRoute çå 餿¥å£ï¼è·¯ç±åæ¼æ¥ idï¼ï¼å
¶å®æ
åµä½¿ç¨å·¥èºè·¯çº¿é¡¹ç®æ¹éå 餿¥å£ |
| | | const deletePromise = |
| | | pageType.value === 'order' |
| | | ? deleteRouteItem(row.id) |
| | | : batchDeleteProcessRouteItem([row.id]); |
| | | |
| | | deletePromise |
| | | .then(() => { |
| | | proxy?.$modal?.msgSuccess('å 餿å'); |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | proxy?.$modal?.msgError('å é¤å¤±è´¥'); |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | |
| | | // 产åéæ© |
| | | const handleProductSelect = (products) => { |
| | | if (products && products.length > 0) { |
| | | const product = products[0]; |
| | | form.value.productModelId = product.id; |
| | | form.value.productName = product.productName; |
| | | form.value.model = product.model; |
| | | form.value.unit = product.unit || ""; |
| | | showProductSelectDialog.value = false; |
| | | // 触å表åéªè¯ |
| | | formRef.value?.validateField('productModelId'); |
| | | } |
| | | }; |
| | | |
| | | // æäº¤ |
| | | const handleSubmit = () => { |
| | | formRef.value.validate((valid) => { |
| | | if (valid) { |
| | | submitLoading.value = true; |
| | | |
| | | if (operationType.value === 'add') { |
| | | // æ°å¢ï¼ä¼ å个对象ï¼å
å«dragSortåæ®µ |
| | | // dragSort = å½åå表é¿åº¦ + 1ï¼è¡¨ç¤ºæ°å¢è®°å½æå¨æå |
| | | const dragSort = tableData.value.length + 1; |
| | | const isOrderPage = pageType.value === 'order'; |
| | | |
| | | const addPromise = isOrderPage |
| | | ? addRouteItem({ |
| | | productOrderId: orderId.value, |
| | | productRouteId: routeId.value, |
| | | processId: form.value.processId, |
| | | productModelId: form.value.productModelId, |
| | | isQuality: form.value.isQuality, |
| | | dragSort, |
| | | }) |
| | | : addOrUpdateProcessRouteItem({ |
| | | routeId: routeId.value, |
| | | processId: form.value.processId, |
| | | productModelId: form.value.productModelId, |
| | | isQuality: form.value.isQuality, |
| | | dragSort, |
| | | }); |
| | | |
| | | addPromise |
| | | .then(() => { |
| | | proxy?.$modal?.msgSuccess('æ°å¢æå'); |
| | | closeDialog(); |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | proxy?.$modal?.msgError('æ°å¢å¤±è´¥'); |
| | | }) |
| | | .finally(() => { |
| | | submitLoading.value = false; |
| | | }); |
| | | } else { |
| | | // ç¼è¾ï¼ç产订åä¸ä½¿ç¨ productProcessRoute/updateRouteItemï¼å
¶å®æ
åµä½¿ç¨å·¥èºè·¯çº¿é¡¹ç®æ´æ°æ¥å£ |
| | | const isOrderPage = pageType.value === 'order'; |
| | | |
| | | const updatePromise = isOrderPage |
| | | ? addOrUpdateProductProcessRouteItem({ |
| | | id: form.value.id, |
| | | processId: form.value.processId, |
| | | productModelId: form.value.productModelId, |
| | | isQuality: form.value.isQuality, |
| | | }) |
| | | : addOrUpdateProcessRouteItem({ |
| | | routeId: routeId.value, |
| | | processId: form.value.processId, |
| | | productModelId: form.value.productModelId, |
| | | id: form.value.id, |
| | | isQuality: form.value.isQuality, |
| | | }); |
| | | |
| | | updatePromise |
| | | .then(() => { |
| | | proxy?.$modal?.msgSuccess('ä¿®æ¹æå'); |
| | | closeDialog(); |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | proxy?.$modal?.msgError('ä¿®æ¹å¤±è´¥'); |
| | | }) |
| | | .finally(() => { |
| | | submitLoading.value = false; |
| | | }); |
| | | } |
| | | } |
| | | const processOptions = ref([]); |
| | | const showProductSelectDialog = ref(false); |
| | | const showParamListDialog = ref(false); |
| | | const currentProcess = ref(null); |
| | | const paramList = ref([]); |
| | | const bomTableData = ref([]); |
| | | const bomFormRef = ref(null); |
| | | const bomDataValue = ref({ |
| | | dataList: [], |
| | | showProductDialog: false, |
| | | currentRowName: null, |
| | | loading: false, |
| | | isEdit: false, |
| | | }); |
| | | }; |
| | | let tableSortable = null; |
| | | let cardSortable = null; |
| | | |
| | | // é置表å |
| | | const resetForm = () => { |
| | | form.value = { |
| | | // 忢è§å¾ |
| | | const toggleView = () => { |
| | | viewMode.value = viewMode.value === "table" ? "card" : "table"; |
| | | // 忢è§å¾åéæ°åå§åææ½æåº |
| | | nextTick(() => { |
| | | initSortable(); |
| | | }); |
| | | }; |
| | | |
| | | const form = ref({ |
| | | id: undefined, |
| | | routeId: routeId.value, |
| | | processId: undefined, |
| | |
| | | productName: "", |
| | | model: "", |
| | | unit: "", |
| | | isQuality: false, |
| | | }); |
| | | |
| | | const rules = { |
| | | processId: [{ required: true, message: "è¯·éæ©å·¥åº", trigger: "change" }], |
| | | productModelId: [ |
| | | { required: true, message: "è¯·éæ©äº§å", trigger: "change" }, |
| | | ], |
| | | }; |
| | | formRef.value?.resetFields(); |
| | | }; |
| | | |
| | | // å
³éå¼¹çª |
| | | const closeDialog = () => { |
| | | dialogVisible.value = false; |
| | | resetForm(); |
| | | }; |
| | | // æ ¹æ®å·¥åºIDè·åå·¥åºåç§° |
| | | const getProcessName = processId => { |
| | | if (!processId) return ""; |
| | | const process = processOptions.value.find(p => p.id === processId); |
| | | return process ? process.name : ""; |
| | | }; |
| | | |
| | | // åå§åææ½æåº |
| | | const initSortable = () => { |
| | | destroySortable(); |
| | | |
| | | if (viewMode.value === 'table') { |
| | | // è¡¨æ ¼è§å¾çææ½æåº |
| | | if (!tableRef.value) return; |
| | | |
| | | const tbody = tableRef.value.$el.querySelector('.el-table__body tbody') || |
| | | tableRef.value.$el.querySelector('.el-table__body-wrapper > table > tbody'); |
| | | |
| | | if (!tbody) return; |
| | | // è·åå表 |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | const listPromise = |
| | | pageType.value === "order" |
| | | ? findProductProcessRouteItemList({ orderId: orderId.value }) |
| | | : findProcessRouteItemList({ routeId: routeId.value }); |
| | | |
| | | tableSortable = new Sortable(tbody, { |
| | | animation: 150, |
| | | ghostClass: 'sortable-ghost', |
| | | handle: '.el-table__row', |
| | | filter: '.el-button, .el-select', |
| | | onEnd: (evt) => { |
| | | if (evt.oldIndex === evt.newIndex || !tableData.value[evt.oldIndex]) return; |
| | | listPromise |
| | | .then(res => { |
| | | tableData.value = res.data || []; |
| | | tableLoading.value = false; |
| | | // å表å è½½å®æååå§åææ½æåº |
| | | nextTick(() => { |
| | | initSortable(); |
| | | }); |
| | | }) |
| | | .catch(err => { |
| | | tableLoading.value = false; |
| | | console.error("è·åå表失败ï¼", err); |
| | | proxy?.$modal?.msgError("è·åå表失败"); |
| | | }); |
| | | }; |
| | | |
| | | // éæ°æåºæ°ç» |
| | | const moveItem = tableData.value.splice(evt.oldIndex, 1)[0]; |
| | | tableData.value.splice(evt.newIndex, 0, moveItem); |
| | | |
| | | // è®¡ç®æ°çåºå·ï¼dragSortä»1å¼å§ï¼ |
| | | const newIndex = evt.newIndex; |
| | | const dragSort = newIndex + 1; |
| | | |
| | | // è°ç¨æåºæ¥å£ |
| | | if (moveItem.id) { |
| | | const isOrderPage = pageType.value === 'order'; |
| | | const sortPromise = isOrderPage |
| | | ? sortRouteItem({ |
| | | id: moveItem.id, |
| | | dragSort: dragSort |
| | | }) |
| | | : sortProcessRouteItem({ |
| | | id: moveItem.id, |
| | | dragSort: dragSort |
| | | }); |
| | | // è·åå·¥åºå表 |
| | | const getProcessList = () => { |
| | | processList({}) |
| | | .then(res => { |
| | | processOptions.value = res.data || []; |
| | | }) |
| | | .catch(err => { |
| | | console.error("è·åå·¥åºå¤±è´¥ï¼", err); |
| | | }); |
| | | }; |
| | | |
| | | sortPromise |
| | | .then(() => { |
| | | // æ´æ°ææè¡çdragSort |
| | | tableData.value.forEach((item, index) => { |
| | | if (item.id) { |
| | | item.dragSort = index + 1; |
| | | // è·åå·¥èºè·¯çº¿è¯¦æ
ï¼ä»è·¯ç±åæ°è·åï¼ |
| | | const getRouteInfo = () => { |
| | | routeInfo.value = { |
| | | processRouteCode: route.query.processRouteCode || "", |
| | | productName: route.query.productName || "", |
| | | model: route.query.model || "", |
| | | bomNo: route.query.bomNo || "", |
| | | description: route.query.description || "", |
| | | status: !(route.query.status == 1 || route.query.status === "false"), |
| | | }; |
| | | if (pageType.value === "order") { |
| | | queryList2(route.query.orderId) |
| | | .then(res => { |
| | | if (res.data) { |
| | | // 为BOMæ°æ®è®¾ç½®tempId |
| | | const setTempIdRecursively = items => { |
| | | items.forEach(item => { |
| | | item.tempId = item.id || new Date().getTime(); |
| | | if (item.children && item.children.length > 0) { |
| | | setTempIdRecursively(item.children); |
| | | } |
| | | }); |
| | | proxy?.$modal?.msgSuccess('æåºæå'); |
| | | }; |
| | | setTempIdRecursively(res.data); |
| | | |
| | | bomTableData.value = [ |
| | | { |
| | | bomNo: routeInfo.value.bomNo, |
| | | dictLabel: routeInfo.value.dictLabel, |
| | | productCode: "", |
| | | productName: routeInfo.value.productName, |
| | | model: routeInfo.value.model, |
| | | bomList: res.data, |
| | | }, |
| | | ]; |
| | | |
| | | // ä¿ååå§BOMæ°æ® |
| | | bomDataValue.value.dataList = res.data; |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.error("è·åBOMæ°æ®å¤±è´¥ï¼", err); |
| | | }); |
| | | } else { |
| | | queryList(Number(route.query.bomId)) |
| | | .then(res => { |
| | | if (res.data) { |
| | | // 为BOMæ°æ®è®¾ç½®tempId |
| | | const setTempIdRecursively = items => { |
| | | items.forEach(item => { |
| | | item.tempId = item.id || new Date().getTime(); |
| | | if (item.children && item.children.length > 0) { |
| | | setTempIdRecursively(item.children); |
| | | } |
| | | }); |
| | | }; |
| | | setTempIdRecursively(res.data); |
| | | |
| | | bomTableData.value = [ |
| | | { |
| | | bomNo: routeInfo.value.bomNo, |
| | | dictLabel: routeInfo.value.dictLabel, |
| | | productCode: "", |
| | | productName: routeInfo.value.productName, |
| | | model: routeInfo.value.model, |
| | | bomList: res.data, |
| | | }, |
| | | ]; |
| | | |
| | | // ä¿ååå§BOMæ°æ® |
| | | bomDataValue.value.dataList = res.data; |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.error("è·åBOMæ°æ®å¤±è´¥ï¼", err); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // æ°å¢ |
| | | const handleAdd = () => { |
| | | operationType.value = "add"; |
| | | resetForm(); |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | // ç¼è¾ |
| | | const handleEdit = row => { |
| | | operationType.value = "edit"; |
| | | form.value = { |
| | | id: row.id, |
| | | routeId: routeId.value, |
| | | processId: row.processId, |
| | | productModelId: row.productModelId, |
| | | productName: row.productName || "", |
| | | model: row.model || "", |
| | | unit: row.unit || "", |
| | | isQuality: row.isQuality, |
| | | }; |
| | | dialogVisible.value = true; |
| | | }; |
| | | |
| | | // å é¤ |
| | | const handleDelete = row => { |
| | | ElMessageBox.confirm("确认å é¤è¯¥å·¥èºè·¯çº¿é¡¹ç®ï¼", "æç¤º", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | // ç产订åä¸ä½¿ç¨ productProcessRoute çå 餿¥å£ï¼è·¯ç±åæ¼æ¥ idï¼ï¼å
¶å®æ
åµä½¿ç¨å·¥èºè·¯çº¿é¡¹ç®æ¹éå 餿¥å£ |
| | | const deletePromise = |
| | | pageType.value === "order" |
| | | ? deleteRouteItem(row.id) |
| | | : batchDeleteProcessRouteItem([row.id]); |
| | | |
| | | deletePromise |
| | | .then(() => { |
| | | proxy?.$modal?.msgSuccess("å 餿å"); |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | proxy?.$modal?.msgError("å é¤å¤±è´¥"); |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | |
| | | // 产åéæ© |
| | | const handleProductSelect = products => { |
| | | if (products && products.length > 0) { |
| | | const product = products[0]; |
| | | form.value.productModelId = product.id; |
| | | form.value.productName = product.productName; |
| | | form.value.model = product.model; |
| | | form.value.unit = product.unit || ""; |
| | | showProductSelectDialog.value = false; |
| | | // 触å表åéªè¯ |
| | | formRef.value?.validateField("productModelId"); |
| | | } |
| | | }; |
| | | |
| | | // æäº¤ |
| | | const handleSubmit = () => { |
| | | formRef.value.validate(valid => { |
| | | if (valid) { |
| | | submitLoading.value = true; |
| | | |
| | | if (operationType.value === "add") { |
| | | // æ°å¢ï¼ä¼ å个对象ï¼å
å«dragSortåæ®µ |
| | | // dragSort = å½åå表é¿åº¦ + 1ï¼è¡¨ç¤ºæ°å¢è®°å½æå¨æå |
| | | const dragSort = tableData.value.length + 1; |
| | | const isOrderPage = pageType.value === "order"; |
| | | |
| | | const addPromise = isOrderPage |
| | | ? addRouteItem({ |
| | | productOrderId: orderId.value, |
| | | productRouteId: routeId.value, |
| | | processId: form.value.processId, |
| | | productModelId: form.value.productModelId, |
| | | isQuality: form.value.isQuality, |
| | | dragSort, |
| | | }) |
| | | : addOrUpdateProcessRouteItem({ |
| | | routeId: routeId.value, |
| | | processId: form.value.processId, |
| | | productModelId: form.value.productModelId, |
| | | isQuality: form.value.isQuality, |
| | | dragSort, |
| | | }); |
| | | |
| | | addPromise |
| | | .then(() => { |
| | | proxy?.$modal?.msgSuccess("æ°å¢æå"); |
| | | closeDialog(); |
| | | getList(); |
| | | }) |
| | | .catch((err) => { |
| | | // æåºå¤±è´¥ï¼æ¢å¤åæ°ç» |
| | | tableData.value.splice(newIndex, 1); |
| | | tableData.value.splice(evt.oldIndex, 0, moveItem); |
| | | proxy?.$modal?.msgError('æåºå¤±è´¥'); |
| | | console.error("æåºå¤±è´¥ï¼", err); |
| | | .catch(() => { |
| | | proxy?.$modal?.msgError("æ°å¢å¤±è´¥"); |
| | | }) |
| | | .finally(() => { |
| | | submitLoading.value = false; |
| | | }); |
| | | } else { |
| | | // ç¼è¾ï¼ç产订åä¸ä½¿ç¨ productProcessRoute/updateRouteItemï¼å
¶å®æ
åµä½¿ç¨å·¥èºè·¯çº¿é¡¹ç®æ´æ°æ¥å£ |
| | | const isOrderPage = pageType.value === "order"; |
| | | |
| | | const updatePromise = isOrderPage |
| | | ? addOrUpdateProductProcessRouteItem({ |
| | | id: form.value.id, |
| | | processId: form.value.processId, |
| | | productModelId: form.value.productModelId, |
| | | isQuality: form.value.isQuality, |
| | | }) |
| | | : addOrUpdateProcessRouteItem({ |
| | | routeId: routeId.value, |
| | | processId: form.value.processId, |
| | | productModelId: form.value.productModelId, |
| | | id: form.value.id, |
| | | isQuality: form.value.isQuality, |
| | | }); |
| | | |
| | | updatePromise |
| | | .then(() => { |
| | | proxy?.$modal?.msgSuccess("ä¿®æ¹æå"); |
| | | closeDialog(); |
| | | getList(); |
| | | }) |
| | | .catch(() => { |
| | | proxy?.$modal?.msgError("ä¿®æ¹å¤±è´¥"); |
| | | }) |
| | | .finally(() => { |
| | | submitLoading.value = false; |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | // å¡çè§å¾çææ½æåº |
| | | if (!cardsContainer.value) return; |
| | | }; |
| | | |
| | | cardSortable = new Sortable(cardsContainer.value, { |
| | | animation: 150, |
| | | ghostClass: 'sortable-ghost', |
| | | handle: '.process-card', |
| | | filter: '.el-button', |
| | | onEnd: (evt) => { |
| | | if (evt.oldIndex === evt.newIndex || !tableData.value[evt.oldIndex]) return; |
| | | // é置表å |
| | | const resetForm = () => { |
| | | form.value = { |
| | | id: undefined, |
| | | routeId: routeId.value, |
| | | processId: undefined, |
| | | productModelId: undefined, |
| | | productName: "", |
| | | model: "", |
| | | unit: "", |
| | | }; |
| | | formRef.value?.resetFields(); |
| | | }; |
| | | |
| | | // éæ°æåºæ°ç» |
| | | const moveItem = tableData.value.splice(evt.oldIndex, 1)[0]; |
| | | tableData.value.splice(evt.newIndex, 0, moveItem); |
| | | |
| | | // è®¡ç®æ°çåºå·ï¼dragSortä»1å¼å§ï¼ |
| | | const newIndex = evt.newIndex; |
| | | const dragSort = newIndex + 1; |
| | | |
| | | // è°ç¨æåºæ¥å£ |
| | | if (moveItem.id) { |
| | | const isOrderPage = pageType.value === 'order'; |
| | | const sortPromise = isOrderPage |
| | | ? sortRouteItem({ |
| | | id: moveItem.id, |
| | | dragSort: dragSort |
| | | }) |
| | | : sortProcessRouteItem({ |
| | | id: moveItem.id, |
| | | dragSort: dragSort |
| | | }); |
| | | // å
³éå¼¹çª |
| | | const closeDialog = () => { |
| | | dialogVisible.value = false; |
| | | resetForm(); |
| | | }; |
| | | |
| | | sortPromise |
| | | .then(() => { |
| | | // æ´æ°ææè¡çdragSort |
| | | tableData.value.forEach((item, index) => { |
| | | if (item.id) { |
| | | item.dragSort = index + 1; |
| | | } |
| | | }); |
| | | proxy?.$modal?.msgSuccess('æåºæå'); |
| | | }) |
| | | .catch((err) => { |
| | | // æåºå¤±è´¥ï¼æ¢å¤åæ°ç» |
| | | tableData.value.splice(newIndex, 1); |
| | | tableData.value.splice(evt.oldIndex, 0, moveItem); |
| | | proxy?.$modal?.msgError('æåºå¤±è´¥'); |
| | | console.error("æåºå¤±è´¥ï¼", err); |
| | | }); |
| | | // æ¥çåæ°å表 |
| | | const handleViewParams = row => { |
| | | currentProcess.value = row; |
| | | const query = { |
| | | routeItemId: row.id, |
| | | orderId: orderId.value, |
| | | }; |
| | | |
| | | const apiPromise = |
| | | pageType.value === "order" |
| | | ? findProcessParamListOrder(query) |
| | | : getProcessParamList(query); |
| | | |
| | | apiPromise |
| | | .then(res => { |
| | | paramList.value = res.data || []; |
| | | showParamListDialog.value = true; |
| | | }) |
| | | .catch(err => { |
| | | console.error("è·ååæ°å表失败ï¼", err); |
| | | proxy?.$modal?.msgError("è·ååæ°å表失败"); |
| | | }); |
| | | }; |
| | | |
| | | // å·æ°åæ°å表 |
| | | const refreshParamList = () => { |
| | | if (currentProcess.value) { |
| | | handleViewParams(currentProcess.value); |
| | | } |
| | | }; |
| | | |
| | | // BOMç¸å
³æ¹æ³ |
| | | // 忢BOMç¼è¾æ¨¡å¼ |
| | | const toggleBomEdit = () => { |
| | | bomDataValue.value.isEdit = !bomDataValue.value.isEdit; |
| | | if (!bomDataValue.value.isEdit) { |
| | | // åæ¶ç¼è¾æ¶éæ°å è½½æ°æ® |
| | | getRouteInfo(); |
| | | } |
| | | }; |
| | | |
| | | // æ·»å BOM项 |
| | | const addBomItem = () => { |
| | | if (bomTableData.value.length > 0) { |
| | | const newItem = { |
| | | parentId: "", |
| | | parentTempId: "", |
| | | productName: "", |
| | | productId: "", |
| | | model: undefined, |
| | | productModelId: undefined, |
| | | processId: "", |
| | | processName: "", |
| | | unitQuantity: 0, |
| | | demandedQuantity: 0, |
| | | unit: "", |
| | | children: [], |
| | | tempId: new Date().getTime(), |
| | | }; |
| | | bomTableData.value[0].bomList.push(newItem); |
| | | } |
| | | }; |
| | | |
| | | // æ·»å BOMå项 |
| | | const addBomItem2 = tempId => { |
| | | const addChildItem = (items, tempId) => { |
| | | for (let i = 0; i < items.length; i++) { |
| | | const item = items[i]; |
| | | if (item.tempId === tempId) { |
| | | if (!item.children) { |
| | | item.children = []; |
| | | } |
| | | item.children.push({ |
| | | parentId: item.id || "", |
| | | parentTempId: item.tempId || "", |
| | | productName: "", |
| | | productId: "", |
| | | model: undefined, |
| | | productModelId: undefined, |
| | | processId: "", |
| | | processName: "", |
| | | unitQuantity: 0, |
| | | demandedQuantity: 0, |
| | | unit: "", |
| | | children: [], |
| | | tempId: new Date().getTime(), |
| | | }); |
| | | return true; |
| | | } |
| | | if (item.children && item.children.length > 0) { |
| | | if (addChildItem(item.children, tempId)) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }; |
| | | return false; |
| | | }; |
| | | |
| | | // éæ¯ææ½æåº |
| | | const destroySortable = () => { |
| | | if (tableSortable) { |
| | | tableSortable.destroy(); |
| | | tableSortable = null; |
| | | } |
| | | if (cardSortable) { |
| | | cardSortable.destroy(); |
| | | cardSortable = null; |
| | | } |
| | | }; |
| | | if (bomTableData.value.length > 0) { |
| | | addChildItem(bomTableData.value[0].bomList, tempId); |
| | | } |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getRouteInfo(); |
| | | getList(); |
| | | getProcessList(); |
| | | }); |
| | | // å é¤BOM项 |
| | | const removeBomItem = tempId => { |
| | | if (bomTableData.value.length > 0) { |
| | | const removeFromList = (items, tempId) => { |
| | | for (let i = 0; i < items.length; i++) { |
| | | const item = items[i]; |
| | | if (item.tempId === tempId) { |
| | | items.splice(i, 1); |
| | | return true; |
| | | } |
| | | if (item.children && item.children.length > 0) { |
| | | if (removeFromList(item.children, tempId)) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | }; |
| | | removeFromList(bomTableData.value[0].bomList, tempId); |
| | | } |
| | | }; |
| | | |
| | | onUnmounted(() => { |
| | | destroySortable(); |
| | | }); |
| | | // æå¼BOM产åéæ©å¯¹è¯æ¡ |
| | | const openBomProductDialog = tempId => { |
| | | bomDataValue.value.currentRowName = tempId; |
| | | bomDataValue.value.showProductDialog = true; |
| | | }; |
| | | |
| | | // å¤çBOM产åéæ© |
| | | const handleBomProductSelect = products => { |
| | | if (products && products.length > 0) { |
| | | const product = products[0]; |
| | | const updateProductInfo = (items, tempId, productData) => { |
| | | for (let i = 0; i < items.length; i++) { |
| | | const item = items[i]; |
| | | if (item.tempId === tempId) { |
| | | item.productName = productData.productName; |
| | | item.model = productData.model; |
| | | item.productModelId = productData.id; |
| | | item.unit = productData.unit || ""; |
| | | return true; |
| | | } |
| | | if (item.children && item.children.length > 0) { |
| | | if (updateProductInfo(item.children, tempId, productData)) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | }; |
| | | |
| | | if (bomTableData.value.length > 0) { |
| | | updateProductInfo( |
| | | bomTableData.value[0].bomList, |
| | | bomDataValue.value.currentRowName, |
| | | product |
| | | ); |
| | | } |
| | | bomDataValue.value.showProductDialog = false; |
| | | } |
| | | }; |
| | | |
| | | // ä¿åBOMæ´æ¹ |
| | | const saveBomChanges = () => { |
| | | const validateBomData = (items, isTopLevel = false) => { |
| | | for (let i = 0; i < items.length; i++) { |
| | | const item = items[i]; |
| | | if (!item.productModelId) { |
| | | ElMessage.error("è¯·éæ©äº§å"); |
| | | return false; |
| | | } |
| | | if (!isTopLevel && !item.processId) { |
| | | ElMessage.error("è¯·éæ©æ¶èå·¥åº"); |
| | | return false; |
| | | } |
| | | if ( |
| | | item.unitQuantity === undefined || |
| | | item.unitQuantity === null || |
| | | item.unitQuantity === 0 |
| | | ) { |
| | | ElMessage.error("请填ååä½äº§åºæéæ°é"); |
| | | return false; |
| | | } |
| | | if ( |
| | | pageType.value === "order" && |
| | | (item.demandedQuantity === undefined || |
| | | item.demandedQuantity === null || |
| | | item.demandedQuantity === 0) |
| | | ) { |
| | | ElMessage.error("请è¾å
¥éæ±æ»é"); |
| | | return false; |
| | | } |
| | | if (item.children && item.children.length > 0) { |
| | | if (!validateBomData(item.children, false)) { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | }; |
| | | |
| | | if (bomTableData.value.length > 0) { |
| | | if (!validateBomData(bomTableData.value[0].bomList, true)) { |
| | | return; |
| | | } |
| | | } |
| | | |
| | | const processBomItem = (item, parentId = null, parentTempId = null) => { |
| | | const cleanItem = { |
| | | id: item.id || null, |
| | | orderId: Number(orderId.value) || null, |
| | | parentId: parentId, |
| | | parentTempId: parentTempId || null, |
| | | productModelId: item.productModelId || null, |
| | | processId: item.processId || null, |
| | | unitQuantity: item.unitQuantity || 0, |
| | | demandedQuantity: item.demandedQuantity || 0, |
| | | unit: item.unit || "", |
| | | tempId: item.tempId || new Date().getTime(), |
| | | bomId: Number(route.query.bomId) || null, |
| | | children: [], |
| | | }; |
| | | |
| | | if (item.children && item.children.length > 0) { |
| | | cleanItem.children = item.children.map(child => |
| | | processBomItem(child, item.id, item.tempId) |
| | | ); |
| | | } |
| | | |
| | | return cleanItem; |
| | | }; |
| | | |
| | | const saveData = { |
| | | orderId: Number(orderId.value), |
| | | bomId: Number(route.query.bomId), |
| | | children: bomTableData.value[0].bomList.map(item => processBomItem(item)), |
| | | }; |
| | | |
| | | const savePromise = |
| | | pageType.value === "order" ? add2(saveData) : add(saveData); |
| | | |
| | | savePromise |
| | | .then(() => { |
| | | proxy?.$modal?.msgSuccess("ä¿åæå"); |
| | | bomDataValue.value.isEdit = false; |
| | | getRouteInfo(); |
| | | }) |
| | | .catch(err => { |
| | | console.error("ä¿åBOM失败ï¼", err); |
| | | proxy?.$modal?.msgError("ä¿å失败"); |
| | | }); |
| | | }; |
| | | |
| | | // åå§åææ½æåº |
| | | const initSortable = () => { |
| | | destroySortable(); |
| | | |
| | | if (viewMode.value === "table") { |
| | | // è¡¨æ ¼è§å¾çææ½æåº |
| | | if (!tableRef.value) return; |
| | | |
| | | const tbody = |
| | | tableRef.value.$el.querySelector(".el-table__body tbody") || |
| | | tableRef.value.$el.querySelector( |
| | | ".el-table__body-wrapper > table > tbody" |
| | | ); |
| | | |
| | | if (!tbody) return; |
| | | |
| | | tableSortable = new Sortable(tbody, { |
| | | animation: 150, |
| | | ghostClass: "sortable-ghost", |
| | | handle: ".el-table__row", |
| | | filter: ".el-button, .el-select", |
| | | onEnd: evt => { |
| | | if (evt.oldIndex === evt.newIndex || !tableData.value[evt.oldIndex]) |
| | | return; |
| | | |
| | | // éæ°æåºæ°ç» |
| | | const moveItem = tableData.value.splice(evt.oldIndex, 1)[0]; |
| | | tableData.value.splice(evt.newIndex, 0, moveItem); |
| | | |
| | | // è®¡ç®æ°çåºå·ï¼dragSortä»1å¼å§ï¼ |
| | | const newIndex = evt.newIndex; |
| | | const dragSort = newIndex + 1; |
| | | |
| | | // è°ç¨æåºæ¥å£ |
| | | if (moveItem.id) { |
| | | const isOrderPage = pageType.value === "order"; |
| | | const sortPromise = isOrderPage |
| | | ? sortRouteItem({ |
| | | id: moveItem.id, |
| | | dragSort: dragSort, |
| | | }) |
| | | : sortProcessRouteItem({ |
| | | id: moveItem.id, |
| | | dragSort: dragSort, |
| | | }); |
| | | |
| | | sortPromise |
| | | .then(() => { |
| | | // æ´æ°ææè¡çdragSort |
| | | tableData.value.forEach((item, index) => { |
| | | if (item.id) { |
| | | item.dragSort = index + 1; |
| | | } |
| | | }); |
| | | proxy?.$modal?.msgSuccess("æåºæå"); |
| | | }) |
| | | .catch(err => { |
| | | // æåºå¤±è´¥ï¼æ¢å¤åæ°ç» |
| | | tableData.value.splice(newIndex, 1); |
| | | tableData.value.splice(evt.oldIndex, 0, moveItem); |
| | | proxy?.$modal?.msgError("æåºå¤±è´¥"); |
| | | console.error("æåºå¤±è´¥ï¼", err); |
| | | }); |
| | | } |
| | | }, |
| | | }); |
| | | } else { |
| | | // å¡çè§å¾çææ½æåº |
| | | if (!cardsContainer.value) return; |
| | | |
| | | cardSortable = new Sortable(cardsContainer.value, { |
| | | animation: 150, |
| | | ghostClass: "sortable-ghost", |
| | | handle: ".process-card", |
| | | filter: ".el-button", |
| | | onEnd: evt => { |
| | | if (evt.oldIndex === evt.newIndex || !tableData.value[evt.oldIndex]) |
| | | return; |
| | | |
| | | // éæ°æåºæ°ç» |
| | | const moveItem = tableData.value.splice(evt.oldIndex, 1)[0]; |
| | | tableData.value.splice(evt.newIndex, 0, moveItem); |
| | | |
| | | // è®¡ç®æ°çåºå·ï¼dragSortä»1å¼å§ï¼ |
| | | const newIndex = evt.newIndex; |
| | | const dragSort = newIndex + 1; |
| | | |
| | | // è°ç¨æåºæ¥å£ |
| | | if (moveItem.id) { |
| | | const isOrderPage = pageType.value === "order"; |
| | | const sortPromise = isOrderPage |
| | | ? sortRouteItem({ |
| | | id: moveItem.id, |
| | | dragSort: dragSort, |
| | | }) |
| | | : sortProcessRouteItem({ |
| | | id: moveItem.id, |
| | | dragSort: dragSort, |
| | | }); |
| | | |
| | | sortPromise |
| | | .then(() => { |
| | | // æ´æ°ææè¡çdragSort |
| | | tableData.value.forEach((item, index) => { |
| | | if (item.id) { |
| | | item.dragSort = index + 1; |
| | | } |
| | | }); |
| | | proxy?.$modal?.msgSuccess("æåºæå"); |
| | | }) |
| | | .catch(err => { |
| | | // æåºå¤±è´¥ï¼æ¢å¤åæ°ç» |
| | | tableData.value.splice(newIndex, 1); |
| | | tableData.value.splice(evt.oldIndex, 0, moveItem); |
| | | proxy?.$modal?.msgError("æåºå¤±è´¥"); |
| | | console.error("æåºå¤±è´¥ï¼", err); |
| | | }); |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // éæ¯ææ½æåº |
| | | const destroySortable = () => { |
| | | if (tableSortable) { |
| | | tableSortable.destroy(); |
| | | tableSortable = null; |
| | | } |
| | | if (cardSortable) { |
| | | cardSortable.destroy(); |
| | | cardSortable = null; |
| | | } |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getRouteInfo(); |
| | | getList(); |
| | | getProcessList(); |
| | | }); |
| | | |
| | | onUnmounted(() => { |
| | | destroySortable(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .card-container { |
| | | padding: 20px 0; |
| | | } |
| | | .card-container { |
| | | padding: 20px 0; |
| | | } |
| | | |
| | | .cards-wrapper { |
| | | display: flex; |
| | | gap: 16px; |
| | | overflow-x: auto; |
| | | padding: 10px 0; |
| | | min-height: 200px; |
| | | } |
| | | .cards-wrapper { |
| | | display: flex; |
| | | gap: 16px; |
| | | overflow-x: auto; |
| | | padding: 10px 0; |
| | | min-height: 200px; |
| | | } |
| | | |
| | | .cards-wrapper::-webkit-scrollbar { |
| | | height: 8px; |
| | | } |
| | | .cards-wrapper::-webkit-scrollbar { |
| | | height: 8px; |
| | | } |
| | | |
| | | .cards-wrapper::-webkit-scrollbar-track { |
| | | background: #f1f1f1; |
| | | border-radius: 4px; |
| | | } |
| | | .cards-wrapper::-webkit-scrollbar-track { |
| | | background: #f1f1f1; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .cards-wrapper::-webkit-scrollbar-thumb { |
| | | background: #c1c1c1; |
| | | border-radius: 4px; |
| | | } |
| | | .cards-wrapper::-webkit-scrollbar-thumb { |
| | | background: #c1c1c1; |
| | | border-radius: 4px; |
| | | } |
| | | |
| | | .cards-wrapper::-webkit-scrollbar-thumb:hover { |
| | | background: #a8a8a8; |
| | | } |
| | | .cards-wrapper::-webkit-scrollbar-thumb:hover { |
| | | background: #a8a8a8; |
| | | } |
| | | |
| | | .process-card { |
| | | flex-shrink: 0; |
| | | width: 220px; |
| | | background: #fff; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
| | | padding: 16px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | cursor: move; |
| | | transition: all 0.3s; |
| | | } |
| | | .process-card { |
| | | flex-shrink: 0; |
| | | width: 220px; |
| | | background: #fff; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
| | | padding: 16px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | cursor: move; |
| | | transition: all 0.3s; |
| | | } |
| | | |
| | | .process-card:hover { |
| | | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); |
| | | transform: translateY(-2px); |
| | | } |
| | | .process-card:hover { |
| | | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); |
| | | transform: translateY(-2px); |
| | | } |
| | | |
| | | .card-header { |
| | | text-align: center; |
| | | margin-bottom: 12px; |
| | | } |
| | | .card-header { |
| | | text-align: center; |
| | | margin-bottom: 12px; |
| | | } |
| | | |
| | | .card-number { |
| | | width: 36px; |
| | | height: 36px; |
| | | line-height: 36px; |
| | | border-radius: 50%; |
| | | background: #409eff; |
| | | color: #fff; |
| | | font-weight: bold; |
| | | font-size: 16px; |
| | | margin: 0 auto 8px; |
| | | } |
| | | .card-number { |
| | | width: 36px; |
| | | height: 36px; |
| | | line-height: 36px; |
| | | border-radius: 50%; |
| | | background: #409eff; |
| | | color: #fff; |
| | | font-weight: bold; |
| | | font-size: 16px; |
| | | margin: 0 auto 8px; |
| | | } |
| | | |
| | | .card-process-name { |
| | | font-size: 14px; |
| | | color: #333; |
| | | font-weight: 500; |
| | | word-break: break-all; |
| | | } |
| | | .card-process-name { |
| | | font-size: 14px; |
| | | color: #333; |
| | | font-weight: 500; |
| | | word-break: break-all; |
| | | } |
| | | |
| | | .card-content { |
| | | flex: 1; |
| | | margin-bottom: 12px; |
| | | min-height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .card-content { |
| | | flex: 1; |
| | | margin-bottom: 12px; |
| | | min-height: 60px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .product-info { |
| | | font-size: 13px; |
| | | color: #666; |
| | | text-align: center; |
| | | width: 100%; |
| | | } |
| | | .product-info { |
| | | font-size: 13px; |
| | | color: #666; |
| | | text-align: center; |
| | | width: 100%; |
| | | } |
| | | |
| | | .product-info.empty { |
| | | color: #999; |
| | | text-align: center; |
| | | padding: 20px 0; |
| | | } |
| | | .product-info.empty { |
| | | color: #999; |
| | | text-align: center; |
| | | padding: 20px 0; |
| | | } |
| | | |
| | | .product-name { |
| | | margin-bottom: 6px; |
| | | word-break: break-all; |
| | | line-height: 1.5; |
| | | text-align: center; |
| | | } |
| | | .product-name { |
| | | margin-bottom: 6px; |
| | | word-break: break-all; |
| | | line-height: 1.5; |
| | | text-align: center; |
| | | } |
| | | |
| | | .product-model { |
| | | color: #909399; |
| | | font-size: 12px; |
| | | word-break: break-all; |
| | | line-height: 1.5; |
| | | text-align: center; |
| | | } |
| | | .product-model { |
| | | color: #909399; |
| | | font-size: 12px; |
| | | word-break: break-all; |
| | | line-height: 1.5; |
| | | text-align: center; |
| | | } |
| | | |
| | | .product-unit { |
| | | margin-left: 4px; |
| | | color: #409eff; |
| | | } |
| | | .product-unit { |
| | | margin-left: 4px; |
| | | color: #409eff; |
| | | } |
| | | |
| | | .product-tag { |
| | | margin: 10px 0; |
| | | } |
| | | .product-tag { |
| | | margin: 10px 0; |
| | | } |
| | | |
| | | .card-footer { |
| | | display: flex; |
| | | justify-content: space-around; |
| | | padding-top: 12px; |
| | | border-top: 1px solid #f0f0f0; |
| | | } |
| | | .card-footer { |
| | | display: flex; |
| | | justify-content: space-around; |
| | | padding-top: 12px; |
| | | border-top: 1px solid #f0f0f0; |
| | | } |
| | | |
| | | .card-footer .el-button { |
| | | padding: 0; |
| | | font-size: 12px; |
| | | } |
| | | .card-footer .el-button { |
| | | padding: 0; |
| | | font-size: 12px; |
| | | } |
| | | |
| | | :deep(.sortable-ghost) { |
| | | opacity: 0.5; |
| | | background-color: #f5f7fa !important; |
| | | } |
| | | :deep(.sortable-ghost) { |
| | | opacity: 0.5; |
| | | background-color: #f5f7fa !important; |
| | | } |
| | | |
| | | :deep(.sortable-drag) { |
| | | opacity: 0.8; |
| | | } |
| | | :deep(.sortable-drag) { |
| | | opacity: 0.8; |
| | | } |
| | | |
| | | /* è¡¨æ ¼è§å¾æ ·å¼ */ |
| | | :deep(.el-table__row) { |
| | | transition: background-color 0.2s; |
| | | cursor: move; |
| | | } |
| | | /* è¡¨æ ¼è§å¾æ ·å¼ */ |
| | | :deep(.el-table__row) { |
| | | transition: background-color 0.2s; |
| | | cursor: move; |
| | | } |
| | | |
| | | :deep(.el-table__row:hover) { |
| | | background-color: #f9fafc !important; |
| | | } |
| | | :deep(.el-table__row:hover) { |
| | | background-color: #f9fafc !important; |
| | | } |
| | | |
| | | /* åºåæ 颿 ·å¼ */ |
| | | .section-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 12px; |
| | | } |
| | | /* åºåæ 颿 ·å¼ */ |
| | | .section-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 12px; |
| | | } |
| | | |
| | | .section-title { |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | color: #303133; |
| | | padding-left: 12px; |
| | | position: relative; |
| | | margin-bottom: 0; |
| | | } |
| | | .section-title { |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | color: #303133; |
| | | padding-left: 12px; |
| | | position: relative; |
| | | margin-bottom: 0; |
| | | } |
| | | |
| | | .section-title::before { |
| | | content: ''; |
| | | position: absolute; |
| | | left: 0; |
| | | top: 50%; |
| | | transform: translateY(-50%); |
| | | width: 3px; |
| | | height: 16px; |
| | | background: #409eff; |
| | | border-radius: 2px; |
| | | } |
| | | .section-title::before { |
| | | content: ""; |
| | | position: absolute; |
| | | left: 0; |
| | | top: 50%; |
| | | transform: translateY(-50%); |
| | | width: 3px; |
| | | height: 16px; |
| | | background: #409eff; |
| | | border-radius: 2px; |
| | | } |
| | | |
| | | .section-actions { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | .section-actions { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | /* å·¥èºè·¯çº¿ä¿¡æ¯å¡çæ ·å¼ */ |
| | | .route-info-card { |
| | | margin-bottom: 20px; |
| | | border: 1px solid #e4e7ed; |
| | | background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%); |
| | | border-radius: 8px; |
| | | overflow: hidden; |
| | | } |
| | | /* å·¥èºè·¯çº¿ä¿¡æ¯å¡çæ ·å¼ */ |
| | | .route-info-card { |
| | | margin-bottom: 20px; |
| | | border: 1px solid #e4e7ed; |
| | | background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%); |
| | | border-radius: 8px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .route-info { |
| | | display: grid; |
| | | grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); |
| | | gap: 16px; |
| | | padding: 4px; |
| | | } |
| | | .route-info { |
| | | display: grid; |
| | | grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); |
| | | gap: 16px; |
| | | padding: 4px; |
| | | } |
| | | |
| | | .info-item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | background: #ffffff; |
| | | border-radius: 6px; |
| | | padding: 14px 16px; |
| | | border: 1px solid #f0f2f5; |
| | | transition: all 0.3s ease; |
| | | box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); |
| | | } |
| | | .info-item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | background: #ffffff; |
| | | border-radius: 6px; |
| | | padding: 14px 16px; |
| | | border: 1px solid #f0f2f5; |
| | | transition: all 0.3s ease; |
| | | box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); |
| | | } |
| | | |
| | | .info-item:hover { |
| | | border-color: #409eff; |
| | | box-shadow: 0 2px 8px rgba(64, 158, 255, 0.15); |
| | | transform: translateY(-1px); |
| | | } |
| | | .info-item:hover { |
| | | border-color: #409eff; |
| | | box-shadow: 0 2px 8px rgba(64, 158, 255, 0.15); |
| | | transform: translateY(-1px); |
| | | } |
| | | |
| | | .info-item.full-width { |
| | | grid-column: 1 / -1; |
| | | } |
| | | .info-item.full-width { |
| | | grid-column: 1 / -1; |
| | | } |
| | | |
| | | .info-label-wrapper { |
| | | margin-bottom: 8px; |
| | | } |
| | | .info-label-wrapper { |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .info-label { |
| | | display: inline-block; |
| | | color: #909399; |
| | | font-size: 12px; |
| | | font-weight: 500; |
| | | text-transform: uppercase; |
| | | letter-spacing: 0.5px; |
| | | padding: 2px 0; |
| | | position: relative; |
| | | } |
| | | .info-label { |
| | | display: inline-block; |
| | | color: #909399; |
| | | font-size: 12px; |
| | | font-weight: 500; |
| | | text-transform: uppercase; |
| | | letter-spacing: 0.5px; |
| | | padding: 2px 0; |
| | | position: relative; |
| | | } |
| | | |
| | | .info-label::after { |
| | | content: ''; |
| | | position: absolute; |
| | | left: 0; |
| | | bottom: 0; |
| | | width: 20px; |
| | | height: 2px; |
| | | background: linear-gradient(90deg, #409eff, transparent); |
| | | border-radius: 1px; |
| | | } |
| | | .info-label::after { |
| | | content: ""; |
| | | position: absolute; |
| | | left: 0; |
| | | bottom: 0; |
| | | width: 20px; |
| | | height: 2px; |
| | | background: linear-gradient(90deg, #409eff, transparent); |
| | | border-radius: 1px; |
| | | } |
| | | |
| | | .info-value-wrapper { |
| | | flex: 1; |
| | | } |
| | | .info-value-wrapper { |
| | | flex: 1; |
| | | } |
| | | |
| | | .info-value { |
| | | display: block; |
| | | color: #303133; |
| | | font-size: 15px; |
| | | font-weight: 500; |
| | | line-height: 1.5; |
| | | word-break: break-all; |
| | | } |
| | | .info-value { |
| | | display: block; |
| | | color: #303133; |
| | | font-size: 15px; |
| | | font-weight: 500; |
| | | line-height: 1.5; |
| | | word-break: break-all; |
| | | } |
| | | |
| | | .section-BOM { |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .hover-effect:hover { |
| | | border-color: #409eff; |
| | | background-color: #ecf5ff; |
| | | transform: translateY(-2px); |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <el-form :model="searchForm" |
| | | :inline="true"> |
| | | <el-form-item label="å·¥åºåç§°:"> |
| | | <el-input v-model="searchForm.name" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | prefix-icon="Search" |
| | | style="width: 200px;" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥åºç¼å·:"> |
| | | <el-input v-model="searchForm.no" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | prefix-icon="Search" |
| | | style="width: 200px;" |
| | | @change="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <div class="process-config-container"> |
| | | <!-- 左侧工åºå表 --> |
| | | <div class="process-list-section"> |
| | | <div class="section-header"> |
| | | <h3 class="section-title">å·¥åºå表</h3> |
| | | <el-button type="primary" |
| | | @click="handleQuery">æç´¢</el-button> |
| | | size="small" |
| | | @click="handleAddProcess"> |
| | | <el-icon> |
| | | <Plus /> |
| | | </el-icon>æ°å¢å·¥åº |
| | | </el-button> |
| | | </div> |
| | | <div class="process-card-list" |
| | | v-loading="processLoading"> |
| | | <div v-for="process in processValueList" |
| | | :key="process.id" |
| | | class="process-card" |
| | | :class="{ active: selectedProcess?.id === process.id }" |
| | | @click="selectProcess(process)"> |
| | | <div class="card-header"> |
| | | <div class="process-name">{{ process.name }} <span class="process-code">{{ process.no }}</span></div> |
| | | <div class="card-actions"> |
| | | <el-button link |
| | | type="primary" |
| | | @click.stop="handleEditProcess(process)"> |
| | | <el-icon> |
| | | <Edit /> |
| | | </el-icon> |
| | | ç¼è¾ |
| | | </el-button> |
| | | <el-button link |
| | | type="danger" |
| | | @click.stop="handleDeleteProcess(process)"> |
| | | <el-icon> |
| | | <Delete /> |
| | | </el-icon> |
| | | å é¤ |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | <div class="card-body"> |
| | | <!-- <div class="process-name">{{ process.name }}</div> --> |
| | | <div class="process-desc">{{ process.remark || 'ææ æè¿°' }}</div> |
| | | <div class="process-device">å
³è设å¤: {{ process.deviceName || 'æªå
³è' }}</div> |
| | | </div> |
| | | <div class="card-footer"> |
| | | <div class="status-tag"> <el-tag size="small" |
| | | :type="process.status ? 'success' : 'info'"> |
| | | {{ process.status ? 'å¯ç¨' : 'åç¨' }} |
| | | </el-tag> |
| | | <el-tag size="small" |
| | | :type="process.isQuality ? 'warning' : 'info'" |
| | | style="margin-left: 8px"> |
| | | {{ process.isQuality ? 'è´¨æ£' : 'éè´¨æ£' }} |
| | | </el-tag> |
| | | <el-tag v-if="process.type !== null && process.type !== undefined" |
| | | size="small" |
| | | :type="process.type == 1 ? 'primary' : 'success'" |
| | | style="margin-left: 8px"> |
| | | {{ process.type == 0 ? '计æ¶' : '计件' }} |
| | | </el-tag> |
| | | </div> |
| | | <span class="param-count">å·¥èµå®é¢: Â¥{{ process.salaryQuota || 0 }}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- å³ä¾§åæ°å表 --> |
| | | <div class="param-list-section"> |
| | | <div class="section-header"> |
| | | <h3 class="section-title"> |
| | | {{ selectedProcess ? selectedProcess.name + ' - åæ°é
ç½®' : 'è¯·éæ©å·¥åº' }} |
| | | </h3> |
| | | <el-button type="primary" |
| | | size="small" |
| | | :disabled="!selectedProcess" |
| | | @click="openParamDialog"> |
| | | <el-icon> |
| | | <Plus /> |
| | | </el-icon>鿩忰 |
| | | </el-button> |
| | | </div> |
| | | <div class="param-table-wrapper"> |
| | | <PIMTable v-if="selectedProcess" |
| | | rowKey="id" |
| | | :column="paramColumn" |
| | | :tableData="paramList" |
| | | :page="paramPage2" |
| | | height="calc(100vh - 280px)" |
| | | :isSelection="false" |
| | | @pagination="handleParamPagination" /> |
| | | <div v-else |
| | | class="empty-tip"> |
| | | <el-empty description="请ä»å·¦ä¾§éæ©ä¸ä¸ªå·¥åº" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- å·¥åºæ°å¢/ç¼è¾å¯¹è¯æ¡ --> |
| | | <el-dialog v-model="processDialogVisible" |
| | | :title="isProcessEdit ? 'ç¼è¾å·¥åº' : 'æ°å¢å·¥åº'" |
| | | width="500px"> |
| | | <el-form :model="processForm" |
| | | :rules="processRules" |
| | | ref="processFormRef" |
| | | label-width="100px"> |
| | | <el-form-item label="å·¥åºç¼ç " |
| | | prop="no"> |
| | | <el-input v-model="processForm.no" |
| | | placeholder="请è¾å
¥å·¥åºç¼ç " /> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥åºåç§°" |
| | | prop="name"> |
| | | <el-input v-model="processForm.name" |
| | | placeholder="请è¾å
¥å·¥åºåç§°" /> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥èµå®é¢" |
| | | prop="salaryQuota"> |
| | | <el-input v-model="processForm.salaryQuota" |
| | | type="number" |
| | | :step="0.001" /> |
| | | </el-form-item> |
| | | <el-form-item label="æ¯å¦è´¨æ£" |
| | | prop="isQuality"> |
| | | <el-switch v-model="processForm.isQuality" /> |
| | | </el-form-item> |
| | | <el-form-item label="计费类å" |
| | | prop="type"> |
| | | <el-radio-group v-model="processForm.type"> |
| | | <el-radio :label="0">计æ¶</el-radio> |
| | | <el-radio :label="1">计件</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="å
³è设å¤" |
| | | prop="deviceLedgerId"> |
| | | <el-select v-model="processForm.deviceLedgerId" |
| | | placeholder="è¯·éæ©è®¾å¤" |
| | | clearable |
| | | filterable |
| | | style="width: 100%"> |
| | | <el-option v-for="item in deviceOptions" |
| | | :key="item.id" |
| | | :label="item.deviceName" |
| | | :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥åºæè¿°" |
| | | prop="remark"> |
| | | <el-input v-model="processForm.remark" |
| | | type="textarea" |
| | | :rows="3" |
| | | placeholder="请è¾å
¥å·¥åºæè¿°" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç¶æ" |
| | | prop="status"> |
| | | <el-radio-group v-model="processForm.status"> |
| | | <el-radio :label="true">å¯ç¨</el-radio> |
| | | <el-radio :label="false">åç¨</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="table_list"> |
| | | <div style="text-align: right" |
| | | class="mb10"> |
| | | <el-button type="primary" |
| | | @click="showNewModal">æ°å¢å·¥åº</el-button> |
| | | <el-button type="info" |
| | | plain |
| | | @click="handleImport">导å
¥</el-button> |
| | | <el-button type="danger" |
| | | @click="handleDelete" |
| | | :disabled="selectedRows.length === 0" |
| | | plain>å é¤å·¥åº</el-button> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="processDialogVisible = false">åæ¶</el-button> |
| | | <el-button type="primary" |
| | | @click="handleProcessSubmit">ç¡®å®</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- éæ©åæ°å¯¹è¯æ¡ --> |
| | | <el-dialog v-model="paramDialogVisible" |
| | | title="鿩忰" |
| | | width="1000px"> |
| | | <div class="param-select-container"> |
| | | <!-- 左侧忰å表 --> |
| | | <div class="param-list-area"> |
| | | <div class="area-title">å¯éåæ°</div> |
| | | <div class="search-box"> |
| | | <el-input v-model="paramSearchKeyword" |
| | | placeholder="请è¾å
¥åæ°åç§°æç´¢" |
| | | clearable |
| | | size="small" |
| | | @input="handleSelectParam"> |
| | | <template #prefix> |
| | | <el-icon> |
| | | <Search /> |
| | | </el-icon> |
| | | </template> |
| | | </el-input> |
| | | </div> |
| | | <el-table :data="filteredParamList" |
| | | height="300" |
| | | border |
| | | highlight-current-row |
| | | @current-change="handleParamSelect"> |
| | | <el-table-column prop="paramName" |
| | | label="åæ°åç§°" /> |
| | | <el-table-column prop="paramType" |
| | | label="åæ°ç±»å"> |
| | | <template #default="scope"> |
| | | <el-tag size="small" |
| | | :type="getParamTypeTag(scope.row.paramType)"> |
| | | {{ getParamTypeText(scope.row.paramType) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- å页æ§ä»¶ --> |
| | | <div class="pagination-container" |
| | | style="margin-top: 10px;"> |
| | | <el-pagination v-model:current-page="paramPage.current" |
| | | v-model:page-size="paramPage.size" |
| | | :page-sizes="[10, 20, 50, 100]" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="paramPage.total" |
| | | @size-change="handleParamSizeChange" |
| | | @current-change="handleParamCurrentChange" |
| | | size="small" /> |
| | | </div> |
| | | </div> |
| | | <!-- å³ä¾§åæ°è¯¦æ
--> |
| | | <div class="param-detail-area"> |
| | | <div class="area-title">åæ°è¯¦æ
</div> |
| | | <el-form v-if="selectedParam" |
| | | :model="selectedParam" |
| | | label-width="100px" |
| | | class="param-detail-form"> |
| | | <el-form-item label="åæ°åç§°"> |
| | | <span class="detail-text">{{ selectedParam.paramName }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="åæ°ç±»å"> |
| | | <el-tag size="small" |
| | | :type="getParamTypeTag(selectedParam.paramType)"> |
| | | {{ getParamTypeText(selectedParam.paramType) }} |
| | | </el-tag> |
| | | </el-form-item> |
| | | <el-form-item label="åæ°æ ¼å¼"> |
| | | <span class="detail-text">{{ selectedParam.paramFormat || '-' }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="åä½"> |
| | | <span class="detail-text">{{ selectedParam.unit || '-' }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="æ åå¼"> |
| | | <el-input v-model="selectedParam.standardValue" |
| | | type="number" |
| | | placeholder="请è¾å
¥é»è®¤å¼" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-empty v-else |
| | | description="请ä»å·¦ä¾§éæ©åæ°" /> |
| | | </div> |
| | | </div> |
| | | <PIMTable rowKey="id" |
| | | :column="tableColumn" |
| | | :tableData="tableData" |
| | | :page="page" |
| | | :isSelection="true" |
| | | @selection-change="handleSelectionChange" |
| | | :tableLoading="tableLoading" |
| | | @pagination="pagination" |
| | | :total="page.total"></PIMTable> |
| | | </div> |
| | | <new-process v-if="isShowNewModal" |
| | | v-model:visible="isShowNewModal" |
| | | @completed="getList" /> |
| | | <edit-process v-if="isShowEditModal" |
| | | v-model:visible="isShowEditModal" |
| | | :record="record" |
| | | @completed="getList" /> |
| | | <ImportDialog ref="importDialogRef" |
| | | v-model="importDialogVisible" |
| | | title="导å
¥å·¥åº" |
| | | :action="importAction" |
| | | :headers="importHeaders" |
| | | :auto-upload="false" |
| | | :on-success="handleImportSuccess" |
| | | :on-error="handleImportError" |
| | | @confirm="handleImportConfirm" |
| | | @download-template="handleDownloadTemplate" |
| | | @close="handleImportClose" /> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="paramDialogVisible = false">åæ¶</el-button> |
| | | <el-button type="primary" |
| | | :disabled="!selectedParam" |
| | | @click="handleParamSubmit">ç¡®å®</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- ç¼è¾åæ°å¯¹è¯æ¡ --> |
| | | <el-dialog v-model="editParamDialogVisible" |
| | | title="ç¼è¾åæ°" |
| | | width="600px"> |
| | | <el-form :model="editParamForm" |
| | | :rules="editParamRules" |
| | | ref="editParamFormRef" |
| | | label-width="120px"> |
| | | <el-form-item label="åæ°åç§°"> |
| | | <span class="detail-text">{{ editParamForm.paramName }}</span> |
| | | </el-form-item> |
| | | <el-form-item label="æ åå¼" |
| | | prop="standardValue"> |
| | | <el-input v-model="editParamForm.standardValue" |
| | | type="number" |
| | | placeholder="请è¾å
¥æ åå¼" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="editParamDialogVisible = false">åæ¶</el-button> |
| | | <el-button type="primary" |
| | | @click="handleEditParamSubmit">ç¡®å®</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { onMounted, ref, reactive, toRefs, getCurrentInstance } from "vue"; |
| | | import NewProcess from "@/views/productionManagement/productionProcess/New.vue"; |
| | | import EditProcess from "@/views/productionManagement/productionProcess/Edit.vue"; |
| | | import ImportDialog from "@/components/Dialog/ImportDialog.vue"; |
| | | import { ref, reactive, onMounted } from "vue"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import { Plus, Edit, Delete, Search } from "@element-plus/icons-vue"; |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | import { listType } from "@/api/system/dict/type"; |
| | | import { |
| | | listPage, |
| | | add, |
| | | update, |
| | | del, |
| | | importData, |
| | | downloadTemplate, |
| | | list as getProcessListApi, |
| | | processList, |
| | | getProcessParamList, |
| | | addProcessParam, |
| | | editProcessParam, |
| | | deleteProcessParam, |
| | | } from "@/api/productionManagement/productionProcess.js"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import { getDeviceLedger } from "@/api/equipmentManagement/ledger"; |
| | | import { getBaseParamList } from "@/api/basicData/parameterMaintenance.js"; |
| | | |
| | | const data = reactive({ |
| | | searchForm: { |
| | | name: "", |
| | | no: "", |
| | | }, |
| | | // å·¥åºåè¡¨æ°æ® |
| | | const processValueList = ref([]); |
| | | const selectedProcess = ref(null); |
| | | const processLoading = ref(false); |
| | | const deviceOptions = ref([]); |
| | | |
| | | // åæ°åè¡¨æ°æ® |
| | | const paramList = ref([]); |
| | | const paramLoading = ref(false); |
| | | |
| | | // æ°æ®åå
¸ |
| | | const dictTypes = ref([]); |
| | | |
| | | // å·¥åºå¯¹è¯æ¡ |
| | | const processDialogVisible = ref(false); |
| | | const isProcessEdit = ref(false); |
| | | const processFormRef = ref(null); |
| | | const processForm = reactive({ |
| | | id: null, |
| | | no: "", |
| | | name: "", |
| | | salaryQuota: null, |
| | | isQuality: false, |
| | | remark: "", |
| | | status: true, |
| | | deviceLedgerId: null, |
| | | type: 0, |
| | | }); |
| | | const { searchForm } = toRefs(data); |
| | | const tableColumn = ref([ |
| | | const processRules = { |
| | | no: [{ required: true, message: "请è¾å
¥å·¥åºç¼ç ", trigger: "blur" }], |
| | | name: [{ required: true, message: "请è¾å
¥å·¥åºåç§°", trigger: "blur" }], |
| | | salaryQuota: [ |
| | | { |
| | | required: false, |
| | | message: "请è¾å
¥å·¥èµå®é¢", |
| | | trigger: "blur", |
| | | validator: (rule, value, callback) => { |
| | | if (isNaN(value) || value < 0) { |
| | | callback(new Error("å·¥èµå®é¢å¿
é¡»æ¯éè´æ°å")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | }, |
| | | ], |
| | | deviceLedgerId: [ |
| | | { required: false, message: "è¯·éæ©è®¾å¤", trigger: "change" }, |
| | | ], |
| | | type: [{ required: false, message: "è¯·éæ©è®¡è´¹ç±»å", trigger: "change" }], |
| | | }; |
| | | |
| | | // åæ°å¯¹è¯æ¡ |
| | | const paramDialogVisible = ref(false); |
| | | const availableParamList = ref([]); |
| | | const filteredParamList = ref([]); |
| | | const selectedParam = ref(null); |
| | | const paramSearchKeyword = ref(""); |
| | | |
| | | // å¯éåæ°å页 |
| | | const paramPage = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | total: 0, |
| | | }); |
| | | |
| | | // ç¼è¾åæ°å¯¹è¯æ¡ |
| | | const editParamDialogVisible = ref(false); |
| | | const editParamFormRef = ref(null); |
| | | const editParamForm = reactive({ |
| | | id: null, |
| | | processId: null, |
| | | paramId: null, |
| | | paramName: "", |
| | | standardValue: null, |
| | | tenantId: 1, |
| | | }); |
| | | const editParamRules = { |
| | | standardValue: [ |
| | | { |
| | | required: true, |
| | | message: "请è¾å
¥æ åå¼", |
| | | trigger: "blur", |
| | | validator: (rule, value, callback) => { |
| | | if (value === null || value === undefined || value === "") { |
| | | callback(new Error("请è¾å
¥æ åå¼")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | }, |
| | | ], |
| | | }; |
| | | |
| | | // åæ°è¡¨æ ¼åé
ç½® |
| | | const paramColumn = ref([ |
| | | { |
| | | label: "å·¥åºç¼å·", |
| | | prop: "no", |
| | | label: "åæ°åç§°", |
| | | prop: "paramName", |
| | | }, |
| | | { |
| | | label: "å·¥åºåç§°", |
| | | prop: "name", |
| | | }, |
| | | { |
| | | label: "å·¥åºç±»å", |
| | | prop: "typeText", |
| | | }, |
| | | { |
| | | label: "å·¥èµå®é¢", |
| | | prop: "salaryQuota", |
| | | }, |
| | | { |
| | | label: "æ¯å¦è´¨æ£", |
| | | prop: "isQuality", |
| | | formatData: (params) => { |
| | | return params ? "æ¯" : "å¦"; |
| | | label: "åæ°ç±»å", |
| | | prop: "paramType", |
| | | dataType: "tag", |
| | | formatType: params => { |
| | | const typeMap = { |
| | | 1: "primary", |
| | | 2: "info", |
| | | 3: "warning", |
| | | 4: "success", |
| | | }; |
| | | return typeMap[params] || "default"; |
| | | }, |
| | | formatData: val => { |
| | | const labelMap = { |
| | | 1: "æ°å¼æ ¼å¼", |
| | | 2: "ææ¬æ ¼å¼", |
| | | 3: "䏿é项", |
| | | 4: "æ¶é´æ ¼å¼", |
| | | }; |
| | | return labelMap[val] || val; |
| | | }, |
| | | }, |
| | | { |
| | | label: "夿³¨", |
| | | prop: "remark", |
| | | label: "å弿 ¼å¼", |
| | | prop: "paramFormat", |
| | | formatData: (val, row) => { |
| | | if (row.paramType == "3") { |
| | | const dict = dictTypes.value.find(item => item.dictType === val); |
| | | return dict ? "åå
¸:" + dict.dictName : val; |
| | | } |
| | | return val; |
| | | }, |
| | | }, |
| | | { |
| | | label: "æ´æ°æ¶é´", |
| | | prop: "updateTime", |
| | | label: "æ åå¼", |
| | | prop: "standardValue", |
| | | }, |
| | | { |
| | | dataType: "action", |
| | | label: "åä½", |
| | | prop: "unit", |
| | | }, |
| | | { |
| | | label: "æä½", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 280, |
| | | dataType: "action", |
| | | width: "150", |
| | | operation: [ |
| | | { |
| | | name: "ç¼è¾", |
| | | type: "text", |
| | | clickFun: row => { |
| | | showEditModal(row); |
| | | }, |
| | | clickFun: row => handleEditParam(row), |
| | | }, |
| | | { |
| | | name: "å é¤", |
| | | clickFun: row => handleDeleteParam(row), |
| | | }, |
| | | ], |
| | | }, |
| | | ]); |
| | | const tableData = ref([]); |
| | | const selectedRows = ref([]); |
| | | const tableLoading = ref(false); |
| | | const isShowNewModal = ref(false); |
| | | const isShowEditModal = ref(false); |
| | | const record = ref({}); |
| | | const importDialogVisible = ref(false); |
| | | const importDialogRef = ref(null); |
| | | const page = reactive({ |
| | | |
| | | // è·åå·¥åºå表 |
| | | const getProcessList = () => { |
| | | processLoading.value = true; |
| | | getProcessListApi() |
| | | .then(res => { |
| | | processValueList.value = res.data.records || []; |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("è·åå·¥åºå表失败"); |
| | | }) |
| | | .finally(() => { |
| | | processLoading.value = false; |
| | | }); |
| | | }; |
| | | |
| | | const loadDeviceName = async () => { |
| | | try { |
| | | const { data } = await getDeviceLedger(); |
| | | deviceOptions.value = data || []; |
| | | } catch (error) { |
| | | console.error("å 载设å¤å表失败", error); |
| | | } |
| | | }; |
| | | |
| | | const paramPage2 = ref({ |
| | | current: 1, |
| | | size: 100, |
| | | size: 10, |
| | | total: 0, |
| | | }); |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | // 导å
¥ç¸å
³é
ç½® |
| | | const importAction = |
| | | import.meta.env.VITE_APP_BASE_API + "/productProcess/importData"; |
| | | const importHeaders = { Authorization: "Bearer " + getToken() }; |
| | | |
| | | // æ¥è¯¢å表 |
| | | /** æç´¢æé®æä½ */ |
| | | const handleQuery = () => { |
| | | page.current = 1; |
| | | getList(); |
| | | }; |
| | | |
| | | const pagination = obj => { |
| | | page.current = obj.page; |
| | | page.size = obj.limit; |
| | | getList(); |
| | | }; |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | const params = { ...searchForm.value, ...page }; |
| | | params.entryDate = undefined; |
| | | listPage(params) |
| | | // è·ååæ°å表 |
| | | const getParamList = processId => { |
| | | paramLoading.value = true; |
| | | console.log(paramPage2.value, "paramPage2.value"); |
| | | getProcessParamList(processId, { |
| | | current: paramPage2.value.current, |
| | | size: paramPage2.value.size, |
| | | }) |
| | | .then(res => { |
| | | tableLoading.value = false; |
| | | tableData.value = res.data.records.map(item => ({ |
| | | ...item, |
| | | typeText: item.type !== undefined && item.type !== null ? (item.type === 0 ? "计æ¶" : "计件") : "", |
| | | })); |
| | | page.total = res.data.total; |
| | | paramList.value = res.data.records || []; |
| | | paramPage2.value.total = res.data.total; |
| | | }) |
| | | .catch(err => { |
| | | tableLoading.value = false; |
| | | .catch(() => { |
| | | ElMessage.error("è·ååæ°å表失败"); |
| | | }) |
| | | .finally(() => { |
| | | paramLoading.value = false; |
| | | }); |
| | | }; |
| | | // è¡¨æ ¼éæ©æ°æ® |
| | | const handleSelectionChange = selection => { |
| | | selectedRows.value = selection; |
| | | |
| | | // éæ©å·¥åº |
| | | const selectProcess = process => { |
| | | selectedProcess.value = process; |
| | | getParamList(process.id); |
| | | }; |
| | | |
| | | // æå¼æ°å¢å¼¹æ¡ |
| | | const showNewModal = () => { |
| | | isShowNewModal.value = true; |
| | | // å·¥åºæä½ |
| | | const handleAddProcess = () => { |
| | | isProcessEdit.value = false; |
| | | processForm.id = null; |
| | | processForm.no = ""; |
| | | processForm.name = ""; |
| | | processForm.salaryQuota = null; |
| | | processForm.isQuality = false; |
| | | processForm.remark = ""; |
| | | processForm.status = true; |
| | | processForm.deviceLedgerId = null; |
| | | processForm.type = 0; |
| | | loadDeviceName(); |
| | | processDialogVisible.value = true; |
| | | }; |
| | | |
| | | const showEditModal = row => { |
| | | isShowEditModal.value = true; |
| | | record.value = row; |
| | | const handleEditProcess = async process => { |
| | | isProcessEdit.value = true; |
| | | await loadDeviceName(); // Ensure deviceOptions is loaded before setting deviceLedgerId |
| | | processForm.id = process.id; |
| | | processForm.no = process.no; |
| | | processForm.name = process.name; |
| | | processForm.salaryQuota = process.salaryQuota; |
| | | processForm.isQuality = !!process.isQuality; |
| | | processForm.remark = process.remark || ""; |
| | | processForm.status = process.status; |
| | | processForm.deviceLedgerId = Number(process.deviceLedgerId); |
| | | processForm.type = process.type; |
| | | processDialogVisible.value = true; |
| | | }; |
| | | |
| | | // å é¤ |
| | | function handleDelete() { |
| | | const no = selectedRows.value.map(item => item.no); |
| | | const ids = selectedRows.value.map(item => item.id); |
| | | if (no.length > 2) { |
| | | proxy.$modal |
| | | .confirm( |
| | | 'æ¯å¦ç¡®è®¤å é¤å·¥åºç¼å·ä¸º"' + |
| | | no[0] + |
| | | "ã" + |
| | | no[1] + |
| | | '"ç' + |
| | | no.length + |
| | | "æ¡æ°æ®é¡¹ï¼" |
| | | ) |
| | | .then(function () { |
| | | return del(ids); |
| | | }) |
| | | const handleDeleteProcess = process => { |
| | | ElMessageBox.confirm("ç¡®å®è¦å é¤è¯¥å·¥åºåï¼", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }).then(() => { |
| | | del([process.id]) |
| | | .then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | ElMessage.success("å 餿å"); |
| | | getProcessList(); |
| | | if (selectedProcess.value?.id === process.id) { |
| | | selectedProcess.value = null; |
| | | paramList.value = []; |
| | | } |
| | | }) |
| | | .catch(() => {}); |
| | | } else { |
| | | proxy.$modal |
| | | .confirm('æ¯å¦ç¡®è®¤å é¤å·¥åºç¼å·ä¸º"' + no + '"çæ°æ®é¡¹ï¼') |
| | | .then(function () { |
| | | return del(ids); |
| | | }) |
| | | .then(() => { |
| | | getList(); |
| | | proxy.$modal.msgSuccess("å 餿å"); |
| | | }) |
| | | .catch(() => {}); |
| | | } |
| | | } |
| | | |
| | | // 导å
¥ |
| | | const handleImport = () => { |
| | | importDialogVisible.value = true; |
| | | .catch(() => { |
| | | ElMessage.error("å é¤å¤±è´¥"); |
| | | }); |
| | | }); |
| | | }; |
| | | |
| | | // 确认导å
¥ |
| | | const handleImportConfirm = () => { |
| | | if (importDialogRef.value) { |
| | | importDialogRef.value.submit(); |
| | | } |
| | | }; |
| | | |
| | | // 导å
¥æå |
| | | const handleImportSuccess = response => { |
| | | if (response.code === 200) { |
| | | proxy.$modal.msgSuccess("导å
¥æå"); |
| | | importDialogVisible.value = false; |
| | | if (importDialogRef.value) { |
| | | importDialogRef.value.clearFiles(); |
| | | const handleProcessSubmit = () => { |
| | | processFormRef.value.validate(valid => { |
| | | if (valid) { |
| | | if (processForm.id) { |
| | | update(processForm) |
| | | .then(() => { |
| | | ElMessage.success("ç¼è¾æå"); |
| | | processDialogVisible.value = false; |
| | | getProcessList(); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("ç¼è¾å¤±è´¥"); |
| | | }); |
| | | } else { |
| | | add(processForm) |
| | | .then(() => { |
| | | ElMessage.success("æ°å¢æå"); |
| | | processDialogVisible.value = false; |
| | | getProcessList(); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("æ°å¢å¤±è´¥"); |
| | | }); |
| | | } |
| | | } |
| | | getList(); |
| | | } else { |
| | | proxy.$modal.msgError(response.msg || "导å
¥å¤±è´¥"); |
| | | }); |
| | | }; |
| | | const openParamDialog = () => { |
| | | paramSearchKeyword.value = ""; |
| | | if (!selectedProcess.value) { |
| | | ElMessage.warning("请å
éæ©ä¸ä¸ªå·¥åº"); |
| | | return; |
| | | } |
| | | // è·åå¯éåæ°å表 |
| | | getBaseParamList({ |
| | | paramName: paramSearchKeyword.value, |
| | | current: paramPage.current, |
| | | size: paramPage.size, |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | filteredParamList.value = res.data?.records || []; |
| | | paramPage.total = res.data?.total || 0; |
| | | } else { |
| | | ElMessage.error(res.msg || "æ¥è¯¢å¤±è´¥"); |
| | | } |
| | | }); |
| | | console.log(filteredParamList.value, "å¯éåæ°å表"); |
| | | selectedParam.value = null; |
| | | paramDialogVisible.value = true; |
| | | }; |
| | | |
| | | // 导å
¥å¤±è´¥ |
| | | const handleImportError = error => { |
| | | proxy.$modal.msgError("导å
¥å¤±è´¥ï¼" + (error.message || "æªç¥é误")); |
| | | }; |
| | | |
| | | // å
³é导å
¥å¼¹çª |
| | | const handleImportClose = () => { |
| | | if (importDialogRef.value) { |
| | | importDialogRef.value.clearFiles(); |
| | | // åæ°æä½ |
| | | const handleSelectParam = () => { |
| | | if (!selectedProcess.value) { |
| | | ElMessage.warning("请å
éæ©ä¸ä¸ªå·¥åº"); |
| | | return; |
| | | } |
| | | // è·åå¯éåæ°å表 |
| | | getBaseParamList({ |
| | | paramName: paramSearchKeyword.value, |
| | | current: paramPage.current, |
| | | size: paramPage.size, |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | filteredParamList.value = res.data?.records || []; |
| | | paramPage.total = res.data?.total || 0; |
| | | } else { |
| | | ElMessage.error(res.msg || "æ¥è¯¢å¤±è´¥"); |
| | | } |
| | | }); |
| | | console.log(filteredParamList.value, "å¯éåæ°å表"); |
| | | selectedParam.value = null; |
| | | paramDialogVisible.value = true; |
| | | }; |
| | | |
| | | // ä¸è½½æ¨¡æ¿ |
| | | const handleDownloadTemplate = async () => { |
| | | try { |
| | | const res = await downloadTemplate(); |
| | | const blob = new Blob([res], { |
| | | type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", |
| | | const handleParamSelect = row => { |
| | | selectedParam.value = row; |
| | | }; |
| | | |
| | | const handleParamSearch = () => { |
| | | // éç½®å页 |
| | | paramPage.current = 1; |
| | | // éæ°å è½½æ°æ® |
| | | handleSelectParam(); |
| | | }; |
| | | |
| | | // å¤çå页大å°åå |
| | | const handleParamSizeChange = size => { |
| | | paramPage.size = size; |
| | | handleSelectParam(); |
| | | }; |
| | | |
| | | // å¤çå½å页ç åå |
| | | const handleParamCurrentChange = current => { |
| | | paramPage.current = current; |
| | | handleSelectParam(); |
| | | }; |
| | | const getParamTypeText = type => { |
| | | const typeMap = { |
| | | 1: "æ°å¼æ ¼å¼", |
| | | 2: "ææ¬æ ¼å¼", |
| | | 3: "䏿é项", |
| | | 4: "æ¶é´æ ¼å¼", |
| | | }; |
| | | return typeMap[type] || "æªç¥åæ°ç±»å"; |
| | | }; |
| | | const getParamTypeTag = type => { |
| | | const typeMap = { |
| | | 1: "primary", |
| | | 2: "info", |
| | | 3: "warning", |
| | | 4: "success", |
| | | }; |
| | | return typeMap[type] || "default"; |
| | | }; |
| | | |
| | | const handleDeleteParam = row => { |
| | | ElMessageBox.confirm("ç¡®å®è¦å é¤è¯¥åæ°åï¼", "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning", |
| | | }).then(() => { |
| | | deleteProcessParam(row.id) |
| | | .then(() => { |
| | | ElMessage.success("å 餿å"); |
| | | getParamList(selectedProcess.value.id); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("å é¤å¤±è´¥"); |
| | | }); |
| | | }); |
| | | }; |
| | | |
| | | const handleEditParam = row => { |
| | | editParamForm.id = row.id; |
| | | editParamForm.processId = row.processId; |
| | | editParamForm.paramId = row.paramId; |
| | | editParamForm.paramName = row.paramName; |
| | | editParamForm.standardValue = row.standardValue; |
| | | editParamForm.tenantId = 1; |
| | | editParamDialogVisible.value = true; |
| | | }; |
| | | |
| | | const handleEditParamSubmit = () => { |
| | | editParamFormRef.value.validate(valid => { |
| | | if (valid) { |
| | | editProcessParam(editParamForm) |
| | | .then(() => { |
| | | ElMessage.success("ç¼è¾æå"); |
| | | editParamDialogVisible.value = false; |
| | | getParamList(selectedProcess.value.id); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("ç¼è¾å¤±è´¥"); |
| | | }); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | const handleParamSubmit = () => { |
| | | if (!selectedParam.value) { |
| | | ElMessage.warning("请å
éæ©ä¸ä¸ªåæ°"); |
| | | return; |
| | | } |
| | | addProcessParam({ |
| | | processId: selectedProcess.value.id, |
| | | paramId: selectedParam.value.id, |
| | | standardValue: selectedParam.value.standardValue, |
| | | tenantId: 1, |
| | | }) |
| | | .then(() => { |
| | | ElMessage.success("æ·»å æå"); |
| | | paramDialogVisible.value = false; |
| | | getParamList(selectedProcess.value.id); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("æ·»å 失败"); |
| | | }); |
| | | const url = window.URL.createObjectURL(blob); |
| | | const link = document.createElement("a"); |
| | | link.href = url; |
| | | link.download = "å·¥åºå¯¼å
¥æ¨¡æ¿.xlsx"; |
| | | link.click(); |
| | | window.URL.revokeObjectURL(url); |
| | | proxy.$modal.msgSuccess("模æ¿ä¸è½½æå"); |
| | | } catch (error) { |
| | | proxy.$modal.msgError("模æ¿ä¸è½½å¤±è´¥"); |
| | | } |
| | | }; |
| | | |
| | | // å¯¼åº |
| | | // const handleOut = () => { |
| | | // ElMessageBox.confirm("éä¸çå
容å°è¢«å¯¼åºï¼æ¯å¦ç¡®è®¤å¯¼åºï¼", "导åº", { |
| | | // confirmButtonText: "确认", |
| | | // cancelButtonText: "åæ¶", |
| | | // type: "warning", |
| | | // }) |
| | | // .then(() => { |
| | | // proxy.download("/salesLedger/scheduling/exportTwo", {}, "å·¥åºæäº§.xlsx"); |
| | | // }) |
| | | // .catch(() => { |
| | | // proxy.$modal.msg("已忶"); |
| | | // }); |
| | | // }; |
| | | const handleParamPagination = obj => { |
| | | console.log(obj, "obj"); |
| | | paramPage2.value.current = obj.page; |
| | | paramPage2.value.size = obj.limit; |
| | | getParamList(selectedProcess.value.id); |
| | | }; |
| | | |
| | | // è·åæ°æ®åå
¸ |
| | | const getDictTypes = () => { |
| | | listType({ pageNum: 1, pageSize: 1000 }).then(res => { |
| | | dictTypes.value = res.rows || []; |
| | | }); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | getProcessList(); |
| | | getDictTypes(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped></style> |
| | | <style scoped lang="scss"> |
| | | .app-container { |
| | | padding: 20px; |
| | | background-color: #f0f2f5; |
| | | min-height: calc(100vh - 84px); |
| | | } |
| | | |
| | | .process-config-container { |
| | | display: flex; |
| | | gap: 20px; |
| | | height: calc(100vh - 124px); |
| | | } |
| | | |
| | | // 左侧工åºå表 |
| | | .process-list-section { |
| | | width: 370px; |
| | | min-width: 370px; |
| | | flex-shrink: 0; |
| | | background: #fff; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .section-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | padding: 16px 20px; |
| | | border-bottom: 1px solid #ebeef5; |
| | | |
| | | .section-title { |
| | | margin: 0; |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | color: #303133; |
| | | } |
| | | } |
| | | |
| | | .process-card-list { |
| | | flex: 1; |
| | | overflow-y: auto; |
| | | padding: 16px; |
| | | } |
| | | |
| | | .process-card { |
| | | background: #fff; |
| | | border: 1px solid #ebeef5; |
| | | border-radius: 8px; |
| | | padding: 16px; |
| | | margin-bottom: 12px; |
| | | cursor: pointer; |
| | | transition: all 0.3s ease; |
| | | |
| | | &:hover { |
| | | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); |
| | | transform: translateY(-2px); |
| | | } |
| | | |
| | | &.active { |
| | | border-color: #409eff; |
| | | background: #f5f7fa; |
| | | box-shadow: 0 4px 12px rgba(64, 158, 255, 0.2); |
| | | } |
| | | |
| | | .card-header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 8px; |
| | | |
| | | .process-code { |
| | | font-size: 12px; |
| | | // color: #909399; |
| | | color: #cb9b18; |
| | | font-family: "Courier New", monospace; |
| | | } |
| | | |
| | | .card-actions { |
| | | display: flex; |
| | | gap: 4px; |
| | | |
| | | .el-button { |
| | | padding: 4px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .card-body { |
| | | margin-bottom: 12px; |
| | | |
| | | .process-name { |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | color: #303133; |
| | | margin-bottom: 4px; |
| | | } |
| | | |
| | | .process-desc { |
| | | font-size: 12px; |
| | | color: #909399; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | margin-bottom: 4px; |
| | | } |
| | | |
| | | .process-device { |
| | | font-size: 12px; |
| | | color: #606266; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | } |
| | | } |
| | | |
| | | .card-footer { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | |
| | | .param-count { |
| | | font-size: 12px; |
| | | color: #606266; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // å³ä¾§åæ°å表 |
| | | .param-list-section { |
| | | flex: 1; |
| | | background: #fff; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
| | | display: flex; |
| | | flex-direction: column; |
| | | min-width: 0; |
| | | } |
| | | |
| | | .param-table-wrapper { |
| | | flex: 1; |
| | | padding: 0 20px 20px; |
| | | overflow: auto; |
| | | min-width: 100%; |
| | | } |
| | | |
| | | /* è¡¨æ ¼æ¨ªåæ»å¨ */ |
| | | .param-table-wrapper :deep(.el-table) { |
| | | min-width: 100%; |
| | | } |
| | | |
| | | .param-table-wrapper :deep(.el-table__body-wrapper) { |
| | | overflow-x: auto; |
| | | } |
| | | |
| | | .pagination-container { |
| | | margin-top: 10px; |
| | | overflow-x: auto; |
| | | padding-bottom: 8px; |
| | | } |
| | | |
| | | .pagination-container .el-pagination { |
| | | white-space: nowrap; |
| | | } |
| | | |
| | | /* ååºå¼è°æ´ */ |
| | | @media screen and (max-width: 768px) { |
| | | .pagination-container { |
| | | font-size: 12px; |
| | | } |
| | | |
| | | .pagination-container .el-pagination__sizes { |
| | | margin-right: 8px; |
| | | } |
| | | |
| | | .pagination-container .el-pagination__jump { |
| | | margin-left: 8px; |
| | | } |
| | | |
| | | .pagination-container .el-pagination__page-size { |
| | | font-size: 12px; |
| | | } |
| | | } |
| | | |
| | | .empty-tip { |
| | | flex: 1; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | // è¡¨æ ¼æ ·å¼ |
| | | :deep(.el-table) { |
| | | border: none; |
| | | border-radius: 6px; |
| | | overflow: hidden; |
| | | |
| | | .el-table__header-wrapper { |
| | | background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); |
| | | |
| | | th { |
| | | background: transparent; |
| | | font-weight: 600; |
| | | // color: #ffffff; |
| | | border-bottom: none; |
| | | padding: 16px 0; |
| | | } |
| | | } |
| | | |
| | | .el-table__body-wrapper { |
| | | tr { |
| | | transition: all 0.3s ease; |
| | | |
| | | &:hover { |
| | | background: linear-gradient( |
| | | 90deg, |
| | | rgba(102, 126, 234, 0.05) 0%, |
| | | rgba(118, 75, 162, 0.05) 100% |
| | | ); |
| | | } |
| | | |
| | | td { |
| | | border-bottom: 1px solid #f0f0f0; |
| | | padding: 14px 0; |
| | | color: #303133; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | // ç¼ç åå
æ ¼æ ·å¼ |
| | | :deep(.code-cell) { |
| | | color: #e6a23c; |
| | | font-family: "Courier New", monospace; |
| | | font-weight: 500; |
| | | } |
| | | |
| | | // æ°å¼åå
æ ¼æ ·å¼ |
| | | :deep(.quantity-cell) { |
| | | font-weight: 600; |
| | | color: #409eff; |
| | | font-family: "Courier New", monospace; |
| | | } |
| | | |
| | | // éæ©åæ°å¯¹è¯æ¡æ ·å¼ |
| | | .param-select-container { |
| | | display: flex; |
| | | gap: 20px; |
| | | height: 450px; |
| | | |
| | | .param-list-area { |
| | | // flex: 1; |
| | | width: 380px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .area-title { |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | color: #303133; |
| | | margin-bottom: 12px; |
| | | padding-bottom: 8px; |
| | | border-bottom: 1px solid #ebeef5; |
| | | } |
| | | |
| | | .search-box { |
| | | margin-bottom: 12px; |
| | | |
| | | .el-input { |
| | | width: 100%; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .param-detail-area { |
| | | // width: 380px; |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | background: #f5f7fa; |
| | | border-radius: 8px; |
| | | padding: 16px; |
| | | |
| | | .area-title { |
| | | font-size: 14px; |
| | | font-weight: 600; |
| | | color: #303133; |
| | | margin-bottom: 16px; |
| | | padding-bottom: 8px; |
| | | border-bottom: 1px solid #ebeef5; |
| | | } |
| | | |
| | | .param-detail-form { |
| | | .el-form-item { |
| | | margin-bottom: 12px; |
| | | |
| | | .el-form-item__label { |
| | | color: #606266; |
| | | font-weight: 500; |
| | | } |
| | | } |
| | | |
| | | .detail-text { |
| | | color: #303133; |
| | | font-weight: 500; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |