From f55848a34750d26419d6a712b9c181ce4e34985a Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 14 三月 2024 16:10:10 +0800
Subject: [PATCH] 业务管理:检验任务
---
src/components/view/enums.vue | 2
src/components/tool/value-table.vue | 29 ++++
src/components/view/b1-inspect-order-plan.vue | 273 +++++++++++++++++++++++++++++++++++++++++++++
static/js/menu.js | 4
src/util/date.js | 16 ++
src/assets/api/controller.js | 9 +
6 files changed, 326 insertions(+), 7 deletions(-)
diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js
index 63d4c3d..d281f3f 100644
--- a/src/assets/api/controller.js
+++ b/src/assets/api/controller.js
@@ -12,7 +12,8 @@
standardTree,
standardMethod,
StandardTemplate,
- insOrder
+ insOrder,
+ insOrderPlan
}
}
@@ -114,6 +115,12 @@
selectInsOrderParameter: "/insOrder/selectInsOrderParameter", //鏌ヨ妫�楠屼笅鍗�
}
+const insOrderPlan = {
+ selectInsOrderPlanList: "/insOrderPlan/selectInsOrderPlanList", //鏌ヨ妫�楠屼换鍔�
+}
+
+
+
const systemLog = {
selectSystemLogList: "/systemLog/selectSystemLogList", //鑾峰彇鏃ュ織
}
diff --git a/src/components/tool/value-table.vue b/src/components/tool/value-table.vue
index 829f513..5407b08 100644
--- a/src/components/tool/value-table.vue
+++ b/src/components/tool/value-table.vue
@@ -36,6 +36,26 @@
}
</style>
<style>
+ .value-table .highlight-warning-row-border td{
+ border-top: 2px solid #ffcd29;
+ border-bottom: 2px solid #ffcd29;
+ }
+ .value-table .highlight-warning-row-border td:first-child{
+ border-left: 2px solid #ffcd29;
+ }
+ .value-table .highlight-warning-row-border td:last-child{
+ border-right: 2px solid #ffcd29;
+ }
+ .value-table .highlight-danger-row-border td{
+ border-top: 2px solid red;
+ border-bottom: 2px solid red;
+ }
+ .value-table .highlight-danger-row-border td:first-child{
+ border-left: 2px solid red;
+ }
+ .value-table .highlight-danger-row-border td:last-child{
+ border-right: 2px solid red;
+ }
.value-table .el-upload {
width: 100%;
}
@@ -51,13 +71,13 @@
<el-table ref="eltable" :data="tableData" style="width: 100%;" height="100%" tooltip-effect="dark" border
@selection-change="selectChange" @select="select" v-loading="loading" @sort-change="sortChange"
@row-click="rowClick" :show-summary="data.countFleid!=undefined && data.countFleid.length > 0"
- :summary-method="getSummaries" :key="Math.random()">
+ :summary-method="getSummaries" :key="Math.random()" :row-class-name="tableRowClassName">
<el-table-column type="selection" width="65" v-if="data.showSelect" :key="Math.random()">
</el-table-column>
<el-table-column type="index" align="center" label="搴忓彿" width="70" v-if="data.isIndex" :key="Math.random()">
</el-table-column>
<el-table-column :prop="a.label" :label="a.value" sortable="custom" v-for="(a, ai) in tableHead" :key="ai"
- show-overflow-tooltip min-width="160">
+ show-overflow-tooltip min-width="160">
<template slot-scope="scope">
<div v-if="showType(a.label, data.tagField) != null">
<el-tag v-for="(b, bi) in data.tagField[a.label].select" :key="bi" v-if="b.value == scope.row[a.label]"
@@ -195,6 +215,9 @@
} from 'iview';
export default {
props: {
+ tableRowClassName:{
+ type: Function
+ },
url: {
type: String,
default: () => null
@@ -552,7 +575,7 @@
return
}
for (var i = 0; i < this.data.requiredAdd.length; i++) {
- if (this.upData[this.data.requiredAdd[i]] == null || this.upData[this.data.requiredAdd[i]] == '') {
+ if (this.upData[this.data.requiredAdd[i]] === null || this.upData[this.data.requiredAdd[i]] === '') {
var list = this.upHead.filter(a => {
if (a.label == this.data.requiredAdd[i]) return a
})
diff --git a/src/components/view/b1-inspect-order-plan.vue b/src/components/view/b1-inspect-order-plan.vue
new file mode 100644
index 0000000..d3faffd
--- /dev/null
+++ b/src/components/view/b1-inspect-order-plan.vue
@@ -0,0 +1,273 @@
+<style scoped>
+.ins-order-plan-main{
+ padding-top: 60px;
+}
+.ins-order-plan-main .search{
+ width: 100%;
+ margin-bottom: 10px;
+ height: 10vh;
+ background-color: #fff;
+ border-radius: 3px;
+}
+.search .form-inline{
+ height: 5vh;
+ padding-top:2.5vh;
+ padding-left: 1%;
+}
+.ins-order-plan-main .center{
+ width: 100%;
+ height: 70vh;
+ background-color: #fff;
+ border-radius: 3px;
+}
+.ins-order-plan-main .center .value-table{
+ width:98%;
+ height: 80%;
+ margin-left:1%;
+}
+.tab {
+ list-style-type: none;
+ display: flex;
+ padding: 10px 0px;
+}
+.tab li {
+ line-height: 24px;
+ padding: 6px 14px;
+ font-size: 14px;
+ color: #333333;
+ border: 1px solid #EEEEEE;
+ cursor: pointer;
+}
+
+.tab li:nth-child(1) {
+ border-radius: 8px 0 0 8px;
+}
+
+.tab li:nth-child(3) {
+ border-radius: 0 8px 8px 0;
+}
+
+.tab li.active {
+ border-color: #3A7BFA;
+ color: #3A7BFA;
+}
+.center .center-options:nth-child(1){
+ padding-left: 1%;
+}
+.center .center-options .center-title {
+ width:85%;
+ padding-top: 20px;
+ text-align: right;
+}
+.center .center-options .center-title span:last-child{
+ color: #3A7BFA;
+ font-size: 23px;
+ font-weight: 400;
+}
+
+</style>
+<template>
+ <div class="ins-order-plan-main">
+ <div class="search">
+ <el-form :inline="true" :model="searchForm" class="form-inline">
+ <el-form-item label="鏍峰搧鍚嶇О:">
+ <el-input clearable v-model="searchForm.sampleName" size="small" placeholder="璇疯緭鍏�"></el-input>
+ </el-form-item>
+ <el-form-item label="鐘舵��:">
+ <el-select clearable size="small" v-model="searchForm.state" placeholder="璇烽�夋嫨">
+ <el-option v-for="(item,index) in insStateList" :key="index"
+ :label="item.label" :value="item.value"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item>
+ <el-button size="small" @click="onReset">閲嶇疆</el-button>
+ <el-button size="small" type="primary" @click="onSubmit">鏌ヨ</el-button>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div class="center">
+ <div class="center-options">
+ <el-row>
+ <el-col :span="20">
+ <ul class="tab">
+ <li v-for="(m,i) in tabList" :key="i" :class="{active:i==tabIndex}" @click="handleTab(m,i)">{{m.label}}</li>
+ </ul>
+ </el-col>
+ <el-col :span="4">
+ <div class="center-title">
+ <span>鎬昏浠诲姟鏁伴噺:</span>
+ <span v-text="planTotal"></span>
+ </div>
+ </el-col>
+ </el-row>
+ </div>
+ <ValueTable :tableRowClassName="changeRowClass" class="value-table" ref="insOrderPlan" :url="$api.insOrderPlan.selectInsOrderPlanList" :upUrl="$api.user.updateUser" :componentData="componentData" :key="upIndex" @upUser="upUser"/>
+ </div>
+ </div>
+</template>
+
+<script>
+import ValueTable from '../tool/value-table.vue'
+import { getYearAndMonthAndDays } from '../../util/date'
+export default {
+ components:{
+ ValueTable
+ },
+ data(){
+ return {
+ searchForm:{
+ sampleName: null,
+ state: null
+ },
+ tabList: [
+ {
+ label: '瀹為獙瀹�1',
+ value: 1
+ },
+ {
+ label: '瀹為獙瀹�2',
+ value: 2
+ },
+ {
+ label: '瀹為獙瀹�3',
+ value: 3
+ }
+ ],
+ active: 1,
+ tabIndex: 0,
+ componentData: {
+ entity: {
+ state: 1,
+ insState: null,
+ sample: null,
+ orderBy: {
+ field: 'type',
+ order: 'desc'
+ }
+ },
+ isIndex: true,
+ showSelect: false,
+ select: false,
+ do: [{
+ id: '',
+ font: '妫�楠�',
+ type: 'text',
+ method: '',
+ field:[]
+ },{
+ id: '',
+ font: '浜ゆ帴',
+ type: 'text',
+ method: ''
+ },
+ {
+ id: '',
+ font: '澶嶆牳',
+ type: 'text',
+ method: ''
+ },{
+ id: '',
+ font: '璁ら',
+ type: 'text',
+ method: ''
+ }],
+ tagField: {
+ type:{
+ select:[]
+ },
+ insState:{
+ select:[]
+ }
+ },
+ selectField: {},
+ requiredAdd:[],
+ requiredUp:[]
+ },
+ upIndex: 0,
+ planTotal: 0,
+ insStateList: []
+ }
+ },
+ created(){
+ this.getTypeDicts()
+ this.getInsStateDicts()
+ },
+ methods:{
+ upUser(){
+
+ },
+ refreshTable() {
+ this.$refs.insOrderPlan.selectList()
+ this.$nextTick(()=>{
+ this.planTotal = this.$refs.insOrderPlan.total
+ })
+ },
+ changeRowClass(obj,rowIndex){
+ let currentTime = getYearAndMonthAndDays()
+ if(obj.row.sendTime && currentTime===obj.row.sendTime){
+ return 'highlight-warning-row-border'
+ }else if(obj.row.sendTime && currentTime>obj.row.sendTime){
+ return 'highlight-danger-row-border'
+ }
+ return ''
+ },
+ onReset(){
+ this.searchForm = {
+ sampleName: null,
+ state: null,
+ }
+ this.componentData.entity.insState = null
+ this.componentData.entity.sample = null
+ this.refreshTable()
+ },
+ onSubmit(){
+ this.componentData.entity.insState = this.searchForm.state
+ this.componentData.entity.sample = this.searchForm.sampleName
+ this.$nextTick(()=>{
+ this.refreshTable()
+ })
+ },
+ handleTab(m, i) {
+ this.tabIndex = i;
+ //this.componentData.entity.state = m.value
+ //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
+ })
+ },
+ }
+}
+</script>
diff --git a/src/components/view/enums.vue b/src/components/view/enums.vue
index 82eddd5..b00c5a2 100644
--- a/src/components/view/enums.vue
+++ b/src/components/view/enums.vue
@@ -153,4 +153,4 @@
}
}
}
-</script>
\ No newline at end of file
+</script>
diff --git a/src/util/date.js b/src/util/date.js
new file mode 100644
index 0000000..867a406
--- /dev/null
+++ b/src/util/date.js
@@ -0,0 +1,16 @@
+/**
+ * 鑾峰彇骞存湀鏃�
+ */
+export function getYearAndMonthAndDays() {
+ const date = new Date()
+ let year = date.getFullYear()
+ let month = date.getMonth() + 1
+ if (month < 10) {
+ month = '0' + month + '-'
+ } else {
+ month = month + '-'
+ }
+ year = year + '-'
+ let days = date.getDate()
+ return year + month + days
+}
diff --git a/static/js/menu.js b/static/js/menu.js
index d077177..d24b3a4 100644
--- a/static/js/menu.js
+++ b/static/js/menu.js
@@ -22,8 +22,8 @@
}, {
v: "妫�楠屼换鍔�",
i: "font icon-erjidaohang",
- u: "",
- p: ""
+ u: "b1-inspect-order-plan",
+ p: "selectInsOrderPlanList"
}, {
v: "鎶ュ憡缂栧埗",
i: "font icon-erjidaohang",
--
Gitblit v1.9.3