From 2e237ff7c40653b07431ffd58488423b3fdb525d Mon Sep 17 00:00:00 2001 From: huangli865118801 <865118801@qq.com> Date: Tue, 17 Aug 2021 15:47:59 +0800 Subject: [PATCH] ddd --- api/user.js | 41 ++- pages.json | 2 +- pages/assembleInfo/assembleInfo.vue | 4 +- pages/hardwareInfo/hardwareInfo.vue | 4 +- pages/rework/rework.vue | 22 ++ pages/sprayInfo/sprayInfo.vue | 14 +- .../stampingInspectionInfo.vue | 2 +- pages/stampingRecordList/index.scss | 4 + .../stampingRecordList/stampingRecordList.vue | 25 +- pages/stopLine/stopLine.vue | 188 +++++++++++++- pages/stopLineList/index.scss | 244 ++++++++++++++++++ pages/stopLineList/stopLineList.vue | 124 ++++++++- pages/tcqInfo/tcqInfo.vue | 8 +- 13 files changed, 642 insertions(+), 40 deletions(-) create mode 100644 pages/stopLineList/index.scss diff --git a/api/user.js b/api/user.js index 007f7a2..69c69af 100644 --- a/api/user.js +++ b/api/user.js @@ -530,7 +530,7 @@ export function putInDetail(data) { /** - * 投入统计详情 + * 不良品详情 * @param {Object} data */ export function noDetail(data) { @@ -540,4 +540,43 @@ export function noDetail(data) { method: "get", data }); +} + +/** + * 不良品详情 + * @param {Object} data + */ +export function repairDetail(data) { + console.log(data) + return request({ + url: `${functions.getDomain()}/api/repair-detail`, + method: "get", + data + }); +} + +/** + * 停线列表 + * @param {Object} data + */ +export function stopList(data) { + console.log(data) + return request({ + url: `${functions.getDomain()}/api/stop-list`, + method: "get", + data + }); +} + +/** + * 停线列表 + * @param {Object} data + */ +export function stopDetail(data) { + console.log(data) + return request({ + url: `${functions.getDomain()}/api/stop-detail`, + method: "get", + data + }); } \ No newline at end of file diff --git a/pages.json b/pages.json index d45d9c3..105eaef 100644 --- a/pages.json +++ b/pages.json @@ -233,7 +233,7 @@ "path" : "pages/stopLineList/stopLineList", "style" : { - "navigationBarTitleText": "", + "navigationBarTitleText": "停线列表", "enablePullDownRefresh": false } diff --git a/pages/assembleInfo/assembleInfo.vue b/pages/assembleInfo/assembleInfo.vue index a281f11..0dc177a 100644 --- a/pages/assembleInfo/assembleInfo.vue +++ b/pages/assembleInfo/assembleInfo.vue @@ -196,7 +196,7 @@ this.power = this.userInfo.power //this.getArr(); - if (this.CyInfo.check != 0 && this.type != 1) { + if (this.type != 1) { this.getInfo(); } bad({}).then(res => { @@ -260,7 +260,7 @@ value.situation = ''; value.input = ''; value.inputState = true; - let CheckCyMsg = this.info.CheckCyMsg ? this.info.CheckCyMsg : []; + let CheckCyMsg = this.info.CheckZzMsg ? this.info.CheckZzMsg : []; for (let b in CheckCyMsg) { if (CheckCyMsg[b].check_conf_id == value.id) { let json = JSON.parse(CheckCyMsg[b].json); diff --git a/pages/hardwareInfo/hardwareInfo.vue b/pages/hardwareInfo/hardwareInfo.vue index fe5823a..dc13525 100644 --- a/pages/hardwareInfo/hardwareInfo.vue +++ b/pages/hardwareInfo/hardwareInfo.vue @@ -218,7 +218,7 @@ this.power = this.userInfo.power //this.getArr(); - if (this.CyInfo.check != 0 && this.type != 1) { + if (this.type != 1) { this.getInfo(); } bad({}).then(res => { @@ -284,7 +284,7 @@ value.situation = ''; value.input = ''; value.inputState = true; - let CheckCyMsg = this.info.CheckCyMsg ? this.info.CheckCyMsg : []; + let CheckCyMsg = this.info.CheckWjMsg ? this.info.CheckWjMsg : []; for (let b in CheckCyMsg) { if (CheckCyMsg[b].check_conf_id == value.id) { let json = JSON.parse(CheckCyMsg[b].json); diff --git a/pages/rework/rework.vue b/pages/rework/rework.vue index 1ebc15e..161c783 100644 --- a/pages/rework/rework.vue +++ b/pages/rework/rework.vue @@ -101,6 +101,7 @@ <script> import { repair, reasonNo } from '../../api/index.js'; +import {repairDetail} from "../../api/user.js" export default { onLoad(e) { this.planInfo = JSON.parse(decodeURIComponent(e.badProduct)); @@ -108,6 +109,7 @@ export default { reasonNo({ status: 1 }).then(res => { this.reason = res; }); + this.getInfo(); }, data() { return { @@ -118,9 +120,11 @@ export default { reason: [], reasonIds: 0, buttonState:true, + ifEdit:0, froms: [ { + plan_id: 0, raw_name: '', line_id: 0, frequency: 0, @@ -133,9 +137,26 @@ export default { }; }, methods: { + getInfo(){ + repairDetail({plan_id:this.planInfo.plan_id}).then(res=>{ + if(res){ + res.map(items=>{ + console.log("不良品详情id",items.id) + this.froms.map(its=>{ + its.id=items.id + }) + }) + this.froms=res + this.ifEdit=1 + console.log("不良品详情",this.froms) + } + + }) + }, add() { this.froms.push({ raw_name: '', + plan_id: this.planInfo.plan_id, line_id: this.planInfo.line_id, frequency: 0, stamping_date: '', @@ -147,6 +168,7 @@ export default { dateChange(e, index) { this.froms[index].stamping_date = e.detail.value; }, + reasonChange(e, index) { this.froms[index].reason_no_id = e.detail.value; }, diff --git a/pages/sprayInfo/sprayInfo.vue b/pages/sprayInfo/sprayInfo.vue index 5161624..00bbf74 100644 --- a/pages/sprayInfo/sprayInfo.vue +++ b/pages/sprayInfo/sprayInfo.vue @@ -63,6 +63,7 @@ </view> </view> + <view v-for="(item, index) in configSet" :key="index"> <view class="big-title">{{ item.title }}</view> <view v-for="(value, idx) in item.check_conf_msg" :key="idx" class="cyxj-content"> @@ -135,7 +136,6 @@ <script> import { ptCheckAdd, - bad, getCheckConfSet } from '../../api/user.js'; @@ -232,7 +232,6 @@ if (!item.input) { this.configSet[index].check_conf_msg[idx].inputState = false; } else { - if (item.input < item.bottom || item.input > item.top) { this.configSet[index].check_conf_msg[idx].inputState = false; } @@ -254,6 +253,7 @@ return item; }); }); + console.log("喷涂xuanx",this.configSet) }, matchingConfig(value) { value.choice = 'OK'; @@ -261,7 +261,7 @@ value.situation = ''; value.input = ''; value.inputState = true; - let CheckCyMsg = this.info.CheckCyMsg ? this.info.CheckCyMsg : []; + let CheckCyMsg = this.info.CheckPtMsg ? this.info.CheckPtMsg : []; for (let b in CheckCyMsg) { if (CheckCyMsg[b].check_conf_id == value.id) { let json = JSON.parse(CheckCyMsg[b].json); @@ -274,6 +274,7 @@ } return value; + }, getInfo() { @@ -330,7 +331,7 @@ } this.buttonState = false; - this.$functions.confirm("是否进行此操作?").then(()=>{ + this.$functions.confirm('是否进行此操作?').then(()=>{ ptCheckAdd(this.froms).then(res => { this.$functions.success('提交成功').then(() => { uni.navigateBack(); @@ -342,7 +343,6 @@ }, applys() { - this.buttonState=false this.$functions.confirm('是否确定操作?').then(res => { ptCheckSure({ plan_id: this.info.plan_id, @@ -350,9 +350,7 @@ id:this.info.id }).then(res => { this.$functions.success('操作成功').then(() => { - uni.navigateBack().catch(res=>{ - this.buttonState=true - }); + uni.navigateBack({}); }); }); }); diff --git a/pages/stampingInspectionInfo/stampingInspectionInfo.vue b/pages/stampingInspectionInfo/stampingInspectionInfo.vue index a4e9ad9..a2dbcde 100644 --- a/pages/stampingInspectionInfo/stampingInspectionInfo.vue +++ b/pages/stampingInspectionInfo/stampingInspectionInfo.vue @@ -177,7 +177,7 @@ this.power = this.userInfo.power //this.getArr(); - if (this.CyInfo.check != 0 && this.type != 1) { + if (this.type != 1) { this.getInfo(); } bad({}).then(res => { diff --git a/pages/stampingRecordList/index.scss b/pages/stampingRecordList/index.scss index 281531a..4ae41a1 100644 --- a/pages/stampingRecordList/index.scss +++ b/pages/stampingRecordList/index.scss @@ -129,4 +129,8 @@ margin: auto; margin-top: 50upx; } +} + +.dis-btn{ + background:#C0C0C0!important; } \ No newline at end of file diff --git a/pages/stampingRecordList/stampingRecordList.vue b/pages/stampingRecordList/stampingRecordList.vue index bab75cb..ed31620 100644 --- a/pages/stampingRecordList/stampingRecordList.vue +++ b/pages/stampingRecordList/stampingRecordList.vue @@ -25,7 +25,7 @@ </view> </view> <view class="btn-grounp"> - <view v-if="item.status!=1" @tap="openLine(item.plan_id)">开线</view> + <view :class="item.status!=1?'':'dis-btn'" v-if="" @tap="openLine(item.plan_id,item)">开线</view> <view class="btn-tx" @tap="stopLine(item)">停线</view> <view v-if="item.status==1" class="btn-xx" @tap="offLine(item.plan_id)">下线</view> <view class="btn-blp" @tap="badProduct(item)">不良品统计</view> @@ -131,13 +131,20 @@ console.log("状态",e.target.value) this.froms.status = e.target.value+1 }, - openLine(plan_id){ - openLine({id:plan_id}).then(res=>{ - this.$functions.success('操作成功').then(() => { - this.getData() - }); - - }) + openLine(plan_id,item){ + if(item.status==1){ + this.$functions.error("已开线,请勿重复操作"); + return false; + } + else{ + openLine({id:plan_id}).then(res=>{ + this.$functions.success('操作成功').then(() => { + this.getData() + }); + + }) + } + }, getData(){ firstCheckLists({type:1}).then(res => { @@ -146,7 +153,7 @@ }, stopLine(item){ uni.navigateTo({ - url: `../stopLine/stopLine?planInfo=${encodeURIComponent(JSON.stringify(item))}` + url: `../stopLineList/stopLineList?planInfo=${encodeURIComponent(JSON.stringify(item))}` }); }, offLine(plan_id){ diff --git a/pages/stopLine/stopLine.vue b/pages/stopLine/stopLine.vue index 615f98c..c740ab7 100644 --- a/pages/stopLine/stopLine.vue +++ b/pages/stopLine/stopLine.vue @@ -20,7 +20,7 @@ <!-- <image class="next" src="../../static/next.png"></image> --> </view> </view> - <picker @change="bindline" :value="froms.frequency" :range="line"> + <picker @change="bindline" v-if="ifEdit==0" :value="froms.frequency" :range="line"> <view class="list-list"> <view class="list-title">班次</view> <view class="list-right"> @@ -29,8 +29,14 @@ </view> </view> </picker> + <view class="list-list" v-if="ifEdit==1" > + <view class="list-title">班次</view> + <view class="list-right" v-if="stopInfo.data.frequency"> + <text>{{stopInfo.data.frequency==0?'夜班':'白班'}}</text> + </view> + </view> </view> - <view class="white-card" style="margin-top: 30upx;"> + <view class="white-card" v-if="ifEdit==0" style="margin-top: 30upx;"> <picker @change="bindReason($event,reason)" :value="reasonIds" :range="reason" :range-key="'item'"> <view class="list-list"> <view class="list-title">停线原因</view> @@ -41,8 +47,19 @@ </view> </picker> </view> - <view class="big-titlt" v-if="crrentReson=='设备维修'">设备维修</view> - <view class="white-card" v-if="crrentReson=='设备维修'"> + <!-- 详情 --> + <view class="white-card" v-if="ifEdit==1" style="margin-top: 30upx;"> + <view class="list-list"> + <view class="list-title">停线原因</view> + <view class="list-right"> + <text >{{infoResonArr[0]?infoResonArr[0].item:''}}</text> + </view> + </view> + </view> + <!-- 详情 --> + <view class="big-titlt" v-if="crrentReson=='设备维修'&&ifEdit==0">设备维修</view> + <view class="big-titlt" v-if="infoResonId=='2'&&ifEdit==1">设备维修</view> + <view class="white-card" v-if="crrentReson=='设备维修'&&ifEdit==0"> <picker @change="bindmouldIds($event,deviceNo)" :value="devIds" :range-key="'name'" :range="deviceNo"> <view class="list-list"> <view class="list-title">设备编号</view> @@ -98,8 +115,54 @@ <textarea value="" v-model="froms.device[0].remark" placeholder="备注情况说明" /> </view> </view> - <view class="big-titlt" v-if="crrentReson=='模具维修'">模具维修</view> - <view class="white-card" v-if="crrentReson=='模具维修'"> + <!-- 详情 --> + <view class="white-card" v-if="infoResonId=='2'&&ifEdit==1"> + <view class="list-list"> + <view class="list-title">设备编号</view> + <view class="list-right"> + <text>{{infoDev[0]?infoDev[0].name:""}}</text> + </view> + </view> + <view class="list-list"> + <view class="list-title">异常现象</view> + <view class="list-right"> + <text>{{stopInfo.device[0]?stopInfo.device[0].unusual_phenomenon:''}}</text> + </view> + </view> + <view class="list-list"> + <view class="list-title">原因分析</view> + <view class="list-right"> + <text>{{stopInfo.device[0]?stopInfo.device[0].cause_analysis:''}}</text> + </view> + </view> + + <view class="list-list"> + <view class="list-title">维修描述</view> + <view class="list-right"> + <text>{{stopInfo.device[0]?stopInfo.device[0].repair_description:''}}</text> + </view> + </view> + + <!-- <view class="list-list"> + <view class="list-title">维修时长</view> + <view class="list-right"> + <input placeholder="请输入维修时长" v-model="froms.device[0].repair_time" /> + </view> + </view> --> + <view class="list-list"> + <view class="list-title">维修人员</view> + <view class="list-right"> + <text>{{infoStaff[0]?infoStaff[0].name:''}}</text> + </view> + </view> + <view class="bzqk-card"> + <textarea disabled='true' v-model="stopInfo.device[0].remark" placeholder="备注情况说明" /> + </view> + </view> + <!-- 详情 --> + <view class="big-titlt" v-if="crrentReson=='模具维修'&&ifEdit==0">模具维修</view> + <view class="big-titlt" v-if="infoResonId=='3'&&ifEdit==1">模具维修</view> + <view class="white-card" v-if="crrentReson=='模具维修'&&ifEdit==0"> <picker @change="bindmodeIds($event,mould)" :value="modeIds" :range="mould" :range-key="'title'"> <view class="list-list"> <view class="list-title">模具编号</view> @@ -152,7 +215,52 @@ </view> </picker> </view> - <view class="white-card" v-if="crrentReson!='设备维修'&&crrentReson!='模具维修'"> + <!-- 模具详情 --> + <view class="white-card" v-if="infoResonId=='3'&&ifEdit==1"> + <view class="list-list"> + <view class="list-title">模具编号</view> + <view class="list-right"> + <text>{{infoMode[0]?infoMode[0].title:""}}</text> + </view> + </view> + + <view class="list-list"> + <view class="list-title">异常现象</view> + <view class="list-right"> + <text>{{stopInfo.mode[0]?stopInfo.mode[0].unusual_phenomenon:''}}</text> + </view> + </view> + <view class="list-list"> + <view class="list-title">原因分析</view> + <view class="list-right"> + <text>{{stopInfo.mode[0]?stopInfo.mode[0].cause_analysis:''}}</text> + </view> + </view> + + <view class="list-list"> + <view class="list-title">维修描述</view> + <view class="list-right"> + <text>{{stopInfo.mode[0]?stopInfo.mode[0].repair_description:''}}</text> + </view> + </view> + + <!-- <view class="list-list"> + <view class="list-title">维修时长</view> + <view class="list-right"> + <input placeholder="请输入维修时长" v-model="froms.mode[0].repair_time" /> + </view> + </view> --> + <view class="list-list"> + <view class="list-title">维修人员</view> + <view class="list-right"> + <text>{{infoStaff[0]?infoStaff[0].name:''}}</text> + </view> + </view> + <view class="bzqk-card"> + <textarea disabled='true' v-model="stopInfo.mode[0].remark" placeholder="备注情况说明" /> + </view> + </view> + <view class="white-card" v-if="crrentReson!='设备维修'&&crrentReson!='模具维修'&&ifEdit==0"> <view class="list-list" style="align-items: flex-start;"> <view class="list-title" style="padding-top: 30upx;">情况描述</view> <view class="list-right" style="border: 1upx solid #F1F1F1;font-size: 26upx;"> @@ -160,13 +268,22 @@ </view> </view> </view> + <!-- 详情 --> + <view class="white-card" v-if="infoResonId!='2'&&infoResonId!='3'&&ifEdit==1"> + <view class="list-list" style="align-items: flex-start;"> + <view class="list-title" style="padding-top: 30upx;">情况描述</view> + <view class="list-right" style="border: 1upx solid #F1F1F1;font-size: 26upx;"> + <textarea style="font-size: 26upx;text-indent:30upx;padding-top: 30upx;" disabled="true" placeholder="请输入情况描述" v-model="stopInfo.data.remake" /> + </view> + </view> + </view> <!-- <view class="white-card"> <view class="bzqk-card"> <textarea value="" placeholder="备注" v-model="froms.remake" /> </view> </view> --> - <view class="submit-btn"> + <view class="submit-btn" v-if="ifEdit==0"> <button type="primary" :disabled="buttonState==false?true:false" @tap="stopLine()">提交</button> </view> </view> @@ -179,7 +296,8 @@ mode, stopRecord, dictionary, - staff + staff, + stopDetail } from "../../api/user.js" export default { data() { @@ -216,11 +334,14 @@ modestaffList:[], modestaffIdx:0, buttonState:true, + ifEdit:0, + stopId:'', froms: { plan_id: "", frequency: '1', reason_id: 0, remake: '', + device: [{ device_id: 1, unusual_phenomenon: '', @@ -240,12 +361,21 @@ remark: '' }], }, + stopInfo:{}, + infoResonId:'', + infoResonArr:[], + infoDev:[], + infoStaff:[], + infoMode:[] }; }, onLoad(e) { this.getReson(); this.getDevice(); this.getMode() + if(e.id){ + this.stopId=e.id + } this.CyInfo = JSON.parse(decodeURIComponent(e.planInfo)); this.froms.plan_id = this.CyInfo.plan_id; this.crrentReson="设备维修" @@ -257,8 +387,47 @@ this.getModeRepairDescription() this.getStaff(); this.getModeYyfx(); + if(this.stopId){ + this.getInfo() + } }, methods: { + getInfo(){ + stopDetail({id:this.stopId}).then(res=>{ + if(res){ + // res.map(items=>{ + // console.log("停线id",items.id) + // this.froms.map(its=>{ + // its.id=items.id + // }) + // }) + // this.froms=res + this.stopInfo=res + this.infoResonId=this.stopInfo.data.reason_id + this.infoResonArr=this.reason.filter(item=>item.id==this.infoResonId) + this.ifEdit=1 + + + let infoStffid='' + if(this.stopInfo.device.length>0){ + let devId=this.stopInfo.device[0].device_id + let infoStffid=this.stopInfo.device[0].repair_staff + + this.infoDev=this.deviceNo.filter(item=>item.id==devId) + this.infoStaff=this.staffList.filter(item=>item.id==infoStffid) + } + if(this.stopInfo.mode.length>0){ + let infoStffid=this.stopInfo.mode[0].repair_staff + let modeIdInfo=this.stopInfo.mode[0].mode_id + this.infoMode=this.mould.filter(item=>item.id=modeIdInfo) + this.infoStaff=this.staffList.filter(item=>item.id==infoStffid) + } + + + } + + }) + }, getStaff(){ staff().then(res=>{ this.staffList=res; @@ -386,6 +555,7 @@ let list2 = f1('id', arr2) let newArr = mergeArr(getMaxArr(arr1, arr2), list2) this.reason=newArr + console.log("停线原因", this.reason) }) diff --git a/pages/stopLineList/index.scss b/pages/stopLineList/index.scss new file mode 100644 index 0000000..bb104db --- /dev/null +++ b/pages/stopLineList/index.scss @@ -0,0 +1,244 @@ + +.sm-box{ + @include wh(750upx,auto); + padding-top: 30upx; + padding-bottom: 30upx; + background: white; + .card{ + @include wh(710upx,auto); + margin: auto; + border: 1upx solid #F1F1F1; + padding-top: 30upx; + padding-bottom: 30upx; + .title{ + width: 690upx; + margin: auto; + @include fonts(26upx,#666,bold); + } + .content{ + width: 690upx; + margin: auto; + @include fonts(24upx,#999); + } + } + .content-box-card{ + width: 690upx; + margin: auto; + + .content-box-card-ul{ + @include flex(flex-start,flex-start); + .content-box-card-list{ + @include flex(flex-start,flex-start); + margin-top: 24upx; + .content-box-card-title{ + width: 140upx; + @include fonts(26upx,#333,bold); + } + text{ + @include fonts(24upx,#999); + } + .right-check{ + width: 500upx; + @include flex(flex-start,flex-start); + flex-wrap: wrap; + + .check-list{ + //width: 240upx; + + @include flex(center,flex-start); + margin-left: 24upx; + image{ + @include wh(33upx,33upx); + } + text{ + @include fonts(24upx,#999); + margin-left: 10upx; + } + } + .other-input{ + @include wh(240upx,50upx); + @include flex(center,center); + border: 1upx solid #F1F1F1; + border-radius: 4upx; + margin-left: 24upx; + input{ + font-size: 26upx; + margin-left: 20upx; + } + } + } + } + + } + .content-box-card-ul-two{ + @include flex(flex-start,flex-start); + .content-box-card-list{ + width: 345upx; + @include flex(flex-start,flex-start); + margin-top: 24upx; + .content-box-card-title{ + width: 140upx; + @include fonts(24upx,#333,bold); + } + text{ + @include fonts(24upx,#999); + } + .lin-div{ + @include wh(140upx,50upx); + line-height: 50upx; + border: 1upx solid #F1F1F1; + border-radius: 5upx; + @include flex(center,space-around); + text{ + @include fonts(24upx,#999); + } + image{ + @include wh(22upx,14upx); + } + } + } + + } + .sj-card{ + width: 630upx; + margin: auto; + border: 1upx solid #F1F1F1; + padding: 30upx; + margin-top: 30upx; + .sj-title{ + @include fonts(26upx,#333,bold); + } + .sj-nav{ + @include flex(flex-start,space-between); + .left{ + view{ + @include fonts(24upx,#999); + margin-top: 60upx; + } + } + .right{ + width: 500upx; + @include flex(center,space-between); + .right-list{ + text-align: center; + .num-div{ + @include fonts(24upx,#999); + } + .gg-div{ + width: 100upx; + height: 50upx; + @include flex(center,center); + border: 1upx solid #F1F1F1; + margin-top: 24upx; + input{ + font-size: 24upx; + text-align: center; + } + } + } + } + } + } + .beizhu{ + width: 630upx; + margin: auto; + border: 1upx solid #F1F1F1; + padding: 30upx; + margin-top: 30upx; + textarea{ + font-size: 24upx; + height: 200upx; + } + } + } +} + +.white-card{ + @include wh(750upx,auto); + padding-top: 30upx; + padding-bottom: 30upx; + background: white; + //margin-top: 24upx; + .lists{ + @include wh(710upx,auto); + margin: auto; + border-bottom: 1upx solid #C8C7CC; + padding-bottom: 30upx; + @include flex(flex-start,space-between); + .list-left{ + @include wh(660upx,auto); + .list-left-up{ + @include flex(center,flex-start); + .list-left-up-left{ + width: 240upx; + @include fonts(24upx,#333,bold); + } + .list-left-up-mid{ + width:370upx; + @include fonts(24upx,#333,bold); + } + .list-left-up-right-ok{ + @include wh(60upx,60upx); + border: 1upx solid #4CD964; + border-radius: 50%; + line-height: 60upx; + text-align: center; + @include fonts(24upx, #4CD964,bold); + } + .list-left-up-right-no{ + @include wh(60upx,60upx); + border: 1upx solid red; + border-radius: 50%; + line-height: 60upx; + text-align: center; + @include fonts(24upx,red,bold); + } + } + .list-left-dow{ + @include flex(center,space-between); + margin-top: 30upx; + .list-left-dow-left{ + + @include fonts(24upx,#333,bold); + } + .list-left-dow-btn{ + + @include flex(center,space-between); + view{ + @include wh(160upx,44upx); + background: #4CD964; + @include fonts(24upx,#fff,500); + text-align: center; + line-height: 44upx; + border-radius: 10upx; + } + .red{ + background: #DD524D!important; + } + } + } + } + .list-right{ + @include wh(40upx,40upx); + border: 1upx solid #007AFF; + border-radius: 50%; + line-height: 40upx; + text-align: center; + @include fonts(24upx, #007AFF,bold); + } + .mj-color{ + @include wh(40upx,40upx); + border: 1upx solid #F0AD4E; + border-radius: 50%; + line-height: 40upx; + text-align: center; + @include fonts(24upx, #F0AD4E,bold); + } + } +} + +.submit-btn{ + @include wh(690upx,auto); + margin: auto; + margin-top: 60upx; +} \ No newline at end of file diff --git a/pages/stopLineList/stopLineList.vue b/pages/stopLineList/stopLineList.vue index 8c3b35f..0f9a9f3 100644 --- a/pages/stopLineList/stopLineList.vue +++ b/pages/stopLineList/stopLineList.vue @@ -1,19 +1,137 @@ <template> <view> - + <view class="sm-box"> + <view class="content-box-card"> + <view class="content-box-card-ul-two"> + <view class="content-box-card-list"> + <view class="content-box-card-title">物料编号:</view> + <text>{{ CyInfo.product_number }}</text> + </view> + </view> + <view class="content-box-card-ul-two"> + <view class="content-box-card-list"> + <view class="content-box-card-title">生产线:</view> + <text>{{ CyInfo.line_title }}</text> + </view> + <view class="content-box-card-list"> + <view class="content-box-card-title">物料名称:</view> + <text>{{ CyInfo.product_name }}</text> + </view> + </view> + </view> + </view> + <view class="big-title"> + 停线记录 + </view> + <view class="white-card"> + <view class="lists" v-for="(item,index) in list" :key="index"> + <view class="list-left"> + <view class="list-left-up"> + <view class="list-left-up-left">班次:{{item.frequency==0?'夜班':'白班'}}</view> + <view class="list-left-up-mid">停线原因:{{item.reason}}</view> + </view> + <view class="list-left-dow"> + <view class="list-left-dow-left">产线状态:{{item.status==0?'已停线':'已恢复开线'}}</view> + <view class="list-left-dow-btn"> + <view @tap="editRecord(item.id)"> + 查看详情 + </view> + </view> + </view> + </view> + </view> + <view class="submit-btn"> + <button type="primary" @tap="addRecord()">新增停线记录</button> + </view> + </view> </view> </template> <script> + import { + stopList + } from "../../api/user.js" + import { + mapGetters, + mapMutations + } from 'vuex'; export default { data() { return { - + plan_id: '', + CyInfo: {}, + info: {}, + power: [], + jurisdiction: [], + product_id:0, + list: [], + limit: 10, + page: 1 }; + }, + computed: { + ...mapGetters(['userInfo', 'roleType']) + + }, + onShow() { + this.getData() + }, + onLoad(e) { + + this.CyInfo = JSON.parse(decodeURIComponent(e.planInfo)); + this.plan_id = this.CyInfo.plan_id; + this.product_id=this.CyInfo.product_id; + this.power = this.userInfo.power + this.getArr(); + this.isMenu(); + }, + methods: { + getArr() { + let newArr = this.power.map(item => { + if (item.children) { + + item.children.map(items => { + this.jurisdiction.push(items.title) + return items + }) + } + + }) + console.log("xinshuzu", this.jurisdiction) + }, + isMenu(title) { + return this.jurisdiction.includes(title); + }, + getData() { + let param = { + plan_id: this.plan_id, + }; + stopList(param).then(res => { + // this.info = res, + this.list = res; + console.log("详情", res) + }) + }, + addRecord() { + uni.navigateTo({ + url: `../stopLine/stopLine?plan_id=${this.plan_id}&type=1&planInfo=${encodeURIComponent(JSON.stringify(this.CyInfo))}`, + success: res => {}, + fail: () => {}, + complete: () => {} + }); + }, + editRecord(id) { + uni.navigateTo({ + url: `../stopLine/stopLine?plan_id=${this.plan_id}&type=1&id=${id}&planInfo=${encodeURIComponent(JSON.stringify(this.CyInfo))}`, + success: res => {}, + fail: () => {}, + complete: () => {} + }); + }, } } </script> <style lang="scss"> - + @import "./index.scss" </style> diff --git a/pages/tcqInfo/tcqInfo.vue b/pages/tcqInfo/tcqInfo.vue index a76faaa..1365d21 100644 --- a/pages/tcqInfo/tcqInfo.vue +++ b/pages/tcqInfo/tcqInfo.vue @@ -138,6 +138,7 @@ tcqCheckDetail, bad, getCheckConfSet, + productTcqConf, tcqCheckSure } from '../../api/user.js'; import { @@ -193,7 +194,7 @@ this.power = this.userInfo.power this.getArr(); - if (this.CyInfo.check != 0 && this.type != 1) { + if (this.type != 1) { this.getInfo(); } bad({}).then(res => { @@ -237,8 +238,7 @@ } }, getConfig() { - getCheckConfSet({ - type: 1, + productTcqConf({ product_id: this.CyInfo.product_id }).then(res => { this.configSet = res.map(item => { @@ -256,7 +256,7 @@ value.situation = ''; value.input = ''; value.inputState = true; - let CheckCyMsg = this.info.CheckCyMsg ? this.info.CheckCyMsg : []; + let CheckCyMsg = this.info.CheckTcqMsg ? this.info.CheckTcqMsg : []; for (let b in CheckCyMsg) { if (CheckCyMsg[b].check_tcq_id == value.id) { let json = JSON.parse(CheckCyMsg[b].json);