Merge remote-tracking branch 'origin/dev' into dev
| | |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // 查看不合格复测数据 |
| | | export function getRetestResult(query) { |
| | | return request({ |
| | | url: "/insOrder/getRetestResult", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // 认领检验任务 |
| | | export function claimInsOrderPlan(data) { |
| | | return request({ |
| | | url: "/insOrderPlan/claimInsOrderPlan", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // 任务交接2 |
| | | export function upPlanUser2(data) { |
| | | return request({ |
| | | url: "/insOrderPlan/upPlanUser2", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // 任务交接 |
| | | export function upPlanUser(data) { |
| | | return request({ |
| | | url: "/insOrderPlan/upPlanUser", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // 获取用户列表 |
| | | export function selectUserCondition(query) { |
| | | return request({ |
| | | url: "/system/newUser/selectUserCondition", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // 检验任务-特殊检验项绑定查询 |
| | | export function getBindingProductByProductId(query) { |
| | | return request({ |
| | | url: "/insOrderPlan/getBindingProductByProductId", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // 检验任务-根据检验项id查询检验项树信息 |
| | | export function getProductTreeByProductId(query) { |
| | | return request({ |
| | | url: "/insOrderPlan/getProductTreeByProductId", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // 检验任务-特殊检验项绑定 |
| | | export function bindingProductTreeByProductId(data) { |
| | | return request({ |
| | | url: "/insOrderPlan/bindingProductTreeByProductId", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | // 检验任务-删除特殊检验项绑定信息 |
| | | export function delProductTreeByProductId(query) { |
| | | return request({ |
| | | url: "/insOrderPlan/delProductTreeByProductId", |
| | | method: "delete", |
| | | params: query, |
| | | }); |
| | | } |
| | | |
| | | // 查询检验任务 |
| | | export function selectInsOrderPlanList(query) { |
| | | return request({ |
| | | url: "/insOrderPlan/selectInsOrderPlanList", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | |
| | | </el-upload> |
| | | </template> |
| | | </div> |
| | | <!-- 可点击的文字 --> |
| | | <div |
| | | v-else-if="item.dataType == 'link'" |
| | | class="cell link" |
| | | style="width: 100%" |
| | | @click="goLink(scope.row, item.linkMethod)" |
| | | > |
| | | <span v-if="!item.formatData">{{ scope.row[item.prop] }}</span> |
| | | </div> |
| | | <!-- 默认纯展示数据 --> |
| | | <div v-else class="cell" style="width: 100%"> |
| | | <span v-if="!item.formatData">{{ scope.row[item.prop] }}</span> |
| | |
| | | }, |
| | | border: { |
| | | type: Boolean, |
| | | default: false, |
| | | default: true, |
| | | }, |
| | | highlightCurrentRow: { |
| | | type: Boolean, |
| | |
| | | // return index * 2; |
| | | return (this.page.current - 1) * this.page.size + index + 1; |
| | | }, |
| | | // 点击单元格link事件 |
| | | goLink(row, linkMethod) { |
| | | if (!linkMethod) { |
| | | return this.$message.warning("请配置lingk事件"); |
| | | } |
| | | this.$parent[linkMethod](row); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | >>> .cell { |
| | | padding: 0 !important; |
| | | } |
| | | .link { |
| | | color: rgb(64, 158, 255); |
| | | cursor: pointer; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div class="navbar"> |
| | | <!-- <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>--> |
| | | <!-- <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>--> |
| | | <!-- <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>--> |
| | | <!-- <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>--> |
| | | <div class="logo"> |
| | | <img src="@/assets/logo/ZTTlogo.png" /> |
| | | </div> |
| | |
| | | </div> |
| | | <div class="right-menu"> |
| | | <div class="avatar-wrapper"> |
| | | <img :src="avatar" class="user-avatar"> |
| | | <span class="userName">Admin</span> |
| | | <img class="logoout" src="@/assets/images/logoout.png" @click="logout" title="退出账号" /> |
| | | <img :src="avatar" class="user-avatar" /> |
| | | <span class="userName">{{ nickName }}</span> |
| | | <img |
| | | class="logoout" |
| | | src="@/assets/images/logoout.png" |
| | | @click="logout" |
| | | title="退出账号" |
| | | /> |
| | | </div> |
| | | <!-- <template v-if="device!=='mobile'">--> |
| | | <!-- <search id="header-search" class="right-menu-item" />--> |
| | | <!-- <template v-if="device!=='mobile'">--> |
| | | <!-- <search id="header-search" class="right-menu-item" />--> |
| | | |
| | | <!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">--> |
| | | <!-- <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />--> |
| | | <!-- </el-tooltip>--> |
| | | <!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">--> |
| | | <!-- <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />--> |
| | | <!-- </el-tooltip>--> |
| | | |
| | | <!-- <el-tooltip content="文档地址" effect="dark" placement="bottom">--> |
| | | <!-- <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />--> |
| | | <!-- </el-tooltip>--> |
| | | <!-- <el-tooltip content="文档地址" effect="dark" placement="bottom">--> |
| | | <!-- <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />--> |
| | | <!-- </el-tooltip>--> |
| | | |
| | | <!-- <screenfull id="screenfull" class="right-menu-item hover-effect" />--> |
| | | <!-- <screenfull id="screenfull" class="right-menu-item hover-effect" />--> |
| | | |
| | | <!-- <el-tooltip content="布局大小" effect="dark" placement="bottom">--> |
| | | <!-- <size-select id="size-select" class="right-menu-item hover-effect" />--> |
| | | <!-- </el-tooltip>--> |
| | | <!-- <el-tooltip content="布局大小" effect="dark" placement="bottom">--> |
| | | <!-- <size-select id="size-select" class="right-menu-item hover-effect" />--> |
| | | <!-- </el-tooltip>--> |
| | | |
| | | <!-- </template>--> |
| | | <!-- </template>--> |
| | | |
| | | <!-- <div class="avatar-container">--> |
| | | <!-- <el-dropdown-menu slot="dropdown">--> |
| | | <!-- <router-link to="/user/profile">--> |
| | | <!-- <el-dropdown-item>个人中心</el-dropdown-item>--> |
| | | <!-- </router-link>--> |
| | | <!-- <el-dropdown-item @click.native="setting = true">--> |
| | | <!-- <span>布局设置</span>--> |
| | | <!-- </el-dropdown-item>--> |
| | | <!-- <el-dropdown-item divided @click.native="logout">--> |
| | | <!-- <span>退出登录</span>--> |
| | | <!-- </el-dropdown-item>--> |
| | | <!-- </el-dropdown-menu>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="avatar-container">--> |
| | | <!-- <el-dropdown-menu slot="dropdown">--> |
| | | <!-- <router-link to="/user/profile">--> |
| | | <!-- <el-dropdown-item>个人中心</el-dropdown-item>--> |
| | | <!-- </router-link>--> |
| | | <!-- <el-dropdown-item @click.native="setting = true">--> |
| | | <!-- <span>布局设置</span>--> |
| | | <!-- </el-dropdown-item>--> |
| | | <!-- <el-dropdown-item divided @click.native="logout">--> |
| | | <!-- <span>退出登录</span>--> |
| | | <!-- </el-dropdown-item>--> |
| | | <!-- </el-dropdown-menu>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapGetters } from 'vuex' |
| | | import Breadcrumb from '@/components/Breadcrumb' |
| | | import TopNav from '@/components/TopNav' |
| | | import Hamburger from '@/components/Hamburger' |
| | | import Screenfull from '@/components/Screenfull' |
| | | import SizeSelect from '@/components/SizeSelect' |
| | | import Search from '@/components/HeaderSearch' |
| | | import RuoYiGit from '@/components/RuoYi/Git' |
| | | import RuoYiDoc from '@/components/RuoYi/Doc' |
| | | import { mapGetters } from "vuex"; |
| | | import Breadcrumb from "@/components/Breadcrumb"; |
| | | import TopNav from "@/components/TopNav"; |
| | | import Hamburger from "@/components/Hamburger"; |
| | | import Screenfull from "@/components/Screenfull"; |
| | | import SizeSelect from "@/components/SizeSelect"; |
| | | import Search from "@/components/HeaderSearch"; |
| | | import RuoYiGit from "@/components/RuoYi/Git"; |
| | | import RuoYiDoc from "@/components/RuoYi/Doc"; |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | SizeSelect, |
| | | Search, |
| | | RuoYiGit, |
| | | RuoYiDoc |
| | | RuoYiDoc, |
| | | }, |
| | | computed: { |
| | | ...mapGetters([ |
| | | 'avatar', |
| | | 'device' |
| | | ]), |
| | | ...mapGetters(["avatar", "device", "nickName"]), |
| | | setting: { |
| | | get() { |
| | | return this.$store.state.settings.showSettings |
| | | return this.$store.state.settings.showSettings; |
| | | }, |
| | | set(val) { |
| | | this.$store.dispatch('settings/changeSetting', { |
| | | key: 'showSettings', |
| | | value: val |
| | | }) |
| | | } |
| | | this.$store.dispatch("settings/changeSetting", { |
| | | key: "showSettings", |
| | | value: val, |
| | | }); |
| | | }, |
| | | }, |
| | | topNav: { |
| | | get() { |
| | | return this.$store.state.settings.topNav |
| | | } |
| | | } |
| | | return this.$store.state.settings.topNav; |
| | | }, |
| | | }, |
| | | }, |
| | | methods: { |
| | | async logout() { |
| | | this.$confirm('确定注销并退出系统吗?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.$store.dispatch('LogOut').then(() => { |
| | | location.href = '/index'; |
| | | this.$confirm("确定注销并退出系统吗?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | this.$store.dispatch("LogOut").then(() => { |
| | | location.href = "/index"; |
| | | }); |
| | | }) |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | } |
| | | .catch(() => {}); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | overflow: hidden; |
| | | //position: relative; |
| | | background: #fff; |
| | | box-shadow: 0 1px 4px rgba(0,21,41,.08); |
| | | box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08); |
| | | position: fixed; /* 将头部固定 */ |
| | | top: 0; /* 在顶部固定 */ |
| | | width: 100%; /* 宽度100%,覆盖整个视口 */ |
| | |
| | | |
| | | &.hover-effect { |
| | | cursor: pointer; |
| | | transition: background .3s; |
| | | transition: background 0.3s; |
| | | |
| | | &:hover { |
| | | background: rgba(0, 0, 0, .025) |
| | | background: rgba(0, 0, 0, 0.025); |
| | | } |
| | | } |
| | | } |
| | |
| | | selectDictLabels, |
| | | handleTree, |
| | | } from "@/utils/ruoyi"; |
| | | import { dictToValue } from "@/utils/index"; |
| | | // 分页组件 |
| | | import Pagination from "@/components/Pagination"; |
| | | // 自定义表格工具组件 |
| | |
| | | Vue.prototype.selectDictLabels = selectDictLabels; |
| | | Vue.prototype.download = download; |
| | | Vue.prototype.handleTree = handleTree; |
| | | Vue.prototype.dictToValue = dictToValue; |
| | | Vue.prototype.HaveJson = (val) => { |
| | | return JSON.parse(JSON.stringify(val)); |
| | | }; |
| | |
| | | const getters = { |
| | | sidebar: state => state.app.sidebar, |
| | | size: state => state.app.size, |
| | | device: state => state.app.device, |
| | | dict: state => state.dict.dict, |
| | | visitedViews: state => state.tagsView.visitedViews, |
| | | cachedViews: state => state.tagsView.cachedViews, |
| | | token: state => state.user.token, |
| | | avatar: state => state.user.avatar, |
| | | name: state => state.user.name, |
| | | introduction: state => state.user.introduction, |
| | | roles: state => state.user.roles, |
| | | permissions: state => state.user.permissions, |
| | | permission_routes: state => state.permission.routes, |
| | | topbarRouters:state => state.permission.topbarRouters, |
| | | defaultRoutes:state => state.permission.defaultRoutes, |
| | | sidebarRouters:state => state.permission.sidebarRouters, |
| | | } |
| | | export default getters |
| | | sidebar: (state) => state.app.sidebar, |
| | | size: (state) => state.app.size, |
| | | device: (state) => state.app.device, |
| | | dict: (state) => state.dict.dict, |
| | | visitedViews: (state) => state.tagsView.visitedViews, |
| | | cachedViews: (state) => state.tagsView.cachedViews, |
| | | token: (state) => state.user.token, |
| | | avatar: (state) => state.user.avatar, |
| | | name: (state) => state.user.name, |
| | | nickName: (state) => state.user.nickName, |
| | | userId: (state) => state.user.id, |
| | | introduction: (state) => state.user.introduction, |
| | | roles: (state) => state.user.roles, |
| | | permissions: (state) => state.user.permissions, |
| | | permission_routes: (state) => state.permission.routes, |
| | | topbarRouters: (state) => state.permission.topbarRouters, |
| | | defaultRoutes: (state) => state.permission.defaultRoutes, |
| | | sidebarRouters: (state) => state.permission.sidebarRouters, |
| | | }; |
| | | export default getters; |
| | |
| | | import { login, logout, getInfo } from '@/api/login' |
| | | import { getToken, setToken, removeToken } from '@/utils/auth' |
| | | import { isHttp, isEmpty } from "@/utils/validate" |
| | | import defAva from '@/assets/images/profile.jpg' |
| | | import { login, logout, getInfo } from "@/api/login"; |
| | | import { getToken, setToken, removeToken } from "@/utils/auth"; |
| | | import { isHttp, isEmpty } from "@/utils/validate"; |
| | | import defAva from "@/assets/images/profile.jpg"; |
| | | |
| | | const user = { |
| | | state: { |
| | | token: getToken(), |
| | | id: '', |
| | | name: '', |
| | | avatar: '', |
| | | id: "", |
| | | name: "", |
| | | avatar: "", |
| | | nickName: "", |
| | | roles: [], |
| | | permissions: [] |
| | | permissions: [], |
| | | }, |
| | | |
| | | mutations: { |
| | | SET_TOKEN: (state, token) => { |
| | | state.token = token |
| | | state.token = token; |
| | | }, |
| | | SET_ID: (state, id) => { |
| | | state.id = id |
| | | state.id = id; |
| | | }, |
| | | SET_NAME: (state, name) => { |
| | | state.name = name |
| | | state.name = name; |
| | | }, |
| | | SET_AVATAR: (state, avatar) => { |
| | | state.avatar = avatar |
| | | state.avatar = avatar; |
| | | }, |
| | | SET_NICKNAME: (state, nickName) => { |
| | | state.nickName = nickName; |
| | | }, |
| | | SET_ROLES: (state, roles) => { |
| | | state.roles = roles |
| | | state.roles = roles; |
| | | }, |
| | | SET_PERMISSIONS: (state, permissions) => { |
| | | state.permissions = permissions |
| | | } |
| | | state.permissions = permissions; |
| | | }, |
| | | }, |
| | | |
| | | actions: { |
| | | // 登录 |
| | | Login({ commit }, userInfo) { |
| | | const username = userInfo.username.trim() |
| | | const password = userInfo.password |
| | | const code = userInfo.code |
| | | const uuid = userInfo.uuid |
| | | const username = userInfo.username.trim(); |
| | | const password = userInfo.password; |
| | | const code = userInfo.code; |
| | | const uuid = userInfo.uuid; |
| | | return new Promise((resolve, reject) => { |
| | | login(username, password, code, uuid).then(res => { |
| | | setToken(res.token) |
| | | commit('SET_TOKEN', res.token) |
| | | resolve() |
| | | }).catch(error => { |
| | | reject(error) |
| | | }) |
| | | }) |
| | | login(username, password, code, uuid) |
| | | .then((res) => { |
| | | setToken(res.token); |
| | | commit("SET_TOKEN", res.token); |
| | | resolve(); |
| | | }) |
| | | .catch((error) => { |
| | | reject(error); |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // 获取用户信息 |
| | | GetInfo({ commit, state }) { |
| | | return new Promise((resolve, reject) => { |
| | | getInfo().then(res => { |
| | | const user = res.user |
| | | let avatar = user.avatar || "" |
| | | if (!isHttp(avatar)) { |
| | | avatar = (isEmpty(avatar)) ? defAva : process.env.VUE_APP_BASE_API + avatar |
| | | } |
| | | if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组 |
| | | commit('SET_ROLES', res.roles) |
| | | commit('SET_PERMISSIONS', res.permissions) |
| | | } else { |
| | | commit('SET_ROLES', ['ROLE_DEFAULT']) |
| | | } |
| | | commit('SET_ID', user.userId) |
| | | commit('SET_NAME', user.userName) |
| | | commit('SET_AVATAR', avatar) |
| | | resolve(res) |
| | | }).catch(error => { |
| | | reject(error) |
| | | }) |
| | | }) |
| | | getInfo() |
| | | .then((res) => { |
| | | const user = res.user; |
| | | let avatar = user.avatar || ""; |
| | | if (!isHttp(avatar)) { |
| | | avatar = isEmpty(avatar) |
| | | ? defAva |
| | | : process.env.VUE_APP_BASE_API + avatar; |
| | | } |
| | | if (res.roles && res.roles.length > 0) { |
| | | // 验证返回的roles是否是一个非空数组 |
| | | commit("SET_ROLES", res.roles); |
| | | commit("SET_PERMISSIONS", res.permissions); |
| | | } else { |
| | | commit("SET_ROLES", ["ROLE_DEFAULT"]); |
| | | } |
| | | commit("SET_ID", user.userId); |
| | | commit("SET_NAME", user.userName); |
| | | commit("SET_AVATAR", avatar); |
| | | commit("SET_NICKNAME", user.nickName); |
| | | resolve(res); |
| | | }) |
| | | .catch((error) => { |
| | | reject(error); |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // 退出系统 |
| | | LogOut({ commit, state }) { |
| | | return new Promise((resolve, reject) => { |
| | | logout(state.token).then(() => { |
| | | commit('SET_TOKEN', '') |
| | | commit('SET_ROLES', []) |
| | | commit('SET_PERMISSIONS', []) |
| | | removeToken() |
| | | resolve() |
| | | }).catch(error => { |
| | | reject(error) |
| | | }) |
| | | }) |
| | | logout(state.token) |
| | | .then(() => { |
| | | commit("SET_TOKEN", ""); |
| | | commit("SET_ROLES", []); |
| | | commit("SET_PERMISSIONS", []); |
| | | removeToken(); |
| | | resolve(); |
| | | }) |
| | | .catch((error) => { |
| | | reject(error); |
| | | }); |
| | | }); |
| | | }, |
| | | |
| | | // 前端 登出 |
| | | FedLogOut({ commit }) { |
| | | return new Promise(resolve => { |
| | | commit('SET_TOKEN', '') |
| | | removeToken() |
| | | resolve() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | return new Promise((resolve) => { |
| | | commit("SET_TOKEN", ""); |
| | | removeToken(); |
| | | resolve(); |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | |
| | | export default user |
| | | export default user; |
| | |
| | | import { parseTime } from './ruoyi' |
| | | import { parseTime } from "./ruoyi"; |
| | | |
| | | /** |
| | | * 表格时间格式化 |
| | | */ |
| | | export function formatDate(cellValue) { |
| | | if (cellValue == null || cellValue == "") return ""; |
| | | var date = new Date(cellValue) |
| | | var year = date.getFullYear() |
| | | var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 |
| | | var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() |
| | | var hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours() |
| | | var minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes() |
| | | var seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds() |
| | | return year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds |
| | | var date = new Date(cellValue); |
| | | var year = date.getFullYear(); |
| | | var month = |
| | | date.getMonth() + 1 < 10 |
| | | ? "0" + (date.getMonth() + 1) |
| | | : date.getMonth() + 1; |
| | | var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate(); |
| | | var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(); |
| | | var minutes = |
| | | date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(); |
| | | var seconds = |
| | | date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(); |
| | | return ( |
| | | year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds |
| | | ); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @returns {string} |
| | | */ |
| | | export function formatTime(time, option) { |
| | | if (('' + time).length === 10) { |
| | | time = parseInt(time) * 1000 |
| | | if (("" + time).length === 10) { |
| | | time = parseInt(time) * 1000; |
| | | } else { |
| | | time = +time |
| | | time = +time; |
| | | } |
| | | const d = new Date(time) |
| | | const now = Date.now() |
| | | const d = new Date(time); |
| | | const now = Date.now(); |
| | | |
| | | const diff = (now - d) / 1000 |
| | | const diff = (now - d) / 1000; |
| | | |
| | | if (diff < 30) { |
| | | return '刚刚' |
| | | return "刚刚"; |
| | | } else if (diff < 3600) { |
| | | // less 1 hour |
| | | return Math.ceil(diff / 60) + '分钟前' |
| | | return Math.ceil(diff / 60) + "分钟前"; |
| | | } else if (diff < 3600 * 24) { |
| | | return Math.ceil(diff / 3600) + '小时前' |
| | | return Math.ceil(diff / 3600) + "小时前"; |
| | | } else if (diff < 3600 * 24 * 2) { |
| | | return '1天前' |
| | | return "1天前"; |
| | | } |
| | | if (option) { |
| | | return parseTime(time, option) |
| | | return parseTime(time, option); |
| | | } else { |
| | | return ( |
| | | d.getMonth() + |
| | | 1 + |
| | | '月' + |
| | | "月" + |
| | | d.getDate() + |
| | | '日' + |
| | | "日" + |
| | | d.getHours() + |
| | | '时' + |
| | | "时" + |
| | | d.getMinutes() + |
| | | '分' |
| | | ) |
| | | "分" |
| | | ); |
| | | } |
| | | } |
| | | |
| | |
| | | * @returns {Object} |
| | | */ |
| | | export function getQueryObject(url) { |
| | | url = url == null ? window.location.href : url |
| | | const search = url.substring(url.lastIndexOf('?') + 1) |
| | | const obj = {} |
| | | const reg = /([^?&=]+)=([^?&=]*)/g |
| | | url = url == null ? window.location.href : url; |
| | | const search = url.substring(url.lastIndexOf("?") + 1); |
| | | const obj = {}; |
| | | const reg = /([^?&=]+)=([^?&=]*)/g; |
| | | search.replace(reg, (rs, $1, $2) => { |
| | | const name = decodeURIComponent($1) |
| | | let val = decodeURIComponent($2) |
| | | val = String(val) |
| | | obj[name] = val |
| | | return rs |
| | | }) |
| | | return obj |
| | | const name = decodeURIComponent($1); |
| | | let val = decodeURIComponent($2); |
| | | val = String(val); |
| | | obj[name] = val; |
| | | return rs; |
| | | }); |
| | | return obj; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | export function byteLength(str) { |
| | | // returns the byte length of an utf8 string |
| | | let s = str.length |
| | | let s = str.length; |
| | | for (var i = str.length - 1; i >= 0; i--) { |
| | | const code = str.charCodeAt(i) |
| | | if (code > 0x7f && code <= 0x7ff) s++ |
| | | else if (code > 0x7ff && code <= 0xffff) s += 2 |
| | | if (code >= 0xDC00 && code <= 0xDFFF) i-- |
| | | const code = str.charCodeAt(i); |
| | | if (code > 0x7f && code <= 0x7ff) s++; |
| | | else if (code > 0x7ff && code <= 0xffff) s += 2; |
| | | if (code >= 0xdc00 && code <= 0xdfff) i--; |
| | | } |
| | | return s |
| | | return s; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @returns {Array} |
| | | */ |
| | | export function cleanArray(actual) { |
| | | const newArray = [] |
| | | const newArray = []; |
| | | for (let i = 0; i < actual.length; i++) { |
| | | if (actual[i]) { |
| | | newArray.push(actual[i]) |
| | | newArray.push(actual[i]); |
| | | } |
| | | } |
| | | return newArray |
| | | return newArray; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @returns {Array} |
| | | */ |
| | | export function param(json) { |
| | | if (!json) return '' |
| | | if (!json) return ""; |
| | | return cleanArray( |
| | | Object.keys(json).map(key => { |
| | | if (json[key] === undefined) return '' |
| | | return encodeURIComponent(key) + '=' + encodeURIComponent(json[key]) |
| | | Object.keys(json).map((key) => { |
| | | if (json[key] === undefined) return ""; |
| | | return encodeURIComponent(key) + "=" + encodeURIComponent(json[key]); |
| | | }) |
| | | ).join('&') |
| | | ).join("&"); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @returns {Object} |
| | | */ |
| | | export function param2Obj(url) { |
| | | const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') |
| | | const search = decodeURIComponent(url.split("?")[1]).replace(/\+/g, " "); |
| | | if (!search) { |
| | | return {} |
| | | return {}; |
| | | } |
| | | const obj = {} |
| | | const searchArr = search.split('&') |
| | | searchArr.forEach(v => { |
| | | const index = v.indexOf('=') |
| | | const obj = {}; |
| | | const searchArr = search.split("&"); |
| | | searchArr.forEach((v) => { |
| | | const index = v.indexOf("="); |
| | | if (index !== -1) { |
| | | const name = v.substring(0, index) |
| | | const val = v.substring(index + 1, v.length) |
| | | obj[name] = val |
| | | const name = v.substring(0, index); |
| | | const val = v.substring(index + 1, v.length); |
| | | obj[name] = val; |
| | | } |
| | | }) |
| | | return obj |
| | | }); |
| | | return obj; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @returns {string} |
| | | */ |
| | | export function html2Text(val) { |
| | | const div = document.createElement('div') |
| | | div.innerHTML = val |
| | | return div.textContent || div.innerText |
| | | const div = document.createElement("div"); |
| | | div.innerHTML = val; |
| | | return div.textContent || div.innerText; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @returns {Object} |
| | | */ |
| | | export function objectMerge(target, source) { |
| | | if (typeof target !== 'object') { |
| | | target = {} |
| | | if (typeof target !== "object") { |
| | | target = {}; |
| | | } |
| | | if (Array.isArray(source)) { |
| | | return source.slice() |
| | | return source.slice(); |
| | | } |
| | | Object.keys(source).forEach(property => { |
| | | const sourceProperty = source[property] |
| | | if (typeof sourceProperty === 'object') { |
| | | target[property] = objectMerge(target[property], sourceProperty) |
| | | Object.keys(source).forEach((property) => { |
| | | const sourceProperty = source[property]; |
| | | if (typeof sourceProperty === "object") { |
| | | target[property] = objectMerge(target[property], sourceProperty); |
| | | } else { |
| | | target[property] = sourceProperty |
| | | target[property] = sourceProperty; |
| | | } |
| | | }) |
| | | return target |
| | | }); |
| | | return target; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | export function toggleClass(element, className) { |
| | | if (!element || !className) { |
| | | return |
| | | return; |
| | | } |
| | | let classString = element.className |
| | | const nameIndex = classString.indexOf(className) |
| | | let classString = element.className; |
| | | const nameIndex = classString.indexOf(className); |
| | | if (nameIndex === -1) { |
| | | classString += '' + className |
| | | classString += "" + className; |
| | | } else { |
| | | classString = |
| | | classString.substr(0, nameIndex) + |
| | | classString.substr(nameIndex + className.length) |
| | | classString.substr(nameIndex + className.length); |
| | | } |
| | | element.className = classString |
| | | element.className = classString; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @returns {Date} |
| | | */ |
| | | export function getTime(type) { |
| | | if (type === 'start') { |
| | | return new Date().getTime() - 3600 * 1000 * 24 * 90 |
| | | if (type === "start") { |
| | | return new Date().getTime() - 3600 * 1000 * 24 * 90; |
| | | } else { |
| | | return new Date(new Date().toDateString()) |
| | | return new Date(new Date().toDateString()); |
| | | } |
| | | } |
| | | |
| | |
| | | * @return {*} |
| | | */ |
| | | export function debounce(func, wait, immediate) { |
| | | let timeout, args, context, timestamp, result |
| | | let timeout, args, context, timestamp, result; |
| | | |
| | | const later = function() { |
| | | const later = function () { |
| | | // 据上一次触发时间间隔 |
| | | const last = +new Date() - timestamp |
| | | const last = +new Date() - timestamp; |
| | | |
| | | // 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait |
| | | if (last < wait && last > 0) { |
| | | timeout = setTimeout(later, wait - last) |
| | | timeout = setTimeout(later, wait - last); |
| | | } else { |
| | | timeout = null |
| | | timeout = null; |
| | | // 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用 |
| | | if (!immediate) { |
| | | result = func.apply(context, args) |
| | | if (!timeout) context = args = null |
| | | result = func.apply(context, args); |
| | | if (!timeout) context = args = null; |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | |
| | | return function(...args) { |
| | | context = this |
| | | timestamp = +new Date() |
| | | const callNow = immediate && !timeout |
| | | return function (...args) { |
| | | context = this; |
| | | timestamp = +new Date(); |
| | | const callNow = immediate && !timeout; |
| | | // 如果延时不存在,重新设定延时 |
| | | if (!timeout) timeout = setTimeout(later, wait) |
| | | if (!timeout) timeout = setTimeout(later, wait); |
| | | if (callNow) { |
| | | result = func.apply(context, args) |
| | | context = args = null |
| | | result = func.apply(context, args); |
| | | context = args = null; |
| | | } |
| | | |
| | | return result |
| | | } |
| | | return result; |
| | | }; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @returns {Object} |
| | | */ |
| | | export function deepClone(source) { |
| | | if (!source && typeof source !== 'object') { |
| | | throw new Error('error arguments', 'deepClone') |
| | | if (!source && typeof source !== "object") { |
| | | throw new Error("error arguments", "deepClone"); |
| | | } |
| | | const targetObj = source.constructor === Array ? [] : {} |
| | | Object.keys(source).forEach(keys => { |
| | | if (source[keys] && typeof source[keys] === 'object') { |
| | | targetObj[keys] = deepClone(source[keys]) |
| | | const targetObj = source.constructor === Array ? [] : {}; |
| | | Object.keys(source).forEach((keys) => { |
| | | if (source[keys] && typeof source[keys] === "object") { |
| | | targetObj[keys] = deepClone(source[keys]); |
| | | } else { |
| | | targetObj[keys] = source[keys] |
| | | targetObj[keys] = source[keys]; |
| | | } |
| | | }) |
| | | return targetObj |
| | | }); |
| | | return targetObj; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @returns {Array} |
| | | */ |
| | | export function uniqueArr(arr) { |
| | | return Array.from(new Set(arr)) |
| | | return Array.from(new Set(arr)); |
| | | } |
| | | |
| | | /** |
| | | * @returns {string} |
| | | */ |
| | | export function createUniqueString() { |
| | | const timestamp = +new Date() + '' |
| | | const randomNum = parseInt((1 + Math.random()) * 65536) + '' |
| | | return (+(randomNum + timestamp)).toString(32) |
| | | const timestamp = +new Date() + ""; |
| | | const randomNum = parseInt((1 + Math.random()) * 65536) + ""; |
| | | return (+(randomNum + timestamp)).toString(32); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @returns {boolean} |
| | | */ |
| | | export function hasClass(ele, cls) { |
| | | return !!ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')) |
| | | return !!ele.className.match(new RegExp("(\\s|^)" + cls + "(\\s|$)")); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param {string} cls |
| | | */ |
| | | export function addClass(ele, cls) { |
| | | if (!hasClass(ele, cls)) ele.className += ' ' + cls |
| | | if (!hasClass(ele, cls)) ele.className += " " + cls; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | export function removeClass(ele, cls) { |
| | | if (hasClass(ele, cls)) { |
| | | const reg = new RegExp('(\\s|^)' + cls + '(\\s|$)') |
| | | ele.className = ele.className.replace(reg, ' ') |
| | | const reg = new RegExp("(\\s|^)" + cls + "(\\s|$)"); |
| | | ele.className = ele.className.replace(reg, " "); |
| | | } |
| | | } |
| | | |
| | | export function makeMap(str, expectsLowerCase) { |
| | | const map = Object.create(null) |
| | | const list = str.split(',') |
| | | const map = Object.create(null); |
| | | const list = str.split(","); |
| | | for (let i = 0; i < list.length; i++) { |
| | | map[list[i]] = true |
| | | map[list[i]] = true; |
| | | } |
| | | return expectsLowerCase |
| | | ? val => map[val.toLowerCase()] |
| | | : val => map[val] |
| | | return expectsLowerCase ? (val) => map[val.toLowerCase()] : (val) => map[val]; |
| | | } |
| | | |
| | | export const exportDefault = 'export default ' |
| | | export const exportDefault = "export default "; |
| | | |
| | | export const beautifierConf = { |
| | | html: { |
| | | indent_size: '2', |
| | | indent_char: ' ', |
| | | max_preserve_newlines: '-1', |
| | | indent_size: "2", |
| | | indent_char: " ", |
| | | max_preserve_newlines: "-1", |
| | | preserve_newlines: false, |
| | | keep_array_indentation: false, |
| | | break_chained_methods: false, |
| | | indent_scripts: 'separate', |
| | | brace_style: 'end-expand', |
| | | indent_scripts: "separate", |
| | | brace_style: "end-expand", |
| | | space_before_conditional: true, |
| | | unescape_strings: false, |
| | | jslint_happy: false, |
| | | end_with_newline: true, |
| | | wrap_line_length: '110', |
| | | wrap_line_length: "110", |
| | | indent_inner_html: true, |
| | | comma_first: false, |
| | | e4x: true, |
| | | indent_empty_lines: true |
| | | indent_empty_lines: true, |
| | | }, |
| | | js: { |
| | | indent_size: '2', |
| | | indent_char: ' ', |
| | | max_preserve_newlines: '-1', |
| | | indent_size: "2", |
| | | indent_char: " ", |
| | | max_preserve_newlines: "-1", |
| | | preserve_newlines: false, |
| | | keep_array_indentation: false, |
| | | break_chained_methods: false, |
| | | indent_scripts: 'normal', |
| | | brace_style: 'end-expand', |
| | | indent_scripts: "normal", |
| | | brace_style: "end-expand", |
| | | space_before_conditional: true, |
| | | unescape_strings: false, |
| | | jslint_happy: true, |
| | | end_with_newline: true, |
| | | wrap_line_length: '110', |
| | | wrap_line_length: "110", |
| | | indent_inner_html: true, |
| | | comma_first: false, |
| | | e4x: true, |
| | | indent_empty_lines: true |
| | | } |
| | | } |
| | | indent_empty_lines: true, |
| | | }, |
| | | }; |
| | | |
| | | // 首字母大小 |
| | | export function titleCase(str) { |
| | | return str.replace(/( |^)[a-z]/g, L => L.toUpperCase()) |
| | | return str.replace(/( |^)[a-z]/g, (L) => L.toUpperCase()); |
| | | } |
| | | |
| | | // 下划转驼峰 |
| | | export function camelCase(str) { |
| | | return str.replace(/_[a-z]/g, str1 => str1.substr(-1).toUpperCase()) |
| | | return str.replace(/_[a-z]/g, (str1) => str1.substr(-1).toUpperCase()); |
| | | } |
| | | |
| | | export function isNumberStr(str) { |
| | | return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str) |
| | | return /^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(str); |
| | | } |
| | | |
| | | // 修正字典结构 |
| | | export function dictToValue(arr) { |
| | | return arr.map((m) => { |
| | | return { |
| | | value: m.dictValue, |
| | | label: m.dictLabel, |
| | | type: m.listClass, |
| | | }; |
| | | }); |
| | | } |
| | |
| | | style="width: 100%" |
| | | > |
| | | <el-option |
| | | v-for="item in inspectionValueTypeList" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | v-for="dict in dict.type.inspection_value_type" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | data() { |
| | | // 这里存放数据 |
| | | return { |
| | | dicts: ["inspection_value_type"], |
| | | editInspectionDia: false, |
| | | entity: { |
| | | id: 0, |
| | | }, |
| | | inspectionValueTypeList: [], // 检验值类型下拉框 |
| | | editColumn: [ |
| | | { |
| | | label: "样品编号", |
| | |
| | | // 修改弹框 |
| | | editIns(row) { |
| | | this.editAskDia = true; |
| | | this.selectEnumByCategoryForInspectionValueType(); |
| | | this.editForm = { ...row }; |
| | | }, |
| | | // 提交修改 |
| | |
| | | this.page.current = page; |
| | | this.page.size = limit; |
| | | this.getTableData(); |
| | | }, |
| | | selectEnumByCategoryForInspectionValueType() { |
| | | this.$axios |
| | | .post(this.$api.enums.selectEnumByCategory, { |
| | | category: "检验值类型", |
| | | }) |
| | | .then((res) => { |
| | | this.inspectionValueTypeList = res.data; |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | <style scoped> |
| | | .ins-order-plan-main .title { |
| | | font-size: 20px; |
| | | color: #3a7bfa; |
| | | } |
| | | |
| | | .search { |
| | | background-color: #fff; |
| | | height: 80px; |
| | | height: 40px; |
| | | display: flex; |
| | | align-items: center; |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .search_thing { |
| | |
| | | } |
| | | |
| | | .search_label { |
| | | width: 120px; |
| | | width: 100px; |
| | | font-size: 14px; |
| | | text-align: right; |
| | | } |
| | |
| | | |
| | | .ins-order-plan-main .search { |
| | | width: 100%; |
| | | margin-bottom: 10px; |
| | | height: 80px; |
| | | height: 40px; |
| | | background-color: #fff; |
| | | border-radius: 3px; |
| | | } |
| | | |
| | | .search .form-inline { |
| | | height: 50px; |
| | | padding-top: 20px; |
| | | padding-left: 50px; |
| | | } |
| | | |
| | | .ins-order-plan-main .center { |
| | | width: calc(100% - 40px); |
| | | height: calc(100% - 60px - 80px - 40px); |
| | | background-color: #fff; |
| | | border-radius: 3px; |
| | | padding: 20px; |
| | | } |
| | | |
| | | .ins-order-plan-main .center .value-table { |
| | | width: 100%; |
| | | height: calc(100% - 68px); |
| | | padding-top: 0px; |
| | | } |
| | | |
| | | .tab { |
| | | list-style-type: none; |
| | | display: flex; |
| | | padding-left: 6px; |
| | | } |
| | | |
| | | .tab li { |
| | | line-height: 24px; |
| | | padding: 6px 14px; |
| | | padding: 4px 10px; |
| | | font-size: 14px; |
| | | color: #333333; |
| | | border: 1px solid #eeeeee; |
| | |
| | | .ins-order-plan-main .el-form-item__label { |
| | | color: #000; |
| | | } |
| | | |
| | | .ins-order-plan-main .el-table th.el-table__cell > .cell { |
| | | height: 46px; |
| | | line-height: 30px; |
| | | } |
| | | </style> |
| | | <template> |
| | | <div class="ins-order-plan-main"> |
| | | <div v-show="activeFace == 0 && state == 0" style="height: 100%"> |
| | | <p |
| | | style=" |
| | | font-size: 16px; |
| | | padding-left: 20px; |
| | | text-align: left; |
| | | height: 60px; |
| | | line-height: 60px; |
| | | " |
| | | > |
| | | 检验任务 |
| | | </p> |
| | | <div class="search"> |
| | | <div class="search_thing"> |
| | | <div class="search_label">委托编号:</div> |
| | | <div class="search_input"> |
| | | <el-input |
| | | v-model="componentData.entity.entrustCode" |
| | | v-model="queryParams.entrustCode" |
| | | clearable |
| | | placeholder="请输入" |
| | | size="small" |
| | |
| | | <div class="search_label">检验状态:</div> |
| | | <div class="search_input"> |
| | | <el-select |
| | | v-model="componentData.entity.insState" |
| | | v-model="queryParams.insState" |
| | | size="small" |
| | | style="width: 100%" |
| | | @change="refreshTable()" |
| | | > |
| | | <el-option |
| | | v-for="(a, i) in insStateList" |
| | | v-for="(a, i) in dict.type.inspection_task_state" |
| | | :key="i" |
| | | :label="a.label" |
| | | :value="a.value" |
| | |
| | | </el-select> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="search_thing">--> |
| | | <!-- <div class="search_label">下单类别:</div>--> |
| | | <!-- <div class="search_input">--> |
| | | <!-- <el-select v-model="componentData.entity.typeSource" clearable size="small" style="width: 100%;" @change="refreshTable()">--> |
| | | <!-- <el-option v-for="(a, i) in typeSourceList" :key="i" :label="a.label" :value="a.value"></el-option>--> |
| | | <!-- </el-select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <div class="search_thing" style="padding-left: 30px"> |
| | | <el-button size="small" @click="refresh()">重 置</el-button> |
| | | <el-button size="small" type="primary" @click="refreshTable()" |
| | |
| | | <div class="center-options"> |
| | | <el-row> |
| | | <el-col :span="21"> |
| | | <div |
| | | style="display: flex; align-items: center; margin-bottom: 10px" |
| | | > |
| | | <span style="margin-right: 8px">试验室种类:</span> |
| | | <div style="display: flex; align-items: center"> |
| | | <span style="font-size: 14px">试验室种类:</span> |
| | | <ul class="tab"> |
| | | <li |
| | | v-for="(m, i) in tabList" |
| | |
| | | <el-col :span="3"> |
| | | <div class="center-title"> |
| | | <span>总计任务数量:</span> |
| | | <span v-if="$refs.insOrderPlan != undefined">{{ |
| | | $refs.insOrderPlan.total |
| | | }}</span> |
| | | <span>{{ page.total }}</span> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <ValueTable |
| | | <!-- <ValueTable |
| | | :key="upIndex" |
| | | ref="insOrderPlan" |
| | | :componentData="componentData" |
| | |
| | | :url="$api.insOrderPlan.selectInsOrderPlanList" |
| | | class="value-table" |
| | | @handleInspection="handleInspection" |
| | | /> |
| | | /> --> |
| | | <lims-table |
| | | :tableData="tableData" |
| | | :column="column" |
| | | :page="page" |
| | | :tableLoading="tableLoading" |
| | | :height="'calc(100vh - 290px)'" |
| | | @pagination="pagination" |
| | | ></lims-table> |
| | | </div> |
| | | </div> |
| | | <el-dialog :visible.sync="claimVisible" title="提示" width="400px"> |
| | |
| | | > |
| | | </span> |
| | | </el-dialog> |
| | | <un-pass-retest-result |
| | | <!-- <un-pass-retest-result |
| | | v-if="retestVisible" |
| | | :retestInfo="retestInfo" |
| | | :retestVisible="retestVisible" |
| | | @closeRetestLook="closeRetestLook" |
| | | ></un-pass-retest-result> |
| | | ></un-pass-retest-result> --> |
| | | <!--产业链信息查看--> |
| | | <!-- <ShowInfo |
| | | v-if="showInfoDialog" |
| | |
| | | // import Add from "../do/b1-ins-order/add.vue"; |
| | | // import ShowInfo from "../do/b1-material-ins-order/showInfo.vue"; |
| | | // import CopperOrder from "../do/b1-material-ins-order/copper-order.vue"; |
| | | // import UnPassRetestResult from "../do/b1-material-ins-order/unPassRetestResult.vue"; |
| | | import EditInspectionItem from "./components/EditInspectionItem.vue"; |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import { |
| | | getRetestResult, |
| | | claimInsOrderPlan, |
| | | upPlanUser2, |
| | | upPlanUser, |
| | | selectUserCondition, |
| | | getBindingProductByProductId, |
| | | getProductTreeByProductId, |
| | | bindingProductTreeByProductId, |
| | | delProductTreeByProductId, |
| | | selectInsOrderPlanList, |
| | | } from "@/api/business/inspectionTask.js"; |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | components: { |
| | | EditInspectionItem, |
| | | // CopperOrder, |
| | | // ShowInfo, |
| | | ValueTable, |
| | | limsTable, |
| | | // Inspection, |
| | | // Add, |
| | | // CustomsInspection, |
| | | // UnPassRetestResult |
| | | }, |
| | | dicts: ["urgency_level", "inspection_task_state"], |
| | | computed: { |
| | | ...mapGetters(["name", "userId"]), |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | isCopper: null, |
| | | bindCurrentInfo: {}, |
| | | lookInfo: {}, |
| | | orderTypeList: [ |
| | | { |
| | | value: "Customer-ordered test", |
| | | label: "委托试验", |
| | | type: "success", |
| | | effect: "plain", |
| | | }, |
| | | { |
| | | value: "抽检", |
| | | label: "抽检", |
| | | type: "", |
| | | effect: "plain", |
| | | }, |
| | | { |
| | | value: "进厂检验", |
| | | label: "进厂检验", |
| | | type: "info", |
| | | effect: "plain", |
| | | }, |
| | | { |
| | | value: "Quarterly inspection", |
| | | label: "季度检验", |
| | | type: "warning", |
| | | effect: "plain", |
| | | }, |
| | | ], |
| | | urgencyLevel: [], |
| | | inspectionTaskState: [], |
| | | tableData: [], |
| | | column: [ |
| | | { |
| | | label: "委托编号", |
| | | prop: "entrustCode", |
| | | width: "140px", |
| | | dataType: "link", |
| | | linkMethod: "selectAllByOne", |
| | | }, |
| | | { label: "样品名称", prop: "sample", width: "140px" }, |
| | | { |
| | | label: "下单类别", |
| | | prop: "typeSource", |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | if (params == 0) { |
| | | return "成品下单"; |
| | | } else { |
| | | return "原材料下单"; |
| | | } |
| | | }, |
| | | }, |
| | | { label: "样品型号", prop: "sampleModel", width: "120px" }, |
| | | { |
| | | label: "紧急程度", |
| | | prop: "type", |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | return this.urgencyLevel.find((m) => m.value == params).label; |
| | | }, |
| | | }, |
| | | { |
| | | label: "检验类型", |
| | | prop: "orderType", |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | return this.orderTypeList.find((m) => m.value == params).label; |
| | | }, |
| | | formatType: (params) => { |
| | | return this.orderTypeList.find((m) => m.value == params).type; |
| | | }, |
| | | }, |
| | | { |
| | | label: "状态", |
| | | prop: "insState", |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | return this.inspectionTaskState.find((m) => m.value == params) |
| | | .label; |
| | | }, |
| | | formatType: (params) => { |
| | | return this.inspectionTaskState.find((m) => m.value == params).type; |
| | | }, |
| | | }, |
| | | { label: "检验人", prop: "userName" }, |
| | | { label: "复核人", prop: "checkName" }, |
| | | { label: "约定时间", prop: "appointed" }, |
| | | { label: "下发时间", prop: "sendTime", width: "140px" }, |
| | | { label: "检验开始时间", prop: "insTime", width: "140px" }, |
| | | { label: "理由", prop: "verifyTell", width: "140px" }, |
| | | { |
| | | dataType: "action", |
| | | fixed: "right", |
| | | label: "操作", |
| | | width: "260px", |
| | | operation: [ |
| | | { |
| | | name: "数据查看", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleDataLook(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "修改检验值", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.editInspection(row); |
| | | }, |
| | | disabled: (row) => { |
| | | return ( |
| | | row.userName == null || row.insState == 3 || row.insState == 5 |
| | | ); |
| | | }, |
| | | }, |
| | | { |
| | | name: "检验", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleInspection(row); |
| | | }, |
| | | disabled: (row) => { |
| | | return ( |
| | | row.userName == null || |
| | | row.insState == 3 || |
| | | row.insState == 5 || |
| | | (row.userName && !row.userName.includes(this.name)) |
| | | ); |
| | | }, |
| | | }, |
| | | { |
| | | name: "交接", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.handleConnect(row); |
| | | }, |
| | | disabled: (row) => { |
| | | return ( |
| | | row.userName == null || |
| | | row.insState == 5 || |
| | | row.insState == 3 || |
| | | (row.userName && !row.userName.includes(this.name)) |
| | | ); |
| | | }, |
| | | }, |
| | | { |
| | | name: "原始记录", |
| | | type: "text", |
| | | clickFun: (row) => { |
| | | this.viewInspectInfo(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 0, |
| | | }, |
| | | tableLoading: false, |
| | | queryParams: {}, |
| | | }; |
| | | }, |
| | | created() { |
| | | // this.getLaboratoryDicts() |
| | | this.getTypeDicts(); |
| | | this.getInsStateDicts(); |
| | | this.getAuthorizedPerson(); |
| | | this.currentTime = getYearAndMonthAndDays(); |
| | | this.getDicts("urgency_level").then((response) => { |
| | | this.urgencyLevel = this.dictToValue(response.data); |
| | | }); |
| | | this.getDicts("inspection_task_state").then((response) => { |
| | | this.inspectionTaskState = this.dictToValue(response.data); |
| | | }); |
| | | }, |
| | | mounted() { |
| | | this.entityCopy = this.HaveJson(this.componentData.entity); |
| | | let user = JSON.parse(localStorage.getItem("user")); |
| | | this.componentData.entity.userId = user.userId; |
| | | this.getPower(); |
| | | this.queryParams.userId = this.userId; |
| | | // this.getPower(); |
| | | this.refreshTable(); |
| | | }, |
| | | methods: { |
| | | getList() { |
| | | this.tableLoading = true; |
| | | let param = { ...this.queryParams, ...this.page }; |
| | | delete param.total; |
| | | selectInsOrderPlanList({ ...param }) |
| | | .then((res) => { |
| | | this.tableLoading = false; |
| | | if (res.code === 200) { |
| | | this.tableData = res.data.records; |
| | | this.page.total = res.data.total; |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | this.tableLoading = false; |
| | | }); |
| | | }, |
| | | pagination({ page, limit }) { |
| | | this.page.current = page; |
| | | this.page.size = limit; |
| | | this.getList(); |
| | | }, |
| | | // 修改检验值 |
| | | editInspection(row) { |
| | | this.$refs.editInspectionItem.showDialog(row.id); |
| | | }, |
| | | // 刷新页面 |
| | | refreshView() { |
| | | this.InspectionKey++; |
| | | this.getList(); |
| | | }, |
| | | // 数据查看 |
| | | handleDataLook(row) { |
| | |
| | | }, |
| | | // 查看不合格复测结果 |
| | | getRetestResult(row) { |
| | | this.$axios |
| | | .get( |
| | | this.$api.insOrder.getRetestResult + |
| | | "?insProductId=" + |
| | | row.insProductId |
| | | ) |
| | | .then((res) => { |
| | | if (res.code == 201) return; |
| | | this.retestVisible = true; |
| | | this.retestInfo = res.data; |
| | | }); |
| | | getRetestResult({ insProductId: row.insProductId }).then((res) => { |
| | | if (res.code == 201) return; |
| | | this.retestVisible = true; |
| | | this.retestInfo = res.data; |
| | | }); |
| | | }, |
| | | // |
| | | closeRetestLook() { |
| | |
| | | } |
| | | }, |
| | | changeCheckBox(val) { |
| | | this.componentData.entity.userId = val ? 0 : null; |
| | | this.queryParams.userId = val ? 0 : null; |
| | | this.refreshTable(); |
| | | }, |
| | | refresh() { |
| | | this.componentData.entity = this.HaveJson(this.entityCopy); |
| | | let user = JSON.parse(localStorage.getItem("user")); |
| | | this.componentData.entity.userId = user.userId; |
| | | this.queryParams = {}; |
| | | this.queryParams.userId = this.userId; |
| | | this.alone = true; |
| | | this.refreshTable(); |
| | | }, |
| | | refreshTable(e) { |
| | | this.page.current = 1; |
| | | this.queryParams.typeSource = this.tabIndex; |
| | | this.getList(); |
| | | }, |
| | | // claimFun(row) { |
| | | // if (row) { |
| | |
| | | }, |
| | | confirmClaim() { |
| | | this.loading = true; |
| | | this.$axios |
| | | .post(this.$api.insOrderPlan.claimInsOrderPlan, this.sampleUserForm, { |
| | | headers: { |
| | | "Content-Type": "application/json", |
| | | }, |
| | | }) |
| | | claimInsOrderPlan(this.sampleUserForm) |
| | | .then((res) => { |
| | | if (res.code === 200 && res.data) { |
| | | this.loading = false; |
| | |
| | | console.error(error); |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | refreshTable(e) { |
| | | this.componentData.entity.typeSource = this.tabIndex; |
| | | this.$refs.insOrderPlan.selectList(e); |
| | | }, |
| | | changeRowClass({ row, rowIndex }) { |
| | | if (this.currentTime == row.appointed) { |
| | |
| | | sampleName: null, |
| | | state: null, |
| | | }; |
| | | this.componentData.entity.insState = null; |
| | | this.componentData.entity.sampleName = null; |
| | | this.queryParams.insState = null; |
| | | this.queryParams.sampleName = null; |
| | | this.refreshTable(); |
| | | }, |
| | | onSubmit() { |
| | | this.componentData.entity.insState = this.searchForm.state; |
| | | this.componentData.entity.sampleName = this.searchForm.sampleName; |
| | | this.queryParams.insState = this.searchForm.state; |
| | | this.queryParams.sampleName = this.searchForm.sampleName; |
| | | this.$nextTick(() => { |
| | | this.refreshTable(); |
| | | }); |
| | | }, |
| | | handleTab(m, i) { |
| | | this.tabIndex = i; |
| | | this.componentData.entity.sonLaboratory = ""; |
| | | this.queryParams.sonLaboratory = ""; |
| | | this.refreshTable(); |
| | | }, |
| | | getTypeDicts() { |
| | | this.$axios |
| | | .post(this.$api.enums.selectEnumByCategory, { |
| | | category: "紧急程度", |
| | | }) |
| | | .then((res) => { |
| | | let data = res.data; |
| | | data.forEach((ele) => { |
| | | if (ele.value === "0") { |
| | | ele.type = "success"; |
| | | } else if (ele.value === "1") { |
| | | ele.type = "warning"; |
| | | } else if (ele.value === "2") { |
| | | ele.type = "danger"; |
| | | } |
| | | }); |
| | | this.componentData.tagField.type.select = data; |
| | | }); |
| | | }, |
| | | getInsStateDicts() { |
| | | this.$axios |
| | | .post(this.$api.enums.selectEnumByCategory, { |
| | | category: "检验任务状态", |
| | | }) |
| | | .then((res) => { |
| | | let data = res.data; |
| | | this.insStateList = data; |
| | | data.forEach((ele) => { |
| | | //0:待检验 1:检验中 2:已检验 3:待复核 4:复核未通过 5:复核通过 |
| | | if (["2", "5"].includes(ele.value)) { |
| | | ele.type = "success"; |
| | | } else if (["1", "3"].includes(ele.value)) { |
| | | ele.type = "warning"; |
| | | } else if (["0", "4"].includes(ele.value)) { |
| | | ele.type = "danger"; |
| | | } |
| | | }); |
| | | this.componentData.tagField.insState.select = data; |
| | | }); |
| | | }, |
| | | // getLaboratoryDicts() { |
| | | // this.$axios.post(this.$api.enums.selectEnumByCategory, { |
| | |
| | | if (row.userName) { |
| | | inspectorList = row.userName.split(","); |
| | | } |
| | | let user = JSON.parse(localStorage.getItem("user")); |
| | | if (user) { |
| | | inspectorList.push(user.name); |
| | | if (this.name) { |
| | | inspectorList.push(this.name); |
| | | } |
| | | this.inspectorList = inspectorList; |
| | | this.sonLaboratory = row.sonLaboratory; |
| | |
| | | if (row.userName) { |
| | | inspectorList = row.userName.split(","); |
| | | } |
| | | let user = JSON.parse(localStorage.getItem("user")); |
| | | if (user) { |
| | | inspectorList.push(user.name); |
| | | if (this.name) { |
| | | inspectorList.push(this.name); |
| | | } |
| | | this.inspectorList = inspectorList; |
| | | this.sonLaboratory = row.sonLaboratory; |
| | |
| | | this.orderId = row.id; |
| | | this.connect = {}; |
| | | this.connectVisible = true; |
| | | this.$axios |
| | | .post(this.$api.insOrderPlan.upPlanUser2, { |
| | | orderId: this.orderId, |
| | | }) |
| | | .then((res) => { |
| | | if (res.code === 200 && res.data.length > 0) { |
| | | this.sonLaboratoryList = []; |
| | | res.data.forEach((m) => { |
| | | this.sonLaboratoryList.push({ |
| | | value: m, |
| | | label: m, |
| | | }); |
| | | upPlanUser2({ orderId: this.orderId }).then((res) => { |
| | | if (res.code === 200 && res.data.length > 0) { |
| | | this.sonLaboratoryList = []; |
| | | res.data.forEach((m) => { |
| | | this.sonLaboratoryList.push({ |
| | | value: m, |
| | | label: m, |
| | | }); |
| | | this.connect.sonLaboratory = this.sonLaboratoryList[0].value; |
| | | } |
| | | }); |
| | | }); |
| | | this.connect.sonLaboratory = this.sonLaboratoryList[0].value; |
| | | } |
| | | }); |
| | | }, |
| | | confirmConnect() { |
| | | if ( |
| | |
| | | return; |
| | | } |
| | | this.loading = true; |
| | | this.$axios |
| | | .post(this.$api.insOrderPlan.upPlanUser, { |
| | | orderId: this.orderId, |
| | | userId: this.connect.connectPerson, |
| | | sonLaboratory: this.connect.sonLaboratory, |
| | | }) |
| | | upPlanUser({ |
| | | orderId: this.orderId, |
| | | userId: this.connect.connectPerson, |
| | | sonLaboratory: this.connect.sonLaboratory, |
| | | }) |
| | | .then((res) => { |
| | | if (res.code === 200) { |
| | | this.loading = false; |
| | |
| | | this.orderId = row.id; |
| | | }, |
| | | getAuthorizedPerson() { |
| | | this.$axios.get(this.$api.user.getUserMenu).then((res) => { |
| | | selectUserCondition().then((res) => { |
| | | let data = []; |
| | | res.data.forEach((a) => { |
| | | data.push({ |
| | |
| | | // 绑定检验项绑定 |
| | | getBinding(row) { |
| | | this.bindCurrentInfo = row; |
| | | this.$axios |
| | | .get( |
| | | this.$api.insOrderPlan.getBindingProductByProductId + |
| | | "?productId=" + |
| | | row.insProductId |
| | | ) |
| | | getBindingProductByProductId({ productId: row.insProductId }) |
| | | .then((res) => { |
| | | if (res.coe == 201) { |
| | | // this.$message.error('未绑定检验项') |
| | |
| | | }); |
| | | }, |
| | | openBindAdd() { |
| | | this.$axios |
| | | .get( |
| | | this.$api.insOrderPlan.getProductTreeByProductId + |
| | | "?productId=" + |
| | | this.bindCurrentInfo.insProductId |
| | | ) |
| | | getProductTreeByProductId({ |
| | | productId: this.bindCurrentInfo.insProductId, |
| | | }) |
| | | .then((res) => { |
| | | if (res.coe == 201) { |
| | | // this.$message.error('未绑定检验项') |
| | |
| | | delete item.template; |
| | | }); |
| | | this.loading = true; |
| | | this.$axios |
| | | .post( |
| | | this.$api.insOrderPlan.bindingProductTreeByProductId, |
| | | { |
| | | insProductId: this.bindCurrentInfo.insProductId, |
| | | insProductBindingList: this.chooseBindAddList, |
| | | }, |
| | | { |
| | | headers: { |
| | | "Content-Type": "application/json", |
| | | }, |
| | | noQs: true, |
| | | } |
| | | ) |
| | | bindingProductTreeByProductId({ |
| | | insProductId: this.bindCurrentInfo.insProductId, |
| | | insProductBindingList: this.chooseBindAddList, |
| | | }) |
| | | .then((res) => { |
| | | this.loading = false; |
| | | if (res.code == 201) { |
| | |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(async () => { |
| | | this.$axios |
| | | .get( |
| | | this.$api.insOrderPlan.delProductTreeByProductId + |
| | | "?productId=" + |
| | | row.id |
| | | ) |
| | | delProductTreeByProductId({ productId: row.id }) |
| | | .then((res) => { |
| | | if (res.coe == 201) { |
| | | // this.$message.error('未绑定检验项') |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import ValueTable from "@/components/Table/value-table.vue"; |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import { |
| | | selectAuxiliaryWorkingHours, |
| | |
| | | } from "@/api/performance/manHour"; |
| | | export default { |
| | | components: { |
| | | ValueTable, |
| | | limsTable, |
| | | }, |
| | | dicts: ["sys_unit"], |