diff --git a/.env.development b/.env.development index 284595a2..29124b16 100644 --- a/.env.development +++ b/.env.development @@ -6,10 +6,10 @@ ENV = 'development' # 开发环境 # VUE_APP_BASE_API = 'https://mudi.dsxyy.org/UDI_WMS_MC/' -VUE_APP_BASE_API = 'http://192.168.0.43:9991' +VUE_APP_BASE_API = 'http://192.168.0.188:9991' # VUE_APP_BASE_SPMS_API = 'http://192.168.0.43:9993' -VUE_APP_BASE_SPMS_API = 'http://192.168.0.43:10001/directToSpms' +VUE_APP_BASE_SPMS_API = 'http://192.168.0.188:10002/directToSpms' VUE_APP_SYNC_API ="http://127.0.0.1:10001" # VUE_APP_BASE_API = 'http://dm.xmglxp.com:81/UDI_WMS_MC/' diff --git a/package.json b/package.json index 81a45964..44df32ce 100644 --- a/package.json +++ b/package.json @@ -5,12 +5,12 @@ "author": "Glxp", "license": "MIT", "scripts": { - "build:prod": " vue-cli-service build", + "build:prod": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build", "build:test": "vue-cli-service build --mode test", "preview": "node build/index.js --preview", "lint": "eslint --ext .js,.vue src", "server": "SET NODE_OPTIONS=--openssl-legacy-provider && webpack-dev-server --env.server --env.develop --inline --max-old-space-size=3000", - "dev": " vue-cli-service serve --open" + "dev": "vue-cli-service serve --open" }, "husky": { "hooks": { @@ -37,13 +37,13 @@ "url": "https://gitee.com/y_project/RuoYi-Vue.git" }, "dependencies": { + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "0.4.0", "@tinymce/tinymce-vue": "^3.2.8", - "@jiaminghi/data-view": "^2.10.0", "axios": "0.24.0", "clipboard": "2.0.8", "core-js": "^3.19.1", - "echarts": "^5.5.1", + "echarts": "4.9.0", "element-china-area-data": "^5.0.2", "element-ui": "2.15.8", "file-saver": "2.0.5", @@ -52,6 +52,7 @@ "js-beautify": "1.13.0", "js-cookie": "3.0.1", "js-sha256": "^0.10.1", + "jsbarcode": "^3.11.6", "jsencrypt": "3.0.0-rc.1", "loadsh": "^0.0.4", "lodash": "^4.17.21", diff --git a/src/api/biz/traceQuery.js b/src/api/biz/traceQuery.js new file mode 100644 index 00000000..30af345e --- /dev/null +++ b/src/api/biz/traceQuery.js @@ -0,0 +1,40 @@ +import request from '@/utils/request' + +/** + * 获取单据记录 + * @param {Object} data 查询参数 + * @returns {Promise} 请求结果 + */ +export function getOrderRecords(data) { + return request({ + url: '/udiwms/inout/order/filter', + method: 'post', + data + }) +} + +/** + * 获取单据记录明细 + * @param {Object} data 查询参数 + * @returns {Promise} 请求结果 + */ +export function getOrderDetails(data) { + return request({ + url: '/udiwms/inout/bizDetail/filterList', + method: 'post', + data + }) +} + +/** + * 获取药品信息 + * @param {Object} data 查询参数 + * @returns {Promise} 请求结果 + */ +export function getDrugInfo(data) { + return request({ + url: '/di/udirel/filterUdi', + method: 'post', + data + }) +} diff --git a/src/views/basic/collectPoint/timerSetting.vue b/src/views/basic/collectPoint/timerSetting.vue index cc88cb7d..78cdf061 100644 --- a/src/views/basic/collectPoint/timerSetting.vue +++ b/src/views/basic/collectPoint/timerSetting.vue @@ -256,7 +256,7 @@ <!--</el-col>--> <el-col :span="8" class="el-col"> <el-form-item label="是否自动解码:" prop="autoDecode" style="margin-bottom: 0"> - <el-select v-model="formData.autoDecode" placeholder="选择是否自动解码"> + <el-select v-model="formData.autoDecode" placeholder="选择是否自动解码"> <el-option label="否" :value="0"></el-option> <el-option label="是" :value="1"></el-option> </el-select> @@ -264,8 +264,8 @@ </el-col> <el-col :span="8" class="el-col"> - <el-form-item label="输出顺序:" prop="outputMode" > - <el-select v-model="formData.outputMode" placeholder="选择输出顺序"> + <el-form-item label="输出顺序:" prop="outputMode"> + <el-select v-model="formData.outputMode" placeholder="选择输出顺序"> <el-option label="不排序" :value="0"></el-option> <el-option label="从左到右" :value="1"></el-option> <el-option label="从右到左" :value="2"></el-option> @@ -305,7 +305,7 @@ import {getSet, updateSet} from "@/api/collect/collectSet"; import ShelfDisplay from "@/components/ShelfDisplay"; -import { isBlank } from '@/utils/strUtil' +import {isBlank} from '@/utils/strUtil' export default { name: 'timerSetting', @@ -382,20 +382,20 @@ export default { ] }, ], - activeNames: ['0', '1', '2', '3','4'], + activeNames: ['0', '1', '2', '3', '4'], formData: { startDownloadTime: null, lastCodeSplit: true, isScanCodeCheck: true, getSplitConfirm: false, - fixedCount:null, + fixedCount: null, pdaMaxCount: null, ipcMaxCount: null, - autoDecode:1, - outputMode:1, + autoDecode: 1, + outputMode: 1, }, systemParam: null, - socket:null, + socket: null, } }, @@ -424,25 +424,25 @@ export default { this.ShelfDisplayFlag = true }, save() { - if (isBlank(this.formData.scanMaxCount)){ + if (isBlank(this.formData.scanMaxCount)) { this.formData.scanMaxCount = 0 } - if (isBlank(this.formData.pdaMaxCount)){ + if (isBlank(this.formData.pdaMaxCount)) { this.formData.pdaMaxCount = 0 } - if (isBlank(this.formData.ipcMaxCount)){ + if (isBlank(this.formData.ipcMaxCount)) { this.formData.ipcMaxCount = 0 } - if (isBlank(this.formData.autoDecode)){ + if (isBlank(this.formData.autoDecode)) { this.formData.autoDecode = 1 } - if (isBlank(this.formData.fixedCount)){ + if (isBlank(this.formData.fixedCount)) { this.formData.fixedCount = 0 } - if (isBlank(this.formData.outputMode)){ + if (isBlank(this.formData.outputMode)) { this.formData.outputMode = 1 } - if (isBlank(this.formData.drugDealConfirm)){ + if (isBlank(this.formData.drugDealConfirm)) { this.formData.drugDealConfirm = 0 } updateSet(this.formData) @@ -456,12 +456,12 @@ export default { }); if (this.socket && this.socket.readyState === WebSocket.OPEN) { - const { autoDecode, fixedCount, outputMode } = this.formData; + const {autoDecode, fixedCount, outputMode} = this.formData; const settings = [ - { key: "AutoDecode", value: autoDecode }, - { key: "FixedCount", value: fixedCount }, - { key: "OutputMode", value: outputMode } + {key: "AutoDecode", value: autoDecode}, + {key: "FixedCount", value: fixedCount}, + {key: "OutputMode", value: outputMode} ]; settings.forEach(setting => { diff --git a/src/views/biz/DrugTraceQuery.vue b/src/views/biz/DrugTraceQuery.vue new file mode 100644 index 00000000..abb2eca0 --- /dev/null +++ b/src/views/biz/DrugTraceQuery.vue @@ -0,0 +1,809 @@ +<template> + <div class="app-container"> + <!-- 页面头部 --> + <div class="page-header"> + <div class="header-title"> + <i class="el-icon-monitor"></i> + <span>药品追溯系统</span> + </div> + <div class="header-info"> + <span>安全可靠 · 全程追溯 · 质量保证</span> + </div> + <div class="header-wave"></div> + </div> + + <!-- 扫码查询区域 --> + <el-card class="box-card scan-area" :body-style="{padding: '30px 20px'}"> + <div class="scan-title"> + <i class="el-icon-search pulse-icon"></i> + <span>药品追溯码查询</span> + </div> + <el-form :inline="true" :model="queryForm" size="mini"> + <el-form-item class="query-form-item"> + <el-input + v-model="queryForm.traceCode" + style="width: 600px" + placeholder="请扫描或输入药品追溯码" + clearable + @keyup.enter.native="handleSearch" + class="trace-input" + > + <i slot="prefix" class="el-icon-scan" style="font-size: 20px; color: #1976d2;"></i> + </el-input> + </el-form-item> + <el-form-item class="query-form-item"> + <el-button-group> + <el-button type="primary" icon="el-icon-search" @click="handleSearch" size="mini" class="search-btn">查询 + </el-button> + <el-button type="default" icon="el-icon-refresh" @click="resetForm" size="mini">重置</el-button> + </el-button-group> + </el-form-item> + </el-form> + </el-card> + + <!-- 药品基本信息 --> + <transition name="fade-transform" mode="out-in"> + <el-card class="box-card info-card" v-if="drugInfo.nameCode" key="info-card"> + <div slot="header" class="clearfix"> + <span><i class="el-icon-medicine-box"></i> 药品基本信息</span> + </div> + <el-descriptions :column="2" border> + <el-descriptions-item label="产品名称">{{ drugInfo.cpmctymc }}</el-descriptions-item> + <el-descriptions-item label="产品标识">{{ drugInfo.nameCode }}</el-descriptions-item> + <el-descriptions-item label="规格">{{ drugInfo.prepnSpec }}</el-descriptions-item> + <el-descriptions-item label="包装规格">{{ drugInfo.bzgg }}</el-descriptions-item> + <el-descriptions-item label="生产厂家">{{ drugInfo.manufactory }}</el-descriptions-item> + <el-descriptions-item label="注册证号">{{ drugInfo.zczbhhzbapzbh }}</el-descriptions-item> + <el-descriptions-item label="包装材料">{{ drugInfo.packMatrial }}</el-descriptions-item> + <el-descriptions-item label="计量单位">{{ drugInfo.measname }}</el-descriptions-item> + </el-descriptions> + </el-card> + </transition> + + <!-- 追溯记录 --> + <transition name="fade-transform" mode="out-in"> + <div class="trace-container" v-if="orderRecords.length > 0" key="trace-container"> + <el-row :gutter="20"> + <el-col :span="16"> + <el-card class="box-card" :body-style="{padding: '0 0 15px 0'}"> + <div slot="header" class="clearfix"> + <span><i class="el-icon-document"></i> 追溯记录</span> + </div> + <el-table + v-loading="tableLoading" + :data="orderRecords" + border + stripe + highlight-current-row + style="width: 100%" + > + <el-table-column type="index" label="序号" width="50" align="center"></el-table-column> + <el-table-column prop="billNo" label="单据号" align="center"></el-table-column> + <el-table-column prop="billTypeName" label="单据类型" align="center"></el-table-column> + <el-table-column prop="createTime" label="单据时间" align="center"></el-table-column> + <el-table-column prop="fromCorpName" label="往来单位" align="center"></el-table-column> + <el-table-column prop="deptName" label="部门" align="center"></el-table-column> + <el-table-column prop="invName" label="库房" align="center"></el-table-column> + <el-table-column label="操作" width="120" align="center"> + <template slot-scope="scope"> + <el-button + type="text" + size="mini" + @click="viewOrderDetail(scope.row)" + class="detail-btn" + > + <i class="el-icon-view mr-5"></i>查看明细 + </el-button> + </template> + </el-table-column> + </el-table> + </el-card> + </el-col> + <el-col :span="8"> + <el-card class="box-card flow-card"> + <div slot="header" class="clearfix"> + <span><i class="el-icon-share"></i> 流通流程</span> + </div> + <el-steps :active="orderRecords.length" direction="vertical" finish-status="success" class="custom-steps"> + <el-step + v-for="(item, index) in orderRecords" + :key="index" + :title="item.billTypeName" + :description="item.createTime + ' ' + item.billNo + ' ' + item.fromCorpName" + class="flow-step"> + <i slot="icon" :class="getStepIcon(item.billTypeName)"></i> + </el-step> + </el-steps> + </el-card> + </el-col> + </el-row> + </div> + </transition> + + <!-- 明细记录 --> + <transition name="fade-transform" mode="out-in"> + <el-card class="box-card detail-card" v-if="showOrderDetail" key="detail-card"> + <div slot="header" class="clearfix"> + <span><i class="el-icon-tickets"></i> 单据明细</span> + <el-button + style="float: right; padding: 3px 0" + type="text" + @click="showOrderDetail = false" + > + <i class="el-icon-close"></i> + </el-button> + </div> + <div class="detail-header" v-if="currentOrder"> + <div class="detail-info"> + <span class="detail-label">单据号:</span> + <span class="detail-value">{{ currentOrder.billNo }}</span> + </div> + <div class="detail-info"> + <span class="detail-label">单据类型:</span> + <span class="detail-value">{{ currentOrder.billTypeName }}</span> + </div> + <div class="detail-info"> + <span class="detail-label">单据时间:</span> + <span class="detail-value">{{ currentOrder.createTime }}</span> + </div> + </div> + <el-table + v-loading="detailLoading" + :data="orderDetails" + border + stripe + highlight-current-row + style="width: 100%" + > + <el-table-column type="index" label="序号" width="50" align="center"></el-table-column> + <el-table-column prop="orderIdFk" label="单据号" align="center"></el-table-column> + <el-table-column prop="nameCode" label="产品标识" align="center"></el-table-column> + <el-table-column prop="coName" label="产品名称" align="center"></el-table-column> + <el-table-column prop="spec" label="规格" align="center"></el-table-column> + <el-table-column prop="batchNo" label="批号" align="center"></el-table-column> + <el-table-column prop="productDate" label="生产日期" align="center"></el-table-column> + <el-table-column prop="expireDate" label="有效期至" align="center"></el-table-column> + <el-table-column prop="count" label="数量" align="center"></el-table-column> + <el-table-column prop="measname" label="单位" align="center"></el-table-column> + <el-table-column prop="manufacturer" label="生产厂家" align="center"></el-table-column> + </el-table> + <div class="empty-data" v-if="orderDetails.length === 0 && !detailLoading"> + <el-empty description="暂无明细数据"></el-empty> + </div> + </el-card> + </transition> + + <!-- 无数据提示 --> + <transition name="fade-transform" mode="out-in"> + <el-empty + v-if="!drugInfo.nameCode && !tableLoading && queryForm.traceCode" + description="未查询到相关追溯记录" + class="custom-empty" + key="empty-state" + > + <el-button type="primary" @click="resetForm">重新查询</el-button> + </el-empty> + </transition> + + <!-- 页面底部 --> + <div class="page-footer"> + <div class="footer-links"> + <a href="#">关于我们</a> + <span>|</span> + <a href="#">使用帮助</a> + <span>|</span> + <a href="#">联系客服</a> + </div> + <div class="footer-copyright"> + © 2024 药品追溯系统 版权所有 + </div> + </div> + </div> +</template> +<script> +import {getOrderRecords, getOrderDetails, getDrugInfo} from '@/api/biz/traceQuery' + +export default { + name: 'DrugTraceQuery', + data() { + return { + // 折叠面板激活项 + activeNames: ['1', '2', '3'], + // 查询表单 + queryForm: { + traceCode: '', + page: 1, + limit: 50 + }, + // 表格加载状态 + tableLoading: false, + detailLoading: false, + // 药品信息 + drugInfo: {}, + // 单据记录 + orderRecords: [], + // 单据明细 + orderDetails: [], + // 是否显示明细 + showOrderDetail: false, + // 当前选中的单据 + currentOrder: null + } + }, + methods: { + // 获取步骤图标 + getStepIcon(billTypeName) { + // 根据单据类型返回不同的图标 + const iconMap = { + '入库': 'el-icon-box', + '出库': 'el-icon-shopping-cart-full', + '采购': 'el-icon-shopping-bag-1', + '销售': 'el-icon-sell', + '调拨': 'el-icon-connection', + '盘点': 'el-icon-notebook-2', + '退货': 'el-icon-back' + } + + // 遍历图标映射,查找匹配的单据类型 + for (const key in iconMap) { + if (billTypeName && billTypeName.includes(key)) { + return iconMap[key] + } + } + + // 默认图标 + return 'el-icon-document' + }, + + // 搜索 + handleSearch() { + if (!this.queryForm.traceCode) { + this.$message.warning('请输入药品追溯码') + return + } + this.tableLoading = true + this.drugInfo = {} + this.orderRecords = [] + this.orderDetails = [] + this.showOrderDetail = false + + // 查询药品信息 + this.queryDrugInfo() + + // 查询单据记录 + this.queryOrderRecords() + }, + + // 查询药品信息 + queryDrugInfo() { + getDrugInfo({ + nameCode: this.queryForm.traceCode, + page: 1, + limit: 1 + }).then(response => { + if (response.code === 20000 && response.data.list && response.data.list.length > 0) { + this.drugInfo = response.data.list[0] + } else { + this.drugInfo = {} + } + }).catch(() => { + this.drugInfo = {} + }) + }, + + // 查询单据记录 + queryOrderRecords() { + getOrderRecords({ + traceCode: this.queryForm.traceCode, + page: this.queryForm.page, + limit: this.queryForm.limit + }).then(response => { + this.tableLoading = false + if (response.code === 20000) { + this.orderRecords = response.data.list || [] + } else { + this.$message.error(response.message || '查询失败') + this.orderRecords = [] + } + }).catch(() => { + this.tableLoading = false + this.orderRecords = [] + }) + }, + + // 查看单据明细 + viewOrderDetail(row) { + this.currentOrder = row + this.detailLoading = true + this.showOrderDetail = true + + getOrderDetails({ + orderIdFk: row.billNo, + page: 1, + limit: 100 + }).then(response => { + this.detailLoading = false + if (response.code === 20000) { + this.orderDetails = response.data.list || [] + if (this.orderDetails.length === 0) { + this.$message.info('该单据暂无明细记录') + } + } else { + this.$message.error(response.message || '查询明细失败') + this.orderDetails = [] + } + }).catch(() => { + this.detailLoading = false + this.orderDetails = [] + }) + }, + + // 重置表单 + resetForm() { + this.queryForm.traceCode = '' + this.drugInfo = {} + this.orderRecords = [] + this.orderDetails = [] + this.showOrderDetail = false + }, + + // 格式化日期 + formatDate(dateStr) { + if (!dateStr) return '' + // 处理日期格式,例如将 220110 转换为 2022-01-10 + if (dateStr.length === 6) { + const year = dateStr.substring(0, 2) + const month = dateStr.substring(2, 4) + const day = dateStr.substring(4, 6) + return `20${year}-${month}-${day}` + } + return dateStr + } + }, + mounted() { + // 防止拖拽文件到页面 + document.body.ondrop = function (event) { + event.preventDefault() + event.stopPropagation() + } + + // 如果URL中有追溯码参数,自动查询 + const traceCode = this.$route.query.traceCode + if (traceCode) { + this.queryForm.traceCode = traceCode + this.handleSearch() + } + } +} +</script> + +<style scoped> +/* 全局容器样式 */ +.app-container { + padding: 25px; + background-color: #f0f2f5; + min-height: calc(100vh - 84px); + transition: all 0.3s ease; +} + +/* 卡片通用样式 */ +.box-card { + margin-bottom: 24px; + border-radius: 12px; + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); + transition: all 0.3s ease; + overflow: hidden; + border: none; +} + +.box-card:hover { + box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); + transform: translateY(-2px); +} + +/* 卡片头部样式 */ +.box-card .el-card__header { + background: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%); + padding: 16px 20px; + border-bottom: none; +} + +.box-card .el-card__header span { + color: #fff; + font-size: 18px; + font-weight: 600; + display: flex; + align-items: center; +} + +.box-card .el-card__header span i { + margin-right: 10px; + font-size: 20px; +} + +/* 页面头部样式 */ +.page-header { + background: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%); + padding: 30px; + border-radius: 12px; + margin-bottom: 24px; + color: #fff; + box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15); + position: relative; + overflow: hidden; +} + +.page-header::before { + content: ''; + position: absolute; + top: -50%; + right: -50%; + width: 100%; + height: 200%; + background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 70%); + transform: rotate(30deg); +} + +.header-title { + font-size: 28px; + font-weight: bold; + margin-bottom: 12px; + display: flex; + align-items: center; +} + +.header-title i { + margin-right: 12px; + font-size: 28px; +} + +.header-info { + font-size: 16px; + opacity: 0.9; + letter-spacing: 1px; +} + +/* 扫码区域样式 */ +.scan-area { + text-align: center; + padding: 35px 25px; + background-color: #fff; +} + +.scan-title { + font-size: 22px; + color: #1976d2; + margin-bottom: 25px; + font-weight: 600; + display: flex; + align-items: center; + justify-content: center; +} + +.scan-title i { + margin-right: 12px; + font-size: 24px; +} + +.query-form-item { + margin: 25px 10px; + display: flex; + justify-content: center; +} + +.query-form-item .el-input { + box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08); + border-radius: 8px; + transition: all 0.3s ease; +} + +.query-form-item .el-input:focus-within { + box-shadow: 0 4px 12px rgba(25, 118, 210, 0.2); +} + +.query-form-item .el-input input { + height: 45px; + font-size: 15px; +} + +/* 按钮样式 */ +.el-button-group { + margin-left: 15px; +} + +.el-button-group .el-button { + border-radius: 8px; + padding: 12px 20px; + transition: all 0.3s ease; + font-weight: 500; + height: 45px; +} + +.el-button-group .el-button:hover { + transform: translateY(-2px); + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); +} + +.el-button-group .el-button.is-disabled:hover { + transform: none; + box-shadow: none; +} + +/* 信息卡片样式 */ +.info-card { + margin-top: 24px; +} + +.el-descriptions { + margin: 20px 0; + background-color: #fff; + border-radius: 8px; + overflow: hidden; +} + +.el-descriptions__label { + font-weight: 600; + color: #606266; +} + +.el-descriptions__content { + color: #303133; +} + +/* 表格样式 */ +.el-table { + margin: 15px 0; + border-radius: 8px; + overflow: hidden; + box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05); +} + +.el-table th { + background-color: #f5f7fa; + color: #606266; + font-weight: 600; + padding: 12px 0; +} + +.el-table td { + padding: 12px 0; +} + +.el-table--striped .el-table__body tr.el-table__row--striped td { + background-color: #fafafa; +} + +.el-table__body tr:hover > td { + background-color: #f0f7ff !important; +} + +/* 步骤条样式 */ +.trace-container { + margin-top: 24px; +} + +.flow-card { + height: 100%; +} + +.el-steps { + padding: 25px; + background-color: #fff; + border-radius: 8px; +} + +.el-step__title { + font-size: 15px; + font-weight: 500; +} + +.el-step__title.is-success { + color: #1976d2; +} + +.el-step__head.is-success { + color: #1976d2; + border-color: #1976d2; +} + +.el-step__description { + font-size: 13px; + color: #909399; +} + +.el-step__line { + background-color: #e8eaec; +} + +/* 空状态样式 */ +.el-empty { + padding: 50px 0; + background-color: #fff; + border-radius: 12px; + margin: 24px 0; + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); +} + +.el-empty__description { + margin-top: 15px; + font-size: 16px; + color: #909399; +} + +/* 页脚样式 */ +.page-footer { + margin-top: 50px; + text-align: center; + color: #606266; + padding: 25px 0; + border-top: 1px solid #ebeef5; + background-color: #fff; + border-radius: 12px; + box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05); +} + +.footer-links { + margin-bottom: 12px; +} + +.footer-links a { + color: #606266; + text-decoration: none; + margin: 0 15px; + font-size: 14px; + transition: all 0.3s ease; +} + +.footer-links span { + color: #dcdfe6; +} + +.footer-links a:hover { + color: #1976d2; +} + +.footer-copyright { + font-size: 13px; + color: #909399; +} + +/* 动画效果 */ +.fade-transform-enter-active, +.fade-transform-leave-active { + transition: all 0.5s; +} + +.fade-transform-enter { + opacity: 0; + transform: translateY(20px); +} + +.fade-transform-leave-to { + opacity: 0; + transform: translateY(-20px); +} + +/* 脉冲效果 */ +.pulse-icon { + animation: pulse 2s infinite; +} + +@keyframes pulse { + 0% { + transform: scale(1); + opacity: 1; + } + 50% { + transform: scale(1.1); + opacity: 0.8; + } + 100% { + transform: scale(1); + opacity: 1; + } +} + +/* 按钮悬停效果 */ +.detail-btn:hover i { + transform: translateX(-2px); +} + +.search-btn { + background: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%); + border: none; +} + +.search-btn:hover { + background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%); +} + +/* 明细卡片样式 */ +.detail-card { + margin-top: 24px; +} + +.detail-header { + display: flex; + flex-wrap: wrap; + padding: 15px 20px; + background-color: #f5f7fa; + border-radius: 8px; + margin-bottom: 15px; +} + +.detail-info { + margin-right: 30px; + margin-bottom: 10px; +} + +.detail-label { + font-weight: 600; + color: #606266; + margin-right: 5px; +} + +.detail-value { + color: #303133; +} + +.empty-data { + padding: 30px 0; +} + +/* 自定义步骤条 */ +.custom-steps { + padding: 10px 0; +} + +.flow-step { + margin-bottom: 10px; +} + +.flow-step .el-step__icon { + background-color: #e6f1fc; + border-color: #1976d2; +} + +.flow-step .el-step__icon.is-text { + border-radius: 50%; + border: 2px solid #1976d2; +} + +.flow-step .el-step__title { + font-weight: 600; +} + +.mr-5 { + margin-right: 5px; +} + +/* 自定义空状态 */ +.custom-empty { + padding: 40px 0; +} + +/* 响应式调整 */ +@media screen and (max-width: 768px) { + .app-container { + padding: 15px; + } + + .page-header { + padding: 20px; + } + + .header-title { + font-size: 22px; + } + + .scan-area { + padding: 20px 15px; + } + + .query-form-item .el-input { + width: 100% !important; + } +} +</style> +<script lang="ts"> +</script> diff --git a/src/views/collect/ConfirmDrugDealOrder.vue b/src/views/collect/ConfirmDrugDealOrder.vue index 8b8d44b4..7b56a3a5 100644 --- a/src/views/collect/ConfirmDrugDealOrder.vue +++ b/src/views/collect/ConfirmDrugDealOrder.vue @@ -1,359 +1,319 @@ <template> - <div> - <el-form :model="formData" class="order-el-form" ref="formData" label-width="120px" @submit.native.prevent> - <el-card> - - <!-- <el-alert--> - <!-- style="margin-top: 15px"--> - <!-- :title="msgTip"--> - <!-- :closable="false"--> - <!-- type="warning">--> - <!--</el-alert>--> - - <!-- <el-row :gutter="0" style="margin-top: 15px">--> - <!-- <el-col :span="24" align="right">--> - <!-- <el-button-group>--> - <!-- <!– <el-button type="primary" @click.native="deleteCode"–>--> - <!-- <!– v-if="labelName == 1"–>--> - <!-- <!– :disabled="formData.billNo == null"–>--> - <!-- <!– >扫码剔除–>--> - <!-- <!– </el-button>–>--> - <!-- <!– <el-button size="mini" type="primary"–>--> - <!-- <!– v-if="labelName == 2"–>--> - <!-- <!– @click.native="overdeleteCode"–>--> - <!-- <!– >结束剔除–>--> - <!-- <!– </el-button>–>--> - <!-- <el-button--> - <!-- type="primary"--> - <!-- :disabled="formData.billNo || (this.formDataVisible != null && this.formDataVisible.scanType == 1)"--> - <!-- @click.native="nextCollectOrder()"--> - <!-- >下一单--> - <!-- </el-button>--> - <!-- <el-button--> - <!-- type="primary"--> - <!-- :disabled="formData.billNo ||(this.formDataVisible != null && this.formDataVisible.scanType == 1)"--> - <!-- @click.native="selectPrescribe()"--> - <!-- >选单--> - <!-- </el-button>--> - <!-- <!– <el-button–>--> - <!-- <!– type="primary"–>--> - <!-- <!– :disabled="!formData.billNo"–>--> - <!-- <!– @click.native="saveDraftOrder()"–>--> - <!-- <!– >挂起–>--> - <!-- <!– </el-button>–>--> - <!-- <!– <el-button–>--> - <!-- <!– type="primary"–>--> - <!-- <!– :disabled="!formData.billNo"–>--> - <!-- <!– @click.native="cancelOrder()"–>--> - <!-- <!– >放弃–>--> - <!-- </el-button>--> - <!-- <el-button--> - <!-- type="primary"--> - <!-- :disabled="!formData.billNo"--> - <!-- @click.native="confirmFinishOrder()"--> - <!-- >完成--> - <!-- </el-button>--> - - <!-- <!– <el-dropdown @command="handleCommand">–>--> - <!-- <!– <el-button type="primary">–>--> - <!-- <!– 更多功能<i class="el-icon-arrow-down el-icon--right"></i>–>--> - <!-- <!– </el-button>–>--> - <!-- <!– <el-dropdown-menu slot="dropdown">–>--> - <!-- <!– <el-dropdown-item divided @click.native="handleClickOut('IoCreateOrderBlank')">工位上货</el-dropdown-item>–>--> - <!-- <!– <el-dropdown-item divided @click.native="handleClickReturn('IoCreateOrderBlank')">工位退货–>--> - <!-- <!– </el-dropdown-item>–>--> - <!-- <!– <el-dropdown-item divided @click.native="handleClick('ioSplitFifoCodeBlank')">工位存量</el-dropdown-item>–>--> - <!-- <!– <el-dropdown-item divided @click.native="handleClick('CollectOrderAllotBlank')">待处理单–>--> - <!-- <!– </el-dropdown-item>–>--> - <!-- <!– <el-dropdown-item divided @click.native="handleClick('CollectOrderEndBlank')">已完成单</el-dropdown-item>–>--> - <!-- <!– </el-dropdown-menu>–>--> - <!-- <!– </el-dropdown>–>--> - <!-- </el-button-group>--> - <!-- </el-col>--> - <!-- </el-row>--> - - <el-row style="margin-top: 6px;margin-bottom: -6px;" - v-if="this.formDataVisible != null && this.formDataVisible.scanType == 1" - > - <!-- <el-col :span="6">--> - <!-- <el-form-item prop="workPlaceCode" class="query-form-item" label="当前工位:">--> - <!-- <el-select--> - <!-- v-model="formData.workPlaceCode"--> - <!-- placeholder="当前工位"--> - <!-- style="width: 90%"--> - <!-- :disabled="corpOrderIdDisabled"--> - <!-- filterable--> - <!-- @change="workPlaceCodeChange"--> - <!-- >--> - <!-- <el-option--> - <!-- v-for="item in curWorkPlaces"--> - <!-- :key="item.workplaceId"--> - <!-- :label="item.workplaceName"--> - <!-- :value="item.workplaceId"--> - <!-- >--> - <!-- <span style="float: left">{{ item.workplaceName }}</span>--> - <!-- <span style="float: right; color: #8492a6; font-size: 13px">{{--> - <!-- item.workplaceId--> - <!-- }}</span>--> - <!-- </el-option>--> - <!-- </el-select>--> - <!-- </el-form-item>--> - <!-- </el-col>--> - - <!-- <el-col :span="6">--> - <!-- <el-form-item prop="busType" class="query-form-item" label="当前业务类型:">--> - <!-- <el-select v-model="formData.busType"--> - <!-- filterable--> - <!-- remote--> - <!-- @change="busTypeChange"--> - <!-- reserve-keyword--> - <!-- disabled--> - <!-- placeholder="请选择业务类型" clearable style="width: 55%">--> - <!-- <el-option--> - <!-- v-for="item in busTypeList"--> - <!-- :key="item.documentTypeCode"--> - <!-- :label="item.busName"--> - <!-- :value="item.documentTypeCode"--> - <!-- >--> - <!-- <span style="float: left">{{ item.busName }}</span>--> - <!-- <span style="float: right; color: #8492a6; font-size: 13px">{{ item.documentTypeCode }}</span>--> - <!-- </el-option>--> - <!-- </el-select>--> - <!-- <el-button type="primary" @click="toggleBusType" style="margin-left: 5px">切换业务</el-button>--> - <!-- </el-form-item>--> - <!-- </el-col>--> - <el-col :span="6"> - <el-form-item prop="locInvCode" label="发货方:"> - <el-select v-model="formData.shipper" placeholder="请选择发货方" clearable - :disabled="formData.billNo" - style="width: 90%" - > - <el-option - v-for="item in invList" - :key="item.name" - :label="item.name" - :value="item.code" - > - <span style="float: left">{{ item.name }}</span> - </el-option> - </el-select> - </el-form-item> - </el-col> - <el-col :span="6"> - <!-- :label="this.formDataVisible.unitTittle + ':'"--> - <el-form-item class="query-form-item" label="收货方"> - <el-select v-model="formData.fromCorp" - filterable - :disabled="formData.billNo" - remote - reserve-keyword - @change="changeCorp" - placeholder="请选择收货方" clearable style="width: 90%" - > - <el-option - v-for="item in fromInvOptions" - :key="item.code" - :label="item.name" - :value="item.code" - > - <span style="float: left">{{ item.name }}</span> - <span style="float: right; color: #8492a6; font-size: 13px">{{ item.code }}</span> - </el-option> - </el-select> - </el-form-item> - </el-col> - - </el-row> - - <div style="margin-top: 1px;padding: 5px"> - <el-row :gutter="0" style="margin-top: 5px"> - <el-col :span="16"> - <el-form-item prop="code" :label="scanTip" label-width="80px"> - <el-input - id="inputer" - @focus="getInputFocus($event)" - @keypress.enter.native="enterKey($event)" - ref="inputRef" - style="ime-mode: disabled" - type="tel" - :placeholder="this.placeholder" - v-model="scanCode" - ></el-input> - <!-- :disabled="scanDisabled"--> - </el-form-item> - </el-col> - <el-col :span="8"> - <el-button-group style="display: flex;"> - <el-button - type="primary" - size="mini" - icon="el-icon-search" - @click.native.stop="enterKey()" - style="margin-left: 15px" - > - </el-button> - <!-- :disabled="!formData.billNo || (this.formDataVisible != null && this.formDataVisible.scanType == 1)"--> - <!-- <el-button type="primary"--> - <!-- @click="addGs">ALT+29--> - <!-- </el-button>--> - <el-button - type="primary" - size="mini" - icon="el-icon-delete" - @click.native.stop="clearCode()" - >清空 - </el-button> + <div class="main-container"> + <div class="left-panel"> + <el-card c> + <el-form :model="formData" class="order-el-form" ref="formData" label-width="120px" @submit.native.prevent> + <!-- 左侧部分 --> + <!-- <el-alert--> + <!-- style="margin-top: 15px"--> + <!-- :title="msgTip"--> + <!-- :closable="false"--> + <!-- type="warning">--> + <!--</el-alert>--> + + <el-row :gutter="0" style="margin-top: 15px"> + <el-col :span="24" align="right"> + <el-button-group> + <!-- <el-button type="primary" @click.native="deleteCode"--> + <!-- v-if="labelName == 1"--> + <!-- :disabled="formData.billNo == null"--> + <!-- >扫码剔除--> + <!-- </el-button>--> + <!-- <el-button size="mini" type="primary"--> + <!-- v-if="labelName == 2"--> + <!-- @click.native="overdeleteCode"--> + <!-- >结束剔除--> + <!-- </el-button>--> <el-button type="primary" :disabled="formData.billNo || (this.formDataVisible != null && this.formDataVisible.scanType == 1)" @click.native="nextCollectOrder()" >下一单 </el-button> - <el-button - type="primary" - :disabled="!formData.billNo" - @click.native="cancelOrder()" - >放弃 - </el-button> <el-button type="primary" :disabled="formData.billNo ||(this.formDataVisible != null && this.formDataVisible.scanType == 1)" @click.native="selectPrescribe()" >选单 </el-button> + <!-- <el-button--> + <!-- type="primary"--> + <!-- :disabled="!formData.billNo"--> + <!-- @click.native="saveDraftOrder()"--> + <!-- >挂起--> + <!-- </el-button>--> + <!-- <el-button--> + <!-- type="primary"--> + <!-- :disabled="!formData.billNo"--> + <!-- @click.native="cancelOrder()"--> + <!-- >放弃--> + <!-- </el-button>--> <el-button type="primary" :disabled="!formData.billNo" @click.native="confirmFinishOrder()" >完成 </el-button> + + <!-- <el-dropdown @command="handleCommand">--> + <!-- <el-button type="primary">--> + <!-- 更多功能<i class="el-icon-arrow-down el-icon--right"></i>--> + <!-- </el-button>--> + <!-- <el-dropdown-menu slot="dropdown">--> + <!-- <el-dropdown-item divided @click.native="handleClickOut('IoCreateOrderBlank')">工位上货</el-dropdown-item>--> + <!-- <el-dropdown-item divided @click.native="handleClickReturn('IoCreateOrderBlank')">工位退货--> + <!-- </el-dropdown-item>--> + <!-- <el-dropdown-item divided @click.native="handleClick('ioSplitFifoCodeBlank')">工位存量</el-dropdown-item>--> + <!-- <el-dropdown-item divided @click.native="handleClick('CollectOrderAllotBlank')">待处理单--> + <!-- </el-dropdown-item>--> + <!-- <el-dropdown-item divided @click.native="handleClick('CollectOrderEndBlank')">已完成单</el-dropdown-item>--> + <!-- </el-dropdown-menu>--> + <!-- </el-dropdown>--> </el-button-group> </el-col> </el-row> - <!-- <el-row :gutter="0">--> - <!-- <el-col :span="20" style="margin-top: 0px;margin-bottom: 10px;margin-left: 80px">--> - <!-- <el-checkbox v-model="checked" v-if="!this.formData.billNo && this.formDataVisible.scanType != 1">定向查询--> - <!-- </el-checkbox>--> - <!-- </el-col>--> - <!-- </el-row>--> - <el-alert - :title="scanTitle" - :type="scanResultType" - :closable="false" - :dangerouslyUseHTMLString="true" - :description="result" - > - </el-alert> - <el-alert - v-if="warnVisible" - title="警告信息:" - type="warning" - :closable="true" - :dangerouslyUseHTMLString="true" - :description="warnResult" - > - </el-alert> - <el-alert - v-if="errVisible" - title="错误信息:" - type="warning" - :closable="true" - :dangerouslyUseHTMLString="true" - :description="errResult" - > - </el-alert> - - - </div> - <el-descriptions :column="4" border style="margin-top: 5px"> - <el-descriptions-item label="业务单号">{{ formData.billNo }}</el-descriptions-item> - <!-- <el-descriptions-item label="发货方">{{ formData.shipperName }}</el-descriptions-item>--> - <el-descriptions-item label="收货方">{{ formData.fromCorpName }}</el-descriptions-item> - <!-- <el-descriptions-item label="单据类型">{{ formData.busTypeName }}</el-descriptions-item>--> - <!-- <el-descriptions-item label="来源系统">{{ formData.fromType }}</el-descriptions-item>--> - <el-descriptions-item label="单据时间">{{ formData.billTime }}</el-descriptions-item> - <!-- <el-descriptions-item label="单据备注">{{ formData.remark }}</el-descriptions-item>--> - - <el-descriptions-item - label="灯组信息" - > - <!--colorStyle(formData.ledNum)--> - <!--<el-tag style="color:red ">灯组信息</el-tag>--> - <el-tag :type="colorStyle(formData.ledNum)" v-if="formData.ledNum != null">{{ledName}}</el-tag> - </el-descriptions-item> - </el-descriptions> - - <div style="margin-top: 18px"> + + <el-row style="margin-top: 6px;margin-bottom: -6px;" + v-if="this.formDataVisible != null && this.formDataVisible.scanType == 1"> + <!-- <el-col :span="6">--> + <!-- <el-form-item prop="workPlaceCode" class="query-form-item" label="当前工位:">--> + <!-- <el-select--> + <!-- v-model="formData.workPlaceCode"--> + <!-- placeholder="当前工位"--> + <!-- style="width: 90%"--> + <!-- :disabled="corpOrderIdDisabled"--> + <!-- filterable--> + <!-- @change="workPlaceCodeChange"--> + <!-- >--> + <!-- <el-option--> + <!-- v-for="item in curWorkPlaces"--> + <!-- :key="item.workplaceId"--> + <!-- :label="item.workplaceName"--> + <!-- :value="item.workplaceId"--> + <!-- >--> + <!-- <span style="float: left">{{ item.workplaceName }}</span>--> + <!-- <span style="float: right; color: #8492a6; font-size: 13px">{{--> + <!-- item.workplaceId--> + <!-- }}</span>--> + <!-- </el-option>--> + <!-- </el-select>--> + <!-- </el-form-item>--> + <!-- </el-col>--> + + <!-- <el-col :span="6">--> + <!-- <el-form-item prop="busType" class="query-form-item" label="当前业务类型:">--> + <!-- <el-select v-model="formData.busType"--> + <!-- filterable--> + <!-- remote--> + <!-- @change="busTypeChange"--> + <!-- reserve-keyword--> + <!-- disabled--> + <!-- placeholder="请选择业务类型" clearable style="width: 55%">--> + <!-- <el-option--> + <!-- v-for="item in busTypeList"--> + <!-- :key="item.documentTypeCode"--> + <!-- :label="item.busName"--> + <!-- :value="item.documentTypeCode"--> + <!-- >--> + <!-- <span style="float: left">{{ item.busName }}</span>--> + <!-- <span style="float: right; color: #8492a6; font-size: 13px">{{ item.documentTypeCode }}</span>--> + <!-- </el-option>--> + <!-- </el-select>--> + <!-- <el-button type="primary" @click="toggleBusType" style="margin-left: 5px">切换业务</el-button>--> + <!-- </el-form-item>--> + <!-- </el-col>--> + <el-col :span="6"> + <el-form-item prop="locInvCode" label="发货方:"> + <el-select v-model="formData.shipper" placeholder="请选择发货方" clearable + :disabled="formData.billNo" + style="width: 90%" + > + <el-option + v-for="item in invList" + :key="item.name" + :label="item.name" + :value="item.code"> + <span style="float: left">{{ item.name }}</span> + </el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="6"> + <!-- :label="this.formDataVisible.unitTittle + ':'"--> + <el-form-item class="query-form-item" label="收货方"> + <el-select v-model="formData.fromCorp" + filterable + :disabled="formData.billNo" + remote + reserve-keyword + @change="changeCorp" + placeholder="请选择收货方" clearable style="width: 90%"> + <el-option + v-for="item in fromInvOptions" + :key="item.code" + :label="item.name" + :value="item.code" + > + <span style="float: left">{{ item.name }}</span> + <span style="float: right; color: #8492a6; font-size: 13px">{{ item.code }}</span> + </el-option> + </el-select> + </el-form-item> + </el-col> + + </el-row> + + <div style="border: 1px solid #ebeef5;border-radius: 2px;margin-top: 15px;padding: 15px"> + <el-row :gutter="0" style="margin-top: 5px"> + <el-col :span="20"> + <el-form-item prop="code" :label="scanTip" label-width="80px"> + <el-input + id="inputer" + @focus="getInputFocus($event)" + @keypress.enter.native="enterKey($event)" + ref="inputRef" + style="ime-mode: disabled" + type="tel" + :placeholder="this.placeholder" + v-model="scanCode" + ></el-input> + <!-- :disabled="scanDisabled"--> + </el-form-item> + </el-col> + <el-col :span="4"> + <el-button-group style="display: flex;"> + <el-button + type="primary" + size="mini" + icon="el-icon-search" + @click.native.stop="enterKey()" + style="margin-left: 15px" + > + </el-button> + <!-- :disabled="!formData.billNo || (this.formDataVisible != null && this.formDataVisible.scanType == 1)"--> + <!-- <el-button type="primary"--> + <!-- @click="addGs">ALT+29--> + <!-- </el-button>--> + <el-button + type="primary" + size="mini" + icon="el-icon-delete" + @click.native.stop="clearCode()" + >清空 + </el-button> + </el-button-group> + </el-col> + </el-row> + <!-- <el-row :gutter="0">--> + <!-- <el-col :span="20" style="margin-top: 0px;margin-bottom: 10px;margin-left: 80px">--> + <!-- <el-checkbox v-model="checked" v-if="!this.formData.billNo && this.formDataVisible.scanType != 1">定向查询--> + <!-- </el-checkbox>--> + <!-- </el-col>--> + <!-- </el-row>--> + <el-alert + :title="scanTitle" + :type="scanResultType" + :closable="false" + :dangerouslyUseHTMLString="true" + :description="result"> + </el-alert> + <el-alert + v-if="warnVisible" + title="警告信息:" + type="warning" + :closable="true" + :dangerouslyUseHTMLString="true" + :description="warnResult"> + </el-alert> + <el-alert + v-if="errVisible" + title="错误信息:" + type="warning" + :closable="true" + :dangerouslyUseHTMLString="true" + :description="errResult"> + </el-alert> + + + </div> + <el-descriptions title="单据信息" :column="2" border style="margin-top: 15px"> + <el-descriptions-item label="业务单号">{{ formData.billNo }}</el-descriptions-item> + <el-descriptions-item label="发货方">{{ formData.shipperName }}</el-descriptions-item> + <el-descriptions-item label="收货方">{{ formData.fromCorpName }}</el-descriptions-item> + <el-descriptions-item label="单据类型">{{ formData.busTypeName }}</el-descriptions-item> + <el-descriptions-item label="来源系统">{{ formData.fromType }}</el-descriptions-item> + <el-descriptions-item label="单据时间">{{ formData.billTime }}</el-descriptions-item> + <el-descriptions-item label="单据备注">{{ formData.remark }}</el-descriptions-item> + </el-descriptions> + </el-form> + </el-card> + </div> + <div class="right-panel"> + <el-tabs type="border-card" class="right-tabs" v-model="editableTabsValue"> + <el-tab-pane label="扫码详情" name="prescribeOriginPanel"> <prescribeOriginPanel v-if="panelALive" :prescribeData="curRow" :fifoSplitResult="this.fifoSplitResult" ></prescribeOriginPanel> - </div> - - </el-card> - - <!-- <el-card type="border-card" style="margin: 15px" v-model="editableTabsValue && formData.billNo">--> - <!-- <el-tab-pane label="详情" name="prescribeOriginPanel">--> - - <!-- 在表格下方添加说明 --> - <!-- <el-row style="text-align: right;font-size: 12px;margin-top: 10px">--> - <!-- <el-col span="24">--> - <!-- <div style="float: right">--> - <!-- <td>--> - <!-- <div style="background-color: #F56C6C;width: 10px;height: 10px;"></div>--> - <!-- </td>--> - <!-- <td><span style="color: #6d6d6d;"><pre>未赋码 </pre></span></td>--> - - - <!-- <td>--> - <!-- <div style="background-color: #E6A23C;width: 10px;height: 10px;"></div>--> - <!-- </td>--> - <!-- <td>--> - <!-- <span style="color: #6d6d6d;"><pre>预赋码 </pre></span>--> - <!-- </td>--> - - - <!-- <td>--> - <!-- <div style="background-color: #67C23A;width: 10px;height: 10px;"></div>--> - <!-- </td>--> - <!-- <td>--> - <!-- <span style="color: #6d6d6d;"><pre>已赋码</pre></span>--> - <!-- </td>--> - <!-- </div>--> - <!-- </el-col>--> - <!-- </el-row>--> - <!-- </el-tab-pane>--> - <!-- <el-tab-pane label="扫码明细">--> - <!-- <PanelOrderManuTagCode--> - <!-- v-if="panelALive"--> - <!-- :fifoSplit="3"--> - <!-- :prescribeData="curRow"--> - <!-- :refreshPanel="refreshCodesPanelP"--> - <!-- ></PanelOrderManuTagCode>--> - <!-- </el-tab-pane>--> - <!-- <el-tab-pane label="拆零详情" name="prescribeCodePanel1">--> - <!-- <prescribeCodePanel--> - <!-- v-if="panelALive"--> - <!-- :prescribeData="curRow"--> - <!-- :fifoSplit="1"--> - <!-- ></prescribeCodePanel>--> - <!-- </el-tab-pane>--> - <!-- <el-tab-pane label="整取详情" name="prescribeCodePanel2">--> - <!-- <prescribeCodePanel--> - <!-- v-if="panelALive"--> - <!-- :prescribeData="curRow"--> - <!-- :fifoSplit="2"--> - <!-- ></prescribeCodePanel>--> - <!-- </el-tab-pane>--> - <!-- <el-tab-pane label="整单详情" name="PanelOrderAllDetail">--> - <!-- <PanelOrderAllDetail--> - <!-- v-if="panelALive"--> - <!-- :prescribeData="curRow"--> - <!-- ></PanelOrderAllDetail>--> - <!-- </el-tab-pane>--> - - <!--</el-card>--> + <!-- 在表格下方添加说明 --> + <el-row style="text-align: right;font-size: 12px;margin-top: 10px"> + <el-col span="24"> + <div style="float: right"> + <td> + <div style="background-color: #F56C6C;width: 10px;height: 10px;"></div> + </td> + <td><span style="color: #6d6d6d;"><pre>未赋码 </pre></span></td> + + + <td> + <div style="background-color: #E6A23C;width: 10px;height: 10px;"></div> + </td> + <td> + <span style="color: #6d6d6d;"><pre>预赋码 </pre></span> + </td> + + + <td> + <div style="background-color: #67C23A;width: 10px;height: 10px;"></div> + </td> + <td> + <span style="color: #6d6d6d;"><pre>已赋码</pre></span> + </td> + </div> + </el-col> + </el-row> + </el-tab-pane> + <!-- <el-tab-pane label="扫码明细">--> + <!-- <PanelOrderManuTagCode--> + <!-- v-if="panelALive"--> + <!-- :fifoSplit="3"--> + <!-- :prescribeData="curRow"--> + <!-- :refreshPanel="refreshCodesPanelP"--> + <!-- ></PanelOrderManuTagCode>--> + <!-- </el-tab-pane>--> + <!-- <el-tab-pane label="拆零详情" name="prescribeCodePanel1">--> + <!-- <prescribeCodePanel--> + <!-- v-if="panelALive"--> + <!-- :prescribeData="curRow"--> + <!-- :fifoSplit="1"--> + <!-- ></prescribeCodePanel>--> + <!-- </el-tab-pane>--> + <!-- <el-tab-pane label="整取详情" name="prescribeCodePanel2">--> + <!-- <prescribeCodePanel--> + <!-- v-if="panelALive"--> + <!-- :prescribeData="curRow"--> + <!-- :fifoSplit="2"--> + <!-- ></prescribeCodePanel>--> + <!-- </el-tab-pane>--> + <!-- <el-tab-pane label="整单详情" name="PanelOrderAllDetail">--> + <!-- <PanelOrderAllDetail--> + <!-- v-if="panelALive"--> + <!-- :prescribeData="curRow"--> + <!-- ></PanelOrderAllDetail>--> + <!-- </el-tab-pane>--> + + </el-tabs> <el-dialog title="选入业务单据" @@ -397,8 +357,7 @@ <div style="display: flex; justify-content: space-between; align-items: center; height: 46px; /* 约为 200px 的 1/3 */" - @click="selectBusType(info.documentTypeCode)" - > + @click="selectBusType(info.documentTypeCode)"> <p style="font-size: 20px;background-color: #e1f3fb;font-weight: bold;">{{ info.busName }}</p> <!-- 假设你的信息对象中包含一个title属性 --> <!-- <div style="width: 60px; height: 60px; display: flex; justify-content: center; align-items: center;">--> @@ -414,8 +373,7 @@ <p style="font-size: 14px;background-color: #e1f3fb" @click="selectBusType(info.documentTypeCode)"> {{ info.remark }}</p> <el-button type="primary" style="position: absolute; bottom: 20px; right: 20px;" icon="el-icon-thumb" - @click="selectBusType(info.documentTypeCode)" - >开始作业 + @click="selectBusType(info.documentTypeCode)">开始作业 </el-button> </div> @@ -427,23 +385,24 @@ </el-dialog> - </el-form> + </div> + </div> </template> <script> -import addOrder from '@/views/inout/DialogCreateOrder' -import errOrder from '@/views/inout/IoCreateErrorOrder' -import { executeFuc, getHead } from '@/utils/customConfig' -import { convertDate } from '@/utils/date' -import selectPrescribeDialog from '@/views/collect/selectCollectOrderDialog' -import PanelOrderManuTagCode from './PanelOrderManuTagCode' -import prescribeOriginPanel from './PannelOrderBizCard' -import prescribeCodePanel from './PanelOrderTagCode' -import PannelOrderBiz from './PannelOrderBiz' -import { listPage } from '@/api/basic/workPlace/sysWorkplaceManage' -import { enterCodeWeb, batchVailCode, enterCodeBillNo, saveOrderWeb, batchUpdateCode } from '@/api/inout/order' +import addOrder from "@/views/inout/DialogCreateOrder"; +import errOrder from "@/views/inout/IoCreateErrorOrder"; +import {executeFuc, getHead} from "@/utils/customConfig"; +import {convertDate} from "@/utils/date"; +import selectPrescribeDialog from "@/views/collect/selectCollectOrderDialog"; +import PanelOrderManuTagCode from "./PanelOrderManuTagCode"; +import prescribeOriginPanel from "./PannelOrderBizCard"; +import prescribeCodePanel from "./PanelOrderTagCode"; +import PannelOrderBiz from "./PannelOrderBiz"; +import {listPage} from "@/api/basic/workPlace/sysWorkplaceManage"; +import {enterCodeWeb, batchVailCode, enterCodeBillNo, saveOrderWeb, batchUpdateCode} from "@/api/inout/order"; import { cancelOrder, draftOrder, @@ -452,33 +411,33 @@ import { tagCode, updateOrder, vailOrderFinish -} from '@/api/collect/splitCreateOrder' -import { selectCorpList } from '@/api/basic/basicUnitMaintain' +} from "@/api/collect/splitCreateOrder"; +import {selectCorpList} from "@/api/basic/basicUnitMaintain"; import { getCurOrder, getNextOrder, findByBill, findFromCorp, - orderDetail, bizConfirm, - removeByScanCode, confirmFinish -} from '@/api/collect/collectOrder' -import PanelOrderAllDetail from '@/views/collect/PanelOrderAllDetail' -import { getWorkBindBusTypes, removeBusTypeById } from '@/api/basic/workPlace/sysWorkplaceDocuments' -import { getInvListByUser } from '@/api/system/invWarehouse' -import { orderbatchAddCode } from '@/api/inout/splitCode' -import { isBlank } from '@/utils/strUtil' + orderDetail,bizConfirm, + removeByScanCode,confirmFinish +} from "@/api/collect/collectOrder"; +import PanelOrderAllDetail from "@/views/collect/PanelOrderAllDetail"; +import {getWorkBindBusTypes, removeBusTypeById} from '@/api/basic/workPlace/sysWorkplaceDocuments' +import {getInvListByUser} from "@/api/system/invWarehouse"; +import {orderbatchAddCode} from "@/api/inout/splitCode"; +import {isBlank} from "@/utils/strUtil"; import { getSet } from '@/api/collect/collectSet' export default { /** * 处理处方 */ - name: 'prescribeTagCodeDeal', + name: "prescribeTagCodeDeal", props: { resetKey: { type: Function, required: true - } + }, }, data() { return { @@ -486,7 +445,7 @@ export default { 'prescribeOriginPanel', 'prescribeCodePanel1', 'prescribeCodePanel2', - 'PanelOrderAllDetail' + 'PanelOrderAllDetail', ], editableTabsValue: 'prescribeOriginPanel', fromInvOptions: [], @@ -505,15 +464,15 @@ export default { filterQuery: { billNo: null, page: 1, - limit: 10 + limit: 10, }, list: [], total: 0, - defaultSort: { prop: 'createTime', order: 'desc' }, + defaultSort: {prop: 'createTime', order: 'desc'}, formDataVisible: { scanType: null, - unitTittle: '往来单位', - corpType: 1 + unitTittle: "往来单位", + corpType: 1, }, curWorkPlaces: [], erpList: [], @@ -534,22 +493,22 @@ export default { inv: this.$store.getters.locInvName, deptName: this.$store.getters.locDeptName, userName: this.$store.getters.name, - companyName: this.$store.getters.companyName + companyName: this.$store.getters.companyName, }, curRow: null, panelALive: false, autoFinishOrderFlag: true,//是否对完成的单据提示立即提交 //扫码相关 - scanCode: '', + scanCode: "", isSuccess: false, checked: true, - scanTitle: '单据录入结果:', - result: ' \n', - msgTip: '信息提醒:', - originCode: '', + scanTitle: "单据录入结果:", + result: " \n", + msgTip: "信息提醒:", + originCode: "", checkSuccess: false, - scanResultType: 'success', + scanResultType: "success", isSelectOrder: false, isFinishOrder: true, busQuery: { @@ -565,14 +524,14 @@ export default { viewType: 1, scanDisabled: false, valiCodes: [], - warnResult: '', - errResult: '', + warnResult: "", + errResult: "", warnVisible: false, errVisible: false, needSplitConfirm: false, workplaceId: null, ws: null, - scanTip: '单据录入:', + scanTip: "单据录入:", scanSplit: false, info: {}, // @@ -582,9 +541,7 @@ export default { }, labelName: 1, scanStatus: null, // 1:扫码剔除; null 处理单据 - collectSet: {}, - ledname: 2, - ledName: '未绑定' + collectSet: {} } }, @@ -604,12 +561,12 @@ export default { }, methods: { - fifoHandleClick(scanCode) { + fifoHandleClick(scanCode){ this.info.confirmSplitCode = scanCode bizConfirm(this.info).then((response) => { if (response.code === 20000) { this.$message.success('操作成功!') - this.getPrescribeDetail(this) + this.getPrescribeDetail(this); return } else { this.$message.error(response.message) @@ -618,18 +575,17 @@ export default { }, //是否拆零的组件调用父级方法 - fifoSplitResult(data, info) { + fifoSplitResult(data,info){ this.info = info - if (data == null) { - return - } - if (data.needSplitConfirm) {//需要 + if (data == null) + return; + if (data.needSplitConfirm){//需要 this.needSplitConfirm = data.needSplitConfirm - this.scanTitle = '拆零扫码结果:' - this.scanTip = '拆零扫码:' - this.result = '' - return - } else {//不需要 + this.scanTitle = "拆零扫码结果:"; + this.scanTip = "拆零扫码:"; + this.result = ""; + return; + }else {//不需要 return } }, @@ -638,16 +594,13 @@ export default { billNo: billNo, workPlaceCode: this.workplaceId, page: 1, - limit: 10 + limit: 10, } findByBill(post).then(res => { if (res.code == 20000) { if (res.data.billNo != null) { this.formData = res.data - if (this.formData.ledNum == null){ - this.formData.ledNum = 5 - } - this.scanCode = '' + this.scanCode = ""; this.formData.workPlaceCode = this.workplaceId this.checked = false } @@ -662,7 +615,7 @@ export default { this.formData.busType = val this.selectBusTypeDisabled = false if (this.formData.workPlaceCode != null) { - this.findCurOrder() + this.findCurOrder(); } }, getWorkBindBusTypes(workplaceId) { @@ -673,40 +626,39 @@ export default { this.busTypeTotal = res.data.total if (this.formData.billNo != null) { this.getBillNo(this.formData.billNo) - this.startDeal() + this.startDeal(); } else { if (this.busTypeList.length == 1 && this.$route.query.busType == null) { this.formDataVisible = this.busTypeList[0] this.formData.busType = this.busTypeList[0].documentTypeCode this.selectBusTypeDisabled = false if (this.formDataVisible.scanType == 1) { - this.findFromInvList('') - this.getInvList() - this.placeholder = '请点击输入框进行扫码生成业务单据' + this.findFromInvList(""); + this.getInvList(); + this.placeholder = '请点击输入框进行扫码生成业务单据'; } else { - this.findCurOrder() + this.findCurOrder(); } } else { console.log(this.$route.query.busType) if (this.$route.query.busType != null) { this.formData.busType = this.$route.query.busType - this.$refs.inputRef.focus() - this.formDataVisible = this.busTypeList.find(item => item.documentTypeCode == this.formData.busType) + this.$refs.inputRef.focus(); + this.formDataVisible = this.busTypeList.find(item => item.documentTypeCode == this.formData.busType); if (this.formDataVisible.scanType == 1) { - this.findFromInvList('') - this.getInvList() - this.placeholder = '请点击输入框进行扫码生成业务单据' + this.findFromInvList(""); + this.getInvList(); + this.placeholder = '请点击输入框进行扫码生成业务单据'; } else { - this.findCurOrder() + this.findCurOrder(); } } } } - } return }) @@ -715,13 +667,13 @@ export default { let cQuery = { corpType: this.formDataVisible.corpType, invCode: this.formData.invCode - } + }; findFromCorp(cQuery) .then((response) => { - this.fromInvOptions = response.data || [] + this.fromInvOptions = response.data || []; }) .catch(() => { - }) + }); }, workPlaceCodeChange(value) { this.getWorkBindBusTypes(value) @@ -729,33 +681,33 @@ export default { }, busTypeChange(value) { - let busType = this.busTypeList.find(item => item.documentTypeCode === value) + let busType = this.busTypeList.find(item => item.documentTypeCode === value); this.formData.busType = busType.documentTypeCode this.selectBusTypeDisabled = false this.formDataVisible = busType if (this.formDataVisible.scanType == 1) { - this.findFromInvList('') + this.findFromInvList(""); } - this.findCurOrder() + this.findCurOrder(); }, handleClick(blankName) { // let url = window.location.origin+`#/tagCodeBlank?workplaceId=`+ this.stationList[index].workplaceId let url = window.location.origin + `#/` + blankName + `?workplaceId=` + this.workplaceId // this.$router.push( workplaceId) - window.open(url, '_blank') + window.open(url, '_blank'); }, handleClickOut(blankName) { // let url = window.location.origin+`#/tagCodeBlank?workplaceId=`+ this.stationList[index].workplaceId let url = window.location.origin + `#/` + blankName + `?splitType=out&workplaceId=` + this.workplaceId // this.$router.push( workplaceId) - window.open(url, '_blank') + window.open(url, '_blank'); }, handleClickReturn(blankName) { // let url = window.location.origin+`#/tagCodeBlank?workplaceId=`+ this.stationList[index].workplaceId let url = window.location.origin + `#/` + blankName + `?splitType=return&workplaceId=` + this.workplaceId // this.$router.push( workplaceId) - window.open(url, '_blank') + window.open(url, '_blank'); }, //获取当前货位 findCurWorkPlaces(val) { @@ -764,69 +716,69 @@ export default { status: 1, // invCode: this.formData.invCode, page: 1, - limit: 100 + limit: 100, } listPage(query).then((res) => { - this.curWorkPlaces = res.data.list || [] + this.curWorkPlaces = res.data.list || []; if (this.curWorkPlaces.length == 1 && this.formData.workPlaceCode == null) { - this.formData.workPlaceCode = this.curWorkPlaces[0].workplaceId - this.workPlaceCodeChange(this.formData.workPlaceCode) + this.formData.workPlaceCode = this.curWorkPlaces[0].workplaceId; + this.workPlaceCodeChange(this.formData.workPlaceCode); } }) }, //界面配置相关------------ executeFuc(row, type, clickFuc, value) { - return executeFuc(this, row, type, clickFuc, value) + return executeFuc(this, row, type, clickFuc, value); }, executeEval(row, expression, defaultRet) { if (expression) { - return eval(expression) + return eval(expression); } - return defaultRet + return defaultRet; }, ///界面配置相关------------end + hideSearch() { - this.showSearch = !this.showSearch + this.showSearch = !this.showSearch; }, refreshCodesPanel(_this) { - _this.panelALive = false + _this.panelALive = false; _this.$nextTick(() => { - _this.panelALive = true - }) - _this.getBizDetailList() - _this.vailOrderFinish() + _this.panelALive = true; + }); + _this.getBizDetailList(); + _this.vailOrderFinish(); }, refreshCodesPanelBank(_this) { - _this.panelALive = false + _this.panelALive = false; _this.$nextTick(() => { - _this.panelALive = true - }) + _this.panelALive = true; + }); // _this.getBizDetailList(); - _this.vailOrderFinish() + _this.vailOrderFinish(); }, refreshCodesPanelP() { let _this = this - _this.panelALive = false + _this.panelALive = false; _this.$nextTick(() => { - _this.panelALive = true - }) - _this.vailOrderFinish() + _this.panelALive = true; + }); + _this.vailOrderFinish(); }, getInputFocus(event) { - event.currentTarget.select() + event.currentTarget.select(); }, getBizDetailList() { let preQuery = {} - if (this.formData == null) { + if (this.formData == null) return - } if (this.formData != null) { preQuery = { orderIdFk: this.formData.billNo - } + }; } orderDetail(preQuery).then(res => { if (res.code != 20000) { @@ -834,14 +786,14 @@ export default { return } this.splitBizList = res.data.list - let tip = '' + let tip = ""; this.splitBizList.forEach((item) => { if (item.splitUnCheck) { - tip = tip + item.cpmctymc + ',' + tip = tip + item.cpmctymc + "," } - }) + }); if (this.$isNotBlank(tip)) { - tip = '请扫码确认以下产品' + tip + '需拆零的追溯码!' + tip = "请扫码确认以下产品" + tip + "需拆零的追溯码!" // this.$alert(tip, "提示", { // confirmButtonText: "确定", // type: "warning", @@ -850,130 +802,131 @@ export default { // }, // }); - this.warnVisible = true - this.warnResult = tip - this.scanTip = '扫码拆零确认:' - this.$refs.inputRef.focus() - this.$refs.inputRef.select() + this.warnVisible = true; + this.warnResult = tip; + this.scanTip = "扫码拆零确认:" + this.$refs.inputRef.focus(); + this.$refs.inputRef.select(); this.scanSplit = true - return + return; } else { //没有需要确认的 this.scanSplit = false - this.overdeleteCode() + this.overdeleteCode(); } + }).catch(() => { - this.$message.error('数据加载失败') + this.$message.error("数据加载失败") }) }, enterKey() { if (this.$isBlank(this.scanCode)) { - this.$message.error('请先扫码') + this.$message.error("请先扫码") return } if (!this.needSplitConfirm) { this.enterBillNoKey() - return + return; } else { this.fifoHandleClick(this.scanCode) - this.startDeal() - return + this.startDeal(); + return; } }, enterBillNoKey(billNo) { - this.checkSuccess = true - this.filterQuery.code = this.scanCode + this.checkSuccess = true; + this.filterQuery.code = this.scanCode; let tQuery = { - viewType: 'tagCode', + viewType: "tagCode", workPlaceCode: this.workplaceId, originCode: this.originCode, busType: this.formData.busType, code: this.filterQuery.code.trim(), selectType: 1 - } + }; if (billNo != null) { tQuery.code = billNo } enterCodeBillNo(tQuery).then((response) => { if (response.code === 20000) { - this.$refs.inputRef.focus() - this.$refs.inputRef.select() - this.isSuccess = true + this.$refs.inputRef.focus(); + this.$refs.inputRef.select(); + this.isSuccess = true; this.printCodeResult(response.data, response.message) - this.filterQuery.code = response.data.code - this.scanCode = '' - this.originCode = '' + this.filterQuery.code = response.data.code; + this.scanCode = "" + this.originCode = "" - this.addCode() + this.addCode(); } else { if (response.code == 502) { - this.checkSuccess = false - this.isSuccess = false + this.checkSuccess = false; + this.isSuccess = false; this.printCodeResult(response.data, response.message) - this.filterQuery.code = response.data.code - this.originCode = response.data.code - this.scanCode = '' + this.filterQuery.code = response.data.code; + this.originCode = response.data.code; + this.scanCode = "" } else if (response.code == 501) { - this.checkSuccess = false - this.$message.error(response.message) - this.scanCode = '' + this.checkSuccess = false; + this.$message.error(response.message); + this.scanCode = "" } else if (response.code == 503) { - this.checkSuccess = false - this.isSuccess = false + this.checkSuccess = false; + this.isSuccess = false; this.printCodeResult(response.data, response.message) - this.filterQuery.code = response.data.code - this.scanCode = '' - this.$confirm(response.message, '提示', { - type: 'warning' + this.filterQuery.code = response.data.code; + this.scanCode = "" + this.$confirm(response.message, "提示", { + type: "warning", }) .then(() => { - this.filterQuery.code = response.data.code - this.addCode() + this.filterQuery.code = response.data.code; + this.addCode(); }) .catch(() => { - this.filterQuery.code = response.data.code - }) + this.filterQuery.code = response.data.code; + }); } else if (response.code == 508) { - this.originCode = '' - this.filterQuery.code = '01' + response.data.nameCode - this.originCode = this.filterQuery.code + this.originCode = ""; + this.filterQuery.code = "01" + response.data.nameCode; + this.originCode = this.filterQuery.code; } else if (response.code == 601) { - this.result = '已选入单据' - this.placeholder = '已选入单据,请扫UDI码进行作业' + this.result = "已选入单据" + this.placeholder = "已选入单据,请扫UDI码进行作业" this.formData.billNo = response.data.billNo this.getBillNo(this.formData.billNo) - this.startDeal() + this.startDeal(); } else { - this.scanCode = '' - this.$alert(response.message, '提示', { - confirmButtonText: '确定', - type: 'warning', + this.scanCode = "" + this.$alert(response.message, "提示", { + confirmButtonText: "确定", + type: "warning", closeOnClickModal: true, callback: (action) => { - this.$refs.inputRef.focus() - this.$refs.inputRef.select() - } - }) + this.$refs.inputRef.focus(); + this.$refs.inputRef.select(); + }, + }); } } - this.loading = false - }) + this.loading = false; + }); }, addCode(code) { if (this.$isNotBlank(code)) { - this.filterQuery.code = code + this.filterQuery.code = code; } if (this.$isBlank(this.filterQuery.code)) { - this.filterQuery.code = this.scanCode.trim() + this.filterQuery.code = this.scanCode.trim(); } if (this.$isBlank(this.filterQuery.code) && this.$isBlank(this.scanCode)) { - return + return; } let tagQuery = { workPlaceCode: this.formData.workPlaceCode, @@ -983,17 +936,17 @@ export default { billNo: this.formData.billNo, code: this.filterQuery.code.trim(), insert: this.formData.insert, - busType: this.formData.busType - } + busType: this.formData.busType, + }; tagCode(tagQuery).then(res => { this.loading = false if (res.code == 20000) { - this.formData.tagStatus = 2 - this.formData.insert = false - this.formData = res.data - this.curRow = this.formData - this.$refs.inputRef.focus() - this.refreshCodesPanel(this) + this.formData.tagStatus = 2; + this.formData.insert = false; + this.formData = res.data; + this.curRow = this.formData; + this.$refs.inputRef.focus(); + this.refreshCodesPanel(this); } else { if (res.code == 502) { this.$confirm(res.message + '是否强制添加?', '提示', { @@ -1001,12 +954,12 @@ export default { cancelButtonText: '取消', type: 'warning' }).then(() => { - this.formData.insert = true - this.addCode() + this.formData.insert = true; + this.addCode(); }).catch(() => { - }) + }); } else { - this.$refs.inputRef.focus() + this.$refs.inputRef.focus(); this.$message.error(res.message) } @@ -1035,7 +988,7 @@ export default { this.loading = false }) }).catch(() => { - }) + }); }, cancelOrder() { @@ -1054,7 +1007,7 @@ export default { this.loading = false }) }).catch(() => { - }) + }); }, confirmFinishOrder() { @@ -1067,7 +1020,7 @@ export default { }).then(() => { this.finishOrder() }).catch(() => { - }) + }); } else { this.finishOrder() } @@ -1085,16 +1038,16 @@ export default { cancelButtonText: '取消', type: 'warning' }).then(() => { - this.formData.confirmFinish = true - this.finishOrder() + this.formData.confirmFinish = true; + this.finishOrder(); }).catch(() => { - }) + }); } else if (res.code == 503) { this.$alert('该单据未全部赋码无法完成,请检查后重试', '提示', { confirmButtonText: '确定', callback: action => { } - }) + }); } else { this.$message.error(res.message) } @@ -1104,7 +1057,7 @@ export default { }, updateOrder() { - this.formData.workPlaceCode = this.workplaceId + this.formData.workPlaceCode = this.workplaceId; updateOrder(this.formData).then(res => { this.loading = false }).catch(() => { @@ -1119,7 +1072,7 @@ export default { if (this.$route.query.busType != null) { this.formData.busType = this.$route.query.busType } - this.selectPrescriptionVisible = true + this.selectPrescriptionVisible = true; }, //获取下一单据 @@ -1130,9 +1083,9 @@ export default { getNextOrder(nextQuery).then(res => { this.loading = false if (res.code == 20000) { - this.formData = res.data + this.formData = res.data; - this.startDeal() + this.startDeal(); } else { this.$message.error(res.message) } @@ -1149,26 +1102,22 @@ export default { getCurOrder(nextQuery).then(res => { this.loading = false if (res.code == 20000) { - let temp = res.data + let temp = res.data; if (temp.tagStatus === -1) { this.$confirm('检测到当前工位存在挂起单据,是否继续上一次单据处理?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { - this.formData = temp - this.startDeal() + this.formData = temp; + this.startDeal(); }).catch(() => { - }) + }); } else if (temp.tagStatus === 2 || temp.tagStatus === 1) { - this.formData = temp - if (this.formData.ledNum == null){ - this.formData.ledNum = 5 - } - // this.ledNum = temp.ledNum + this.formData = temp; this.panelALive = true - this.startDeal() + this.startDeal(); // this.$confirm('检测到当前工位存在正在处理单据,是否继续上一次单据处理?', '提示', { // confirmButtonText: '确定', // cancelButtonText: '取消', @@ -1179,9 +1128,10 @@ export default { // }); } + } else { // this.$message.error(res.message) - this.$refs.inputRef.focus() + this.$refs.inputRef.focus(); } }).catch(() => { this.loading = false @@ -1189,31 +1139,31 @@ export default { }, closeDialog() { - this.selectPrescriptionVisible = false + this.selectPrescriptionVisible = false; }, confirmSelect(row) { - this.formData = row - this.formData.workPlaceCode = this.workplaceId - this.startDeal() + this.formData = row; + this.formData.workPlaceCode = this.workplaceId; + this.startDeal(); }, startDeal() { this.autoFinishOrderFlag = true - this.curRow = this.formData + this.curRow = this.formData; this.dealSplitOrder() //处理哪个活动的明细子组件 // this.selectTabsname(this.formData.busType); - this.formData.tagStatus = 2 - this.updateOrder() + this.formData.tagStatus = 2; + this.updateOrder(); // this.refreshCodesPanel(this); - this.$refs.inputRef.focus() + this.$refs.inputRef.focus(); }, selectTabsname(value) { if (this.$isBlank(this.filterQuery.code) && this.busTypeList.length > 0) { - let busType = this.busTypeList.find(item => item.documentTypeCode === value) - let autoTag = busType.autoTag + let busType = this.busTypeList.find(item => item.documentTypeCode === value); + let autoTag = busType.autoTag; if (autoTag == 1) { this.editableTabsValue = this.tabsName[1] } @@ -1221,49 +1171,50 @@ export default { }, //开始拆零 dealSplitOrder() { - this.formData.workPlaceCode = this.workplaceId + this.formData.workPlaceCode = this.workplaceId; startSplit(this.formData).then(res => { this.loading = false if (res.code == 20000) { - this.selectPrescriptionVisible = false - this.refreshCodesPanel(this) + this.selectPrescriptionVisible = false; + this.refreshCodesPanel(this); } else if (res.code == 501) { - this.$refs.childRef.getList() - this.$refs.childRef.getDraftList() - this.$refs.childRef.getOtherList() + this.$refs.childRef.getList(); + this.$refs.childRef.getDraftList(); + this.$refs.childRef.getOtherList(); this.$message.warning(res.message) - this.refreshCodesPanel(this) + this.refreshCodesPanel(this); } }).catch(() => { this.loading = false }) }, + printCodeResult(data, message) { - const resultParts = [] + const resultParts = []; if (data.udi) { - resultParts.push('层级标识: ' + data.udi) + resultParts.push("层级标识: " + data.udi); } if (data.batchNo) { - resultParts.push('批次号: ' + data.batchNo) + resultParts.push("批次号: " + data.batchNo); } if (data.produceDate) { - resultParts.push('生产日期: ' + data.produceDate) + resultParts.push("生产日期: " + data.produceDate); } if (data.expireDate) { - resultParts.push('失效日期: ' + data.expireDate) + resultParts.push("失效日期: " + data.expireDate); } if (data.serialNo) { - resultParts.push('序列号: ' + data.serialNo) + resultParts.push("序列号: " + data.serialNo); } - this.scanTitle = '扫码结果:' + data.code - this.result = resultParts.join(' , ') + this.scanTitle = "扫码结果:" + data.code; + this.result = resultParts.join(" , "); if (message == 'success') { - this.scanResultType = 'success' + this.scanResultType = "success"; } else { - this.scanResultType = 'warning' - this.result = this.result + '\n' + message + this.scanResultType = "warning"; + this.result = this.result + "\n" + message; } }, @@ -1274,11 +1225,12 @@ export default { type: 'warning' }).then(() => { this.formData.insert = true - this.addCode(data.code) + this.addCode(data.code); }).catch(() => { - }) + }); }, + vailOrderFinish() { // if (!this.autoFinishOrderFlag) { // return @@ -1305,44 +1257,43 @@ export default { // }) }, + async printMutiCodeResult(vailCodeResultResponses) { - this.warnResult = '' - this.errResult = '' - this.result = '' - this.warnVisible = false - this.errVisible = false + this.warnResult = ""; + this.errResult = ""; + this.result = ""; + this.warnVisible = false; + this.errVisible = false; for (let i = 0; i < vailCodeResultResponses.length; i++) { let data = vailCodeResultResponses[i] - if (data.status == 1) { - this.result = this.result + ';' + vailCodeResultResponses[i].code - } else if (data.status == 2) { - this.warnResult = this.warnResult + '\n' + vailCodeResultResponses[i].code + ':' + vailCodeResultResponses[i].errMsg + if (data.status == 1) + this.result = this.result + ";" + vailCodeResultResponses[i].code; + else if (data.status == 2) { + this.warnResult = this.warnResult + "\n" + vailCodeResultResponses[i].code + ":" + vailCodeResultResponses[i].errMsg; } else if (data.status == 3) { - this.result = this.result + '\n' + vailCodeResultResponses[i].code + this.result = this.result + "\n" + vailCodeResultResponses[i].code; // this.warnResult = this.warnResult + "\n" + vailCodeResultResponses[i].code + ":" + vailCodeResultResponses[i].errMsg; await this.popupTip(data) } // else // this.errResult = this.errResult + "\n" + vailCodeResultResponses[i].code + ":" + vailCodeResultResponses[i].errMsg; } - if (!isBlank(this.warnResult)) { - this.warnVisible = true - } - if (!isBlank(this.errResult)) { - this.errVisible = true - } + if (!isBlank(this.warnResult)) + this.warnVisible = true; + if (!isBlank(this.errResult)) + this.errVisible = true; }, handleCommand(command) { // this.$message('click on item ' + command); }, clearCode() { - this.originCode = '' - this.formData.code = '' - this.scanCode = '' - this.scanTitle = '单据录入结果:' - this.result = '' - this.warnResult = '' - this.errResult = '' + this.originCode = ""; + this.formData.code = ""; + this.scanCode = ""; + this.scanTitle = "单据录入结果:"; + this.result = ""; + this.warnResult = "" + this.errResult = "" this.warnVisible = false this.errVisible = false }, @@ -1355,27 +1306,27 @@ export default { tagStatus: -1, workPlaceCode: this.formData.workPlaceCode, busType: this.formData.busType - } + }; this.curRow = null - this.formData.confirmFinish = false + this.formData.confirmFinish = false; this.refreshCodesPanel(this) this.clearCode() - this.$refs.inputRef.focus() - this.$refs.inputRef.select() + this.$refs.inputRef.focus(); + this.$refs.inputRef.select(); }, reset() { this.formData = { tagStatus: -1, workPlaceCode: this.formData.workPlaceCode, busType: this.formData.busType - } + }; this.curRow = null - this.formData.confirmFinish = false + this.formData.confirmFinish = false; this.refreshCodesPanelBank(this) this.selectSysParam() this.clearCode() - this.$refs.inputRef.focus() - this.$refs.inputRef.select() + this.$refs.inputRef.focus(); + this.$refs.inputRef.select(); }, toggleBusType() { //隐藏下拉框内容 @@ -1383,9 +1334,10 @@ export default { this.selectBusTypeDisabled = true }, + getInvList() { let query = { - advanceType: 1 + advanceType: 1, } getInvListByUser(query) .then((response) => { @@ -1395,27 +1347,28 @@ export default { }) }, changeCorp() { - let corp = this.fromInvOptions.find(item => item.code === this.formData.fromCorp) + let corp = this.fromInvOptions.find(item => item.code === this.formData.fromCorp); this.formData.fromCorpName = corp.name }, //处理事件 handleRecCodesEvent(event) { - console.log('接收 recCodes event:', event.detail.recCodes) + console.log('接收 recCodes event:', event.detail.recCodes); let params = { - codeList: event.detail.recCodes - } + codeList: event.detail.recCodes, + }; if (this.formData.billNo == null) { - this.$message.error('请先选入单据!') + this.$message.error("请先选入单据!"); return } const verify = this.verifyScanCount(event.detail.recCodes) - if (verify) { + if (verify){ this.batchVailCode(params) } }, + batchVailCode(params) { if (this.scanStatus == 1) { //剔除 @@ -1430,15 +1383,15 @@ export default { } else { batchVailCode(params).then((res) => { if (res.code === 20000) { - this.valiCodes = [] - let list = res.data + this.valiCodes = []; + let list = res.data; list.forEach(item => { if (item.status === 1) { - this.valiCodes.push(item.code) + this.valiCodes.push(item.code); } - }) - this.$refs.inputRef.focus() - this.$refs.inputRef.select() + }); + this.$refs.inputRef.focus(); + this.$refs.inputRef.select(); this.printMutiCodeResult(list) if (this.valiCodes != null && this.valiCodes.length > 0) { //批量添加 @@ -1450,27 +1403,27 @@ export default { insert: this.formData.insert, busType: this.formData.busType, fromCorpName: this.formData.fromCorpName, - invCode: this.formData.invCode + invCode: this.formData.invCode, } orderbatchAddCode(params2).then((res) => { if (res.code === 20000) { - this.formData.tagStatus = 2 - this.formData.insert = false - this.curRow = this.formData - this.$refs.inputRef.focus() - this.refreshCodesPanel(this) + this.formData.tagStatus = 2; + this.formData.insert = false; + this.curRow = this.formData; + this.$refs.inputRef.focus(); + this.refreshCodesPanel(this); this.printMutiCodeResult(res.data.vailCodeResultResponses) } else { this.$message.error(res.message) } - }) + }); // this.scanCode = this.valiCodes.join(";"); } } else { this.$message.error(res.message) } - }) + }); } }, @@ -1495,34 +1448,34 @@ export default { }, //扫码校验 addGs() { - const input = this.$refs.inputRef.$refs.input - const textToInsert = '\u001D' - const start = input.selectionStart - const end = input.selectionEnd - this.scanCode = this.scanCode.slice(0, start) + textToInsert + this.scanCode.slice(end) + const input = this.$refs.inputRef.$refs.input; + const textToInsert = "\u001D"; + const start = input.selectionStart; + const end = input.selectionEnd; + this.scanCode = this.scanCode.slice(0, start) + textToInsert + this.scanCode.slice(end); this.$nextTick(() => { - this.focus = true - input.selectionStart = input.selectionEnd = start + textToInsert.length - this.$refs.inputRef.focus() - }) + this.focus = true; + input.selectionStart = input.selectionEnd = start + textToInsert.length; + this.$refs.inputRef.focus(); + }); }, handleScanComplete(fullScanData) { - console.log('Scan complete:', fullScanData.join(';')) + console.log("Scan complete:", fullScanData.join(";")); if (this.formData.billNo == null && this.formDataVisible.scanType != 1) { this.enterBillNoKey(fullScanData[0]) - return + return; } let params = { - codeList: fullScanData - } + codeList: fullScanData, + }; if (this.formData.billNo == null) { - this.$message.error('请先选入单据!') + this.$message.error("请先选入单据!"); return } const verify = this.verifyScanCount(fullScanData) - if (verify) { + if (verify){ this.batchVailCode(params) } @@ -1531,103 +1484,103 @@ export default { parseString(str) { // 1. 判断是否以 "MA" 开头 - if (str.startsWith('MA')) { - return true + if (str.startsWith("MA")) { + return true; } // 2. 判断是否以 "01" 开头且长度大于等于 18 - if (str.startsWith('01') && str.length >= 16) { - return true + if (str.startsWith("01") && str.length >= 16) { + return true; } // 3. 判断是否以 "#" 开头且 "#" 的个数大于等于 4 - if (str.startsWith('#') && (str.match(/#/g) || []).length >= 4) { - return true + if (str.startsWith("#") && (str.match(/#/g) || []).length >= 4) { + return true; } // 4. 判断是否以 "8" 开头且长度为 20 位 - if (str.startsWith('8') && str.length === 20) { - return true + if (str.startsWith("8") && str.length === 20) { + return true; } // 5. 判断是否以 "11", "17", "21", 或 "10" 开头 - const prefixes = ['11', '17', '21', '10'] + const prefixes = ["11", "17", "21", "10"]; if (prefixes.some(prefix => str.startsWith(prefix))) { - return true + return true; } // 如果没有任何条件满足,返回 false - return false + return false; }, socketListener() { - let lastScanTime = Date.now() - let scanBuffer = [] - let scanTimeout = null - const SCAN_TIMEOUT = 1000 // 1秒间隔,表示扫码结束的判定标准 - const self = this - console.log('启用监听') - this.ws.onmessage = function(event) { - let scanData = event.data // 获取扫码数据 - let currentTime = Date.now() + let lastScanTime = Date.now(); + let scanBuffer = []; + let scanTimeout = null; + const SCAN_TIMEOUT = 1000; // 1秒间隔,表示扫码结束的判定标准 + const self = this; + console.log("启用监听") + this.ws.onmessage = function (event) { + let scanData = event.data; // 获取扫码数据 + let currentTime = Date.now(); console.log(scanData) // 如果时间间隔超过预设的阈值,表示这是一次新的扫码 if (currentTime - lastScanTime > SCAN_TIMEOUT) { // 处理上一次完整的扫码数据 if (scanBuffer.length > 0) { - self.handleScanComplete(scanBuffer) + self.handleScanComplete(scanBuffer); } // 清空缓冲区,开始新的扫码 - scanBuffer = [] + scanBuffer = []; } // 重置上一次扫码的时间 - lastScanTime = currentTime + lastScanTime = currentTime; // 将数据添加到缓冲区 - scanBuffer.push(scanData) + scanBuffer.push(scanData); // 如果已经有一个定时器在等待,可以清除它 if (scanTimeout) { - clearTimeout(scanTimeout) + clearTimeout(scanTimeout); } // 设置新的定时器,等待指定的时间后执行扫码结束处理 scanTimeout = setTimeout(() => { // 定时器到时,处理扫码结束 - self.handleScanComplete(scanBuffer) - scanBuffer = [] - }, SCAN_TIMEOUT) - } + self.handleScanComplete(scanBuffer); + scanBuffer = []; + }, SCAN_TIMEOUT); + }; }, handleVisibilityChange() { if (document.visibilityState === 'visible') { - console.log('用户切回到了处理页面') + console.log('用户切回到了处理页面'); if (this.ws == null || this.ws.readyState === WebSocket.CLOSED) { - this.ws = new WebSocket('ws://127.0.0.1:9988') - const self = this - this.ws.onopen = function(evt) { - console.log('处理单据WebSocket 连接中 ...') + this.ws = new WebSocket("ws://127.0.0.1:9988"); + const self = this; + this.ws.onopen = function (evt) { + console.log("处理单据WebSocket 连接中 ..."); self.socketListener() - } + }; } } else { if (this.ws && this.ws.readyState === WebSocket.OPEN) { - this.ws.close() - console.log('关闭处理单据websocket成功') + this.ws.close(); + console.log("关闭处理单据websocket成功") } } }, - verifyScanCount(codeArray) { + verifyScanCount(codeArray){ //判断扫码数量是否超出或少于设置扫码数量 if (this.collectSet.scanMaxCount != null && this.collectSet.scanMaxCount != 0) { if (this.collectSet.scanMaxCount > codeArray.length) { this.scanCode = '' - this.$message.error('扫码数量少于设置扫码数量') - return false + this.$message.error("扫码数量少于设置扫码数量"); + return false; } else if (this.collectSet.scanMaxCount < codeArray.length) { this.scanCode = '' - this.$message.error('扫码数量超出') - return false + this.$message.error("扫码数量超出"); + return false; } } - return true + return true; }, selectSysParam() { getSet().then((response) => { @@ -1639,68 +1592,31 @@ export default { //扫码剔除操作 deleteCode() { - this.scanTip = '扫码剔除:' + this.scanTip = "扫码剔除:" this.labelName = 2 - this.placeholder = '请点击输入框进行扫码剔除' + this.placeholder = "请点击输入框进行扫码剔除" this.scanStatus = 1 this.scanCode = '' if (!isBlank(this.warnResult)) { - this.warnResult = '' + this.warnResult = "" } }, overdeleteCode() { this.labelName = 1 this.scanStatus = null - this.scanTip = '单据录入:' + this.scanTip = "单据录入:" this.placeholder = '请点击输入框进行选扫码' }, - - // colorStyle(ledNum) { - // switch (ledNum) { - // case 1: - // return { type: 'danger' }; - // case 2: - // return { type: 'warning' }; - // case 3: - // return { type: '' }; - // case 4: - // return { type: 'success' }; - // default: - // - // return { type: 'info' }; - // // return { type: '#918e8e' }; - // } - // }, - colorStyle(ledNum) { - switch (ledNum) { - case 1: - this.ledName = '红灯' - return 'danger' ; - case 2: - this.ledName = '黄灯' - return 'warning' ; - case 3: - this.ledName = '蓝灯' - return ''; - case 4: - this.ledName = '绿灯' - return 'success' ; - default: - this.ledName = '未绑定灯组' - return 'info' ; - // return { type: '#918e8e' }; - } - } }, mounted() { - this.$refs.inputRef.focus() + this.$refs.inputRef.focus(); //环境判断 - if (window.navigator.userAgent.indexOf('GLXP_PC') != -1) { - this.scanDisabled = true - window.removeEventListener('djcl', this.handleRecCodesEvent) - window.addEventListener('djcl', this.handleRecCodesEvent) + if (window.navigator.userAgent.indexOf("GLXP_PC") != -1) { + this.scanDisabled = true; + window.removeEventListener('djcl', this.handleRecCodesEvent); + window.addEventListener('djcl', this.handleRecCodesEvent); } - document.addEventListener('visibilitychange', this.handleVisibilityChange) + document.addEventListener('visibilitychange', this.handleVisibilityChange); // window.addEventListener('storage', (event) => { // if (document.visibilityState == 'hidden') { // console.log("关闭处理单据websocket") @@ -1721,26 +1637,27 @@ export default { }, + beforeDestroy() { - window.removeEventListener('djcl', this.handleRecCodesEvent) - document.removeEventListener('visibilitychange', this.handleVisibilityChange) + window.removeEventListener('djcl', this.handleRecCodesEvent); + document.removeEventListener('visibilitychange', this.handleVisibilityChange); - this.ws.close() - this.ws.onclose = function(evt) { - console.log('处理单据 Connection closed.') - } + this.ws.close(); + this.ws.onclose = function (evt) { + console.log("处理单据 Connection closed."); + }; }, created() { - getHead('prescribeTagCodeDeal', '1').then((re) => { + getHead("prescribeTagCodeDeal", "1").then((re) => { // 处理返回的数据 - this.tableObj = re.data - this.tableHeader = re.data.tableList - this.queryList = re.data.queryList - this.fromList = re.data.fromList - }) - this.findCurWorkPlaces() - this.selectSysParam() - this.formData.invCode = this.$store.getters.locInvCode + this.tableObj = re.data; + this.tableHeader = re.data.tableList; + this.queryList = re.data.queryList; + this.fromList = re.data.fromList; + }); + this.findCurWorkPlaces(); + this.selectSysParam(); + this.formData.invCode = this.$store.getters.locInvCode; if (this.$route.query.billNo != null) { this.formData.billNo = this.$route.query.billNo } @@ -1750,9 +1667,9 @@ export default { // this.selectBusTypeDisabled = true } this.corpOrderIdDisabled = true - this.workplaceId = Number(this.$route.query.workplaceId) - this.formData.workPlaceCode = Number(this.$route.query.workplaceId) - this.getWorkBindBusTypes(this.formData.workPlaceCode) + this.workplaceId = Number(this.$route.query.workplaceId); + this.formData.workPlaceCode = Number(this.$route.query.workplaceId); + this.getWorkBindBusTypes(this.formData.workPlaceCode); } } @@ -1760,26 +1677,54 @@ export default { </script> <style scoped> +.main-container { + display: flex; + width: 100%; + height: 100%; +} + +.left-panel { + width: 40%; +} + +.right-panel { + width: 60%; +} + +.left-card :deep(.el-card__body) { + height: 100%; + padding: 20px; + overflow-y: auto; +} + +.right-tabs { + height: 100%; +} + +.right-tabs :deep(.el-tabs__content) { + height: calc(100% - 40px); + overflow-y: auto; +} + +/* 其他样式保持不变 */ .el-col { - margin-top: -5px; - margin-bottom: -5px; + margin: 0; } -.el-dropdown { - vertical-align: top; +.el-alert { + margin-bottom: 16px; } -.el-dropdown + .el-dropdown { - margin-left: 15px; +.el-alert:last-child { + margin-bottom: 0; } -.el-icon-arrow-down { - font-size: 12px; +.el-tabs--border-card { + box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); } -.custom-tag { - background-color: #ff0000; /* 自定义背景颜色 */ - color: #ffffff; /* 自定义文字颜色 */ - border: none; /* 移除边框 */ +.query-form-item :deep(.el-form-item__content) { + display: flex; + align-items: center; } </style> diff --git a/src/views/collect/IoSplitFiFoProgress.vue b/src/views/collect/IoSplitFiFoProgress.vue new file mode 100644 index 00000000..793c040c --- /dev/null +++ b/src/views/collect/IoSplitFiFoProgress.vue @@ -0,0 +1,349 @@ +<template> + <div class="dashboard-container"> + <!-- 搜索区域 --> + <div class="search-section"> + <div class="search-wrapper"> + <el-input + placeholder="请输入产品名称搜索" + prefix-icon="el-icon-search" + v-model="searchQuery" + @keyup.enter.native="handleSearch" + clearable + > + <el-button slot="append" icon="el-icon-search" @click="handleSearch"></el-button> + </el-input> + </div> + </div> + + <!-- 展示区域 --> + <div class="display-section"> + <div class="card-container"> + <el-row :gutter="20"> + <el-col :span="8" v-for="(item, index) in displayData" :key="index"> + <el-card class="product-card" :body-style="{ padding: '0px' }"> + <div class="card-header"> + <h3 class="product-name" :title="item.productName">{{ item.productName }}</h3> + <div class="product-info"> + <span class="batch-no">{{ item.batchNo }}</span> + <span class="expire-date">{{ item.expireDate }}</span> + </div> + </div> + <div class="card-body"> + <div class="progress-item"> + <div class="progress-label"> + <span>工位存量</span> + <span class="progress-value">{{ item.workplaceStock }}/{{ item.workplaceTotal }}</span> + </div> + <el-progress + :text-inside="true" + :percentage="calculatePercentage(item.workplaceStock, item.workplaceTotal)" + :color="getProgressColor(item.workplaceStock, item.workplaceTotal)" + :stroke-width="12" + ></el-progress> + </div> + <div class="progress-item"> + <div class="progress-label"> + <span>拆零存量</span> + <span class="progress-value">{{ item.splitStock }}/{{ item.splitTotal }}</span> + </div> + <el-progress + :text-inside="true" + :percentage="calculatePercentage(item.splitStock, item.splitTotal)" + :color="getProgressColor(item.splitStock, item.splitTotal)" + :stroke-width="12" + ></el-progress> + </div> + </div> + </el-card> + </el-col> + </el-row> + </div> + + <!-- 分页 --> + <div class="pagination-container"> + <el-pagination + background + @size-change="handleSizeChange" + @current-change="handleCurrentChange" + :current-page="currentPage" + :page-sizes="[10, 20, 30, 50]" + :page-size="pageSize" + layout="total, sizes, prev, pager, next, jumper" + :total="total" + > + </el-pagination> + </div> + </div> + </div> +</template> + +<script> +import { splitFifoPage } from "@/api/inout/splitInv"; + +export default { + name: "ProductStockDashboard", + data() { + return { + searchQuery: "", + currentPage: 1, + pageSize: 10, + total: 0, + displayData: [], + loading: false, + colorRanges: [ + { min: 0, max: 20, color: '#F56C6C' }, // 红色 - 危险 + { min: 20, max: 50, color: '#E6A23C' }, // 橙色 - 警告 + { min: 50, max: 80, color: '#409EFF' }, // 蓝色 - 正常 + { min: 80, max: 101, color: '#67C23A' } // 绿色 - 良好 + ] + }; + }, + methods: { + handleSearch() { + this.currentPage = 1; + this.fetchData(); + }, + handleSizeChange(val) { + this.pageSize = val; + this.fetchData(); + }, + handleCurrentChange(val) { + this.currentPage = val; + this.fetchData(); + }, + fetchData() { + this.loading = true; + + // 构建查询参数 + const params = { + page: this.currentPage, + limit: this.pageSize, + key: this.searchQuery || undefined + }; + + // 调用API获取数据 + splitFifoPage(params) + .then(response => { + if (response.code === 20000) { + // 处理返回的数据 + this.total = response.data.total || 0; + + // 转换数据格式以适应展示需求 + this.displayData = (response.data.list || []).map(item => { + return { + productName: item.cpmctymc || '未知产品', + batchNo: item.batchNo || '无批次', + expireDate: item.expireDate || '无效期', + workplaceStock: item.workplaceQty || 0, + workplaceTotal: item.workplaceTotal || 100, + splitStock: item.splitQty || 0, + splitTotal: item.splitTotal || 100 + }; + }); + } else { + this.$message.error(response.message || '获取数据失败'); + this.displayData = []; + this.total = 0; + } + this.loading = false; + }) + .catch(error => { + console.error('获取数据失败:', error); + this.$message.error('获取数据失败,请稍后重试'); + this.displayData = []; + this.total = 0; + this.loading = false; + }); + }, + calculatePercentage(current, total) { + if (!total || total === 0) return 0; + const percentage = (current / total) * 100; + return Math.min(100, Math.max(0, percentage)); + }, + getProgressColor(current, total) { + if (!total || total === 0) return this.colorRanges[0].color; + + const percentage = this.calculatePercentage(current, total); + + // 根据百分比返回对应的颜色 + for (const range of this.colorRanges) { + if (percentage >= range.min && percentage < range.max) { + return range.color; + } + } + + return this.colorRanges[0].color; + } + }, + mounted() { + this.fetchData(); + + // 如果需要自动刷新数据,可以添加定时器 + this.refreshTimer = setInterval(() => { + this.fetchData(); + }, 60000); // 每分钟刷新一次 + }, + beforeDestroy() { + // 清除定时器 + if (this.refreshTimer) { + clearInterval(this.refreshTimer); + } + } +}; +</script> + +<style scoped> +.dashboard-container { + height: 100vh; /* 使用视口高度单位,确保铺满整个屏幕 */ + width: 100%; + background-color: #f5f7fa; + padding: 20px; + display: flex; + flex-direction: column; + box-sizing: border-box; /* 确保padding不会增加总高度 */ + overflow: hidden; /* 防止内容溢出 */ +} + +.search-section { + margin-top: 20px; + margin-bottom: 10px; +} + +.search-wrapper { + max-width: 600px; + + margin: 0 0; /* 修改为左对齐 */ +} + +.display-section { + flex: 1; + display: flex; + flex-direction: column; + overflow: hidden; /* 防止内容溢出 */ +} + +.card-container { + flex: 1; + overflow-y: auto; + padding-bottom: 20px; /* 为分页腾出空间 */ +} + +.product-card { + height: 220px; /* 增加卡片高度 */ + margin-bottom: 20px; + border-radius: 8px; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); + transition: all 0.3s ease; + overflow: hidden; + display: flex; + flex-direction: column; +} + +.product-card:hover { + transform: translateY(-5px); + box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15); +} + +.card-header { + background-color: #409EFF; + color: white; + padding: 15px; +} + +.product-name { + margin: 0; + font-size: 18px; + font-weight: 600; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.product-info { + display: flex; + justify-content: space-between; + margin-top: 5px; + font-size: 12px; + opacity: 0.9; +} + +.card-body { + padding: 20px; /* 增加内边距 */ + flex: 1; + display: flex; + flex-direction: column; + justify-content: space-around; /* 均匀分布进度条 */ +} + +.progress-item { + margin-bottom: 20px; /* 增加进度条之间的间距 */ +} + +.progress-item:last-child { + margin-bottom: 0; +} + +.progress-label { + display: flex; + justify-content: space-between; + margin-bottom: 8px; /* 增加标签和进度条之间的间距 */ + font-size: 14px; + color: #606266; +} + +.progress-value { + font-weight: 600; +} + +.pagination-container { + margin-top: 20px; + text-align: center; + padding: 10px 0; +} + +/* 响应式调整 */ +@media screen and (max-width: 1200px) { + .el-col { + width: 100% !important; + } + + .product-card { + height: 200px; /* 在小屏幕上稍微减小高度 */ + } +} + +/* 自定义进度条样式 */ +:deep(.el-progress-bar__outer) { + border-radius: 6px; + background-color: #ebeef5; + height: 12px !important; /* 确保进度条高度 */ +} + +:deep(.el-progress-bar__inner) { + border-radius: 6px; + transition: width 0.6s ease, background-color 0.6s ease; +} + +/* 大屏模式下的额外样式 */ +@media screen and (min-width: 1920px) { + .dashboard-container { + padding: 30px; + } + + .product-card { + height: 240px; /* 在大屏幕上增加高度 */ + } + + .product-name { + font-size: 22px; + } + + .progress-label { + font-size: 16px; + } + + .progress-item { + margin-bottom: 25px; + } +} +</style> diff --git a/项目结构 b/项目结构 new file mode 100644 index 00000000..f5fc9c24 --- /dev/null +++ b/项目结构 @@ -0,0 +1,33 @@ +├── build // 构建相关 +├── bin // 执行脚本 +├── build // 编译文件 +├── public // 公共文件 +│ ├── tinymce // 富文本组件 +│ ├── favicon.ico // favicon图标 +│ └── index.html // html模板 +│ └── robots.txt // 反爬虫 +├── src // 源代码 +│ ├── api // 所有请求 +│ ├── assets // 主题 字体等静态资源 +│ ├── components // 全局公用组件 +│ ├── directive // 全局指令 +│ ├── layout // 布局 +│ ├── plugins // 通用方法 +│ ├── router // 路由 +│ ├── store // 全局 store管理 +│ ├── utils // 全局公用方法 +│ ├── views // 所有界面组件 +│ ├── App.vue // 入口页面 +│ ├── main.js // 入口 加载组件 初始化等 +│ ├── permission.js // 权限管理 +│ └── settings.js // 系统配置 +├── .editorconfig // 编码格式 +├── .env.development // 开发环境配置 +├── .env.production // 生产环境配置 +├── .env.staging // 测试环境配置 +├── .eslintignore // 忽略语法检查 +├── .eslintrc.js // eslint 配置项 +├── .gitignore // git 忽略项 +├── babel.config.js // babel.config.js +├── package.json // package.json +└── vue.config.js // vue.config.js