From d49c28b6dc4b4dd363ec699ecc8a1a51983a10f9 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期五, 31 五月 2024 17:27:03 +0800
Subject: [PATCH] 对接原始工时接口
---
src/components/do/b1-ins-order/add.vue | 2
src/components/tool/value-table.vue | 12 +++
src/components/do/b3-work-time-management/work-time-statistics.vue | 23 ++++---
src/components/do/b1-ins-order/fiberoptic-config.vue | 90 +++++++++++++++++++++--------
src/assets/api/controller.js | 7 ++
5 files changed, 96 insertions(+), 38 deletions(-)
diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js
index f2d1feb..607bb11 100644
--- a/src/assets/api/controller.js
+++ b/src/assets/api/controller.js
@@ -29,7 +29,8 @@
auxiliaryOutputWorkingHours,
auxiliaryWorkingHoursDay,
auxiliaryCorrectionHours,
- insBushing
+ insBushing,
+ auxiliaryOriginalHours,
}
}
@@ -334,3 +335,7 @@
const insBushing = {
selectBushingBySampleId: "/insBushing/selectBushingBySampleId", //閫氳繃鏍峰搧id鑾峰彇鏍峰搧涓嬪厜绾ら厤缃唴瀹�
}
+
+const auxiliaryOriginalHours = {
+ selectAuxiliaryOriginalHours: "/auxiliaryOriginalHours/selectAuxiliaryOriginalHours", //鏌ヨ鍘熷宸ユ椂
+}
diff --git a/src/components/do/b1-ins-order/add.vue b/src/components/do/b1-ins-order/add.vue
index 78cbd51..2dc6d8a 100644
--- a/src/components/do/b1-ins-order/add.vue
+++ b/src/components/do/b1-ins-order/add.vue
@@ -541,7 +541,7 @@
</el-row>
</span>
</el-dialog>
- <fiberOpticConfig :currentId="currentId" v-if="configShow"/>
+ <fiberOpticConfig :currentId="currentId" v-if="configShow" :active="active"/>
</div>
</template>
diff --git a/src/components/do/b1-ins-order/fiberoptic-config.vue b/src/components/do/b1-ins-order/fiberoptic-config.vue
index 6dc61c9..4f1c1b3 100644
--- a/src/components/do/b1-ins-order/fiberoptic-config.vue
+++ b/src/components/do/b1-ins-order/fiberoptic-config.vue
@@ -4,7 +4,7 @@
<el-row class="title">
<el-col :span="6" style="padding-left: 20px;">鍏夌氦閰嶇疆</el-col>
<el-col :span="18" style="text-align: right;">
- <el-button size="medium" type="primary" @click="save" :loading="saveLoad">淇� 瀛�</el-button>
+ <el-button size="medium" type="primary" @click="save" :loading="saveLoad" v-if="active==1">淇� 瀛�</el-button>
<el-button size="medium" @click="outConfig">
<span style="color: #3A7BFA;">杩� 鍥�</span>
</el-button>
@@ -22,7 +22,7 @@
<label style="width: 70px;">鏍峰搧鍨嬪彿</label>
<span style="font-size: 14px;">{{models}}</span>
</div>
- <el-radio-group v-model="packageInfo.radio" size="small" @change="upNum()">
+ <el-radio-group v-model="packageInfo.radio" size="small" @change="upNum()" :disabled="active!=1">
<el-radio :label="0">鍏ㄦ</el-radio>
<el-radio :label="1">鎶芥</el-radio>
</el-radio-group>
@@ -31,25 +31,29 @@
style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 8px;padding: 0 12px;box-sizing: border-box;">
<div class="search-item" style="margin-right: 10px;">
<label>濂楃鏁扮洰</label>
- <el-input v-model="packageInfo.num1" placeholder="璇疯緭鍏�" size="small" @change="upNum"></el-input>
+ <el-input v-model="packageInfo.num1" placeholder="璇疯緭鍏�" size="small" @change="upNum" :disabled="active!=1"></el-input>
</div>
<div class="search-item" style="margin-right: 10px;">
<label style="width: 70px;">鏍囧噯閲�</label>
- <el-input v-model="packageInfo.standNum" placeholder="璇疯緭鍏�" size="small" @change="upNum"></el-input>
+ <el-input v-model="packageInfo.standNum" placeholder="璇疯緭鍏�" size="small" @change="upNum" :disabled="active!=1"></el-input>
</div>
<div class="search-item">
<label style="width: 70px;">妫�娴嬮噺</label>
<el-input v-model="packageInfo.testNum" placeholder="璇疯緭鍏�" size="small" @change="upNum"
- :disabled="packageInfo.radio===0"></el-input>
+ :disabled="packageInfo.radio===0||active!=1"></el-input>
</div>
</div>
<el-table ref="table0" :data="bushing" tooltip-effect="dark" style="width: 100%" height="203px" size="small"
- @selection-change="handleSelectionChange1">
- <el-table-column type="selection" width="45">
+ @selection-change="handleSelectionChange1"
+ :header-cell-class-name="setClassName0">
+ <el-table-column
+ type="selection"
+ width="45"
+ :selectable="()=>(active==1)">
</el-table-column>
<el-table-column label="绠¤壊鏍�" show-overflow-tooltip>
<template slot-scope="scope">
- <el-select v-model="scope.row.color" size="mini">
+ <el-select v-model="scope.row.color" size="mini" :disabled="active!=1">
<el-option v-for="(color,i) in colors" :key="i" :label="color.lable"
:value="color.value"></el-option>
</el-select>
@@ -74,7 +78,7 @@
@select="upProductSelect"
>
<el-table-column type="selection" width="55"
- :selectable="()=>(currentDetectionItems||this.multiFiberList.length > 0)">
+ :selectable="()=>((currentDetectionItems||this.multiFiberList.length > 0)&&active==1)">
</el-table-column>
<el-table-column label="瀹為獙瀹�" show-overflow-tooltip prop="sonLaboratory" ></el-table-column>
<el-table-column prop="inspectionItem" label="妫�楠岄」" show-overflow-tooltip>
@@ -91,7 +95,8 @@
</el-table-column>
<el-table-column prop="ask" label="妫�娴嬭姹�" show-overflow-tooltip width="200px">
<template slot-scope="scope">
- <el-input v-model="scope.row.ask" placeholder="璇疯緭鍏�" size="small"></el-input>
+ <el-input v-model="scope.row.ask" placeholder="璇疯緭鍏�" size="small" :disabled="active!=1" v-if="!isAskOnlyRead"></el-input>
+ <span v-else>{{ scope.row.ask }}</span>
</template>
</el-table-column>
</el-table>
@@ -103,15 +108,15 @@
<div class="grid-content">
<h5>鍏夌氦甯�
<el-button size="mini" type="primary" class="btns" @click="addFibers"
- :disabled="packageInfo.ismiers===false||miresModel===null||miresStandard===null">鐢熸垚鍏夌氦甯�</el-button>
- <el-button size="mini" class="btns" @click="clearFibers" :disabled="selectBushing.length === 0">娓呴櫎</el-button>
+ :disabled="packageInfo.ismiers===false||miresModel===null||miresStandard===null" v-if="active==1">鐢熸垚鍏夌氦甯�</el-button>
+ <el-button size="mini" class="btns" @click="clearFibers" :disabled="selectBushing.length === 0" v-if="active==1">娓呴櫎</el-button>
</h5>
<div
style="display: flex;align-items: center;justify-content: space-between;margin:4px 0 6px 0;padding: 0 12px;box-sizing: border-box;">
<div class="search-item" style="width: 50%;margin-right: 16px;">
<label style="width: 80px;">绾ゅ甫绫诲瀷</label>
<el-select v-model="miresModel" placeholder="璇烽�夋嫨" size="small" style="width: 100%;"
- :disabled="selectBushing.length===0">
+ :disabled="selectBushing.length===0||active!=1">
<el-option v-for="(item,a) in miresModels" :key="a" :label="item.label" :value="item.value">
</el-option>
</el-select>
@@ -119,7 +124,7 @@
<div class="search-item" style="width: 50%;">
<label style="width: 80px;">鍙傝�冩爣鍑�</label>
<el-select v-model="miresStandard" placeholder="璇烽�夋嫨" size="small" style="width: 100%;"
- :disabled="miresModel===null" @focus="selectsStandardMethodByFLSSM2()"
+ :disabled="miresModel===null||active!=1" @focus="selectsStandardMethodByFLSSM2()"
@change="(value)=>methodChange2(value)">
<el-option v-for="item in miresStandards" :key="item.id" :label="item.code" :value="item.id">
</el-option>
@@ -127,8 +132,12 @@
</div>
</div>
<el-table ref="table2" :data="fibersList" tooltip-effect="dark" style="width: 100%" height="270px"
- size="small" @selection-change="handleSelectionChange" highlight-current-row @row-click="rowClickFiber">
- <el-table-column type="selection" width="55">
+ size="small" @selection-change="handleSelectionChange" highlight-current-row @row-click="(row, column, event)=>rowClickFiber(row, column, event,0)"
+ :header-cell-class-name="setClassName0">
+ <el-table-column
+ type="selection"
+ width="55"
+ :selectable="()=>(active==1)">
</el-table-column>
<el-table-column prop="code" label="鍏夌氦甯︾紪鍙�" show-overflow-tooltip align="center">
</el-table-column>
@@ -144,13 +153,13 @@
<el-col :span="12">
<div class="grid-content">
<h5>鍏夌氦<el-button size="mini" type="primary" class="btns" @click="addFiber"
- :disabled="mireModel===null||mireStandard===null">鍏夌氦閰嶈壊</el-button></h5>
+ :disabled="mireModel===null||mireStandard===null" v-if="active==1">鍏夌氦閰嶈壊</el-button></h5>
<div
style="display: flex;align-items: center;justify-content: space-between;margin: 4px 0 6px 0;padding: 0 12px;box-sizing: border-box;">
<div class="search-item" style="width: 50%;margin-right: 16px;">
<label style="width: 80px;">鍏夌氦绫诲瀷</label>
<el-select v-model="mireModel" placeholder="璇烽�夋嫨" size="small" style="width: 100%;"
- :disabled="selectBushing.length===0">
+ :disabled="selectBushing.length===0||active!=1">
<el-option v-for="(item,a) in mireModels" :key="a" :label="item.label" :value="item.value">
</el-option>
</el-select>
@@ -158,7 +167,7 @@
<div class="search-item" style="width: 50%;">
<label style="width: 80px;">鍙傝�冩爣鍑�</label>
<el-select v-model="mireStandard" placeholder="璇烽�夋嫨" size="small" style="width: 100%;"
- :disabled="mireModel===null" @focus="selectsStandardMethodByFLSSM()"
+ :disabled="mireModel===null||active!=1" @focus="selectsStandardMethodByFLSSM()"
@change="(value)=>methodChange(value)" :loading="mireStandardLoading">
<el-option v-for="item in mireStandards" :key="item.id" :label="item.code" :value="item.id">
</el-option>
@@ -167,14 +176,18 @@
</div>
<el-table ref="table3" :data="fiberList" tooltip-effect="dark" style="width: 100%" height="270px"
size="small" highlight-current-row @selection-change="handleSelectionChange4"
- @row-click="rowClickFiber">
- <el-table-column type="selection" width="55">
+ @row-click="(row, column, event)=>rowClickFiber(row, column, event,1)"
+ :header-cell-class-name="setClassName0">
+ <el-table-column
+ type="selection"
+ width="55"
+ :selectable="()=>(active==1)">
</el-table-column>
<el-table-column prop="bushColor" label="绠″鑹叉爣" width="90" align="center">
</el-table-column>
<el-table-column prop="color" label="鍏夌氦鑹叉爣" width="120">
<template slot-scope="scope">
- <el-select v-model="scope.row.color" size="mini">
+ <el-select v-model="scope.row.color" size="mini" :disabled="active!=1">
<el-option v-for="(color,i) in colors" :key="i" :label="color.lable"
:value="color.value"></el-option>
</el-select>
@@ -194,6 +207,12 @@
<script>
export default {
+ props: {
+ active: {
+ type: Number,
+ default: () => 0
+ },
+ },
data() {
return {
saveLoad: false,
@@ -231,12 +250,13 @@
detectionItems:[],
currentDetectionItems:null,
mireStandardLoading:false,
- multiFiberList:[]
+ multiFiberList:[],
+ isAskOnlyRead:true
}
},
computed: {
isAllDisabled() {
- return this.multiFiberList.length > 0||this.currentDetectionItems
+ return this.multiFiberList.length > 0||this.currentDetectionItems||this.active!=1
},
},
watch: {
@@ -525,7 +545,22 @@
}
})
},
- rowClickFiber(row, column, event){
+ rowClickFiber(row, column, event,type){
+ if(type==0){
+ let standard = this.miresStandards.find(a => a.id == this.miresStandard)
+ if(standard&&standard.code=='濮旀墭瑕佹眰'){
+ this.isAskOnlyRead = false;
+ }else{
+ this.isAskOnlyRead = true;
+ }
+ }else{
+ let standard = this.mireStandards.find(a => a.id == this.mireStandard)
+ if(standard&&standard.code=='濮旀墭瑕佹眰'){
+ this.isAskOnlyRead = false;
+ }else{
+ this.isAskOnlyRead = true;
+ }
+ }
this.currentDetectionItems = row
this.detectionItems = row.productList
if(this.detectionItems === null) return
@@ -620,6 +655,11 @@
return 'all-disabled'
}
},
+ setClassName0({ column }){
+ if (column.type == 'selection' && this.active!=1) {
+ return 'all-disabled'
+ }
+ },
clearFibers(){
this.packageInfo.ismiers = false
this.fibersList = []
diff --git a/src/components/do/b3-work-time-management/work-time-statistics.vue b/src/components/do/b3-work-time-management/work-time-statistics.vue
index 4bf2a47..8ffa444 100644
--- a/src/components/do/b3-work-time-management/work-time-statistics.vue
+++ b/src/components/do/b3-work-time-management/work-time-statistics.vue
@@ -9,16 +9,19 @@
type="month"
format="yyyy-MM"
value-format="yyyy-MM"
- placeholder="閫夋嫨鏈�" size="small" style="width: 100%;">
+ placeholder="閫夋嫨鏈�" size="small" style="width: 100%;"
+ :clearable="false">
</el-date-picker>
</div>
</div>
<div class="search_thing">
<div class="search_label">鍛樺伐锛�</div>
- <el-select v-model="entity.name" placeholder="鍏ㄩ儴" size="small" @change="refreshTable()">
+ <!-- <el-select v-model="entity.name" placeholder="鍏ㄩ儴" size="small" @change="refreshTable()" clearable>
<el-option v-for="item in personList" :key="item.id" :label="item.name" :value="item.id">
</el-option>
- </el-select>
+ </el-select> -->
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable
+ v-model="entity.name" @keyup.enter.native="refreshTable()"></el-input>
</div>
<div class="search_thing">
<div class="search_label">閮ㄩ棬锛�</div>
@@ -51,8 +54,8 @@
<div class="table">
<ValueTable ref="ValueTable0"
v-if="currentTable == 'value0'"
- :url="$api.auxiliaryWorkingHours.selectAuxiliaryWorkingHours"
- :componentData="componentData" :inputUrl="$api.auxiliaryWorkingHours.selectAuxiliaryWorkingHours" :downUrl="$api.auxiliaryWorkingHours.selectAuxiliaryWorkingHours" :key="upIndex" />
+ :url="$api.auxiliaryOriginalHours.selectAuxiliaryOriginalHours"
+ :componentData="componentData" :downUrl="$api.auxiliaryWorkingHours.selectAuxiliaryWorkingHours" :key="upIndex" />
<ValueTable ref="ValueTable1"
v-if="currentTable == 'value1'"
:url="$api.auxiliaryCorrectionHours.selectAuxiliaryCorrectionHours"
@@ -79,10 +82,6 @@
month: getYearAndMonthAndDays().split('-')[0]+'-'+getYearAndMonthAndDays().split('-')[1],
name: null,
departLims: null,
- orderBy: {
- field: 'id',
- order: 'desc'
- }
},
isIndex: true,
showSelect: false,
@@ -94,7 +93,10 @@
requiredAdd: [],
requiredUp: [],
accept:聽'.xlsx',
- inputType:聽'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
+ inputType:聽'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ cellSpecialStyle:{
+ redColorByKey:'Hours'
+ }
},
componentData0: {
entity: {
@@ -152,6 +154,7 @@
},
refreshTable(){
let entity = {...this.entity}
+ entity.month = entity.month.split('-')[0]+'-'+entity.month.split('-')[1]
if(this.currentTable=='value0'){
this.componentData.entity = {...this.componentData.entity,...entity}
this.$refs['ValueTable0'].selectList()
diff --git a/src/components/tool/value-table.vue b/src/components/tool/value-table.vue
index 9f76c3b..127e63e 100644
--- a/src/components/tool/value-table.vue
+++ b/src/components/tool/value-table.vue
@@ -49,6 +49,9 @@
.handleBtn.is-disabled {
color: #C0C4CC;
}
+ .red{
+ color: red !important;
+ }
</style>
<style>
/* .value-table .highlight-warning-row-border td {
@@ -136,7 +139,7 @@
@click="handleLinkEvent(scope.row,data.linkEvent[a.label])">{{scope.row[a.label]}}</span>
<img style="width: 40px;height: 40px;margin-top: 10px;" :src="javaApi+'/img/'+scope.row[a.label]"
v-else-if="showUpload(a.label)&&scope.row[a.label]" alt="">
- <span v-else>{{scope.row[a.label]}}</span>
+ <span v-else :class="{red:getRedColor(a.label,scope.row)}" >{{scope.row[a.label]}}</span>
</template>
</el-table-column>
<el-table-column fixed="right" align="center" label="鎿嶄綔" :width="getWidth()" v-if="data.do.length > 0">
@@ -1094,6 +1097,13 @@
this.$message.error('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁')
}
},
+ getRedColor(label,row){
+ if(this.data.cellSpecialStyle&&this.data.cellSpecialStyle.redColorByKey&&label.includes(this.data.cellSpecialStyle.redColorByKey)&&row[(label.replace(this.data.cellSpecialStyle.redColorByKey, ""))]){
+ return true
+ }else{
+ return false
+ }
+ }
}
}
</script>
--
Gitblit v1.9.3