| | |
| | | <script type="text/javascript" src="../../js/axios.min.js"></script> |
| | | <script type="text/javascript" src="../../js/http.js"></script> |
| | | |
| | | <script type="text/javascript" src="../../js/common.js"></script> |
| | | |
| | | <link rel="stylesheet" href="../css/global.css" type="text/css" charset="utf-8" /> |
| | | <script type="text/javascript" src="../../js/global.js"></script> |
| | | |
| | | <!-- <link rel="stylesheet" href="../../css/global.css" type="text/css" charset="utf-8" /> --> |
| | | |
| | | <script type="text/javascript"> |
| | | var topContent = [ |
| | | // { |
| | | // code: 'SB001', |
| | | // name: '电池组一线', |
| | | // wksp_code: "CJ002", |
| | | // wksp_name: '电池车间', |
| | | // eapmai_code: "bybz004", |
| | | // eapmai_name: "标准4", |
| | | // main_cycle: "M", |
| | | // }, |
| | | // { |
| | | // code: 'SB003', |
| | | // name: '齿轮箱组一线', |
| | | // wksp_code: "CJ001", |
| | | // "wksp_name": "装配车间", |
| | | // "eapmai_code": "bybz003", |
| | | // "eapmai_name": "标准名称3", |
| | | // "main_cycle": "M" |
| | | // }, |
| | | ]; |
| | | |
| | | var centerContent = [ |
| | | // { |
| | | // "seq": 1, |
| | | // "code": "bwbm004", |
| | | // "name": "部位名称4", |
| | | // "chk_desc": "", |
| | | // "isscan": "N", |
| | | // "main_cycle": "M" |
| | | // }, |
| | | // { |
| | | // "seq": 2, |
| | | // "code": "bwbm002", |
| | | // "name": "部位名称2", |
| | | // "chk_desc": "", |
| | | // "isscan": "N", |
| | | // "main_cycle": "M" |
| | | // } |
| | | ] |
| | | |
| | | |
| | | let radioValue = '' //单选框选中的项 |
| | | |
| | | let resultValue = '' //点检结果 |
| | | |
| | | let dropdownValue = 'M' //下拉默认选中的值 |
| | | |
| | | let bwcode = '' //点击部位的扫描框 点检项目code |
| | | |
| | | let number = [] //保养项目内容 假数组 做扫码回来视图更新用 |
| | | |
| | | // 扫描保养工位返回时执行方法 |
| | | function scaned(r) { |
| | | let flag = false |
| | | topContent.forEach((item, index) => { |
| | | if (item.code === r) { |
| | | flag = true |
| | | } |
| | | }) |
| | | if (flag) { |
| | | vant.Notify({ |
| | | type: 'danger', |
| | | message: '此条码已扫描,已在列表中!' |
| | | }); |
| | | } else { |
| | | get('AppDeviceManage/RepairScanDeviceQrCodeData', { |
| | | eqpcode: r |
| | | }).then(res => { |
| | | if (res.code === '200' && res.data[0].eqpchkmain_code !== null) { |
| | | topContent.unshift(res.data[0]) |
| | | topContentClcik(topContent[0].code) |
| | | } |
| | | |
| | | if (res.code === '200' && res.data[0].eqpchkmain_code === null) { |
| | | vant.Notify({ |
| | | type: 'danger', |
| | | message: '当前设备未设置保养标准绑定点检项目!' |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | // 扫描保养项目内容返回时执行方法 |
| | | function scaned2(r) { |
| | | if (bwcode === r) { |
| | | centerContent.forEach(item => { |
| | | if (item.code === bwcode) { |
| | | item.isDisabled = false |
| | | item.isOK = 'OK' |
| | | |
| | | |
| | | if (centerContent.every(r => r.isOK === 'OK')) { |
| | | resultValue = 'OK' |
| | | } |
| | | if (centerContent.some(r => r.isOK === 'NG')) { |
| | | resultValue = 'NG' |
| | | } |
| | | if (centerContent.some(r => r.isOK === '')) { |
| | | resultValue = '' |
| | | } |
| | | |
| | | |
| | | number.push({ |
| | | id: '1' |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | vant.Notify({ |
| | | type: 'danger', |
| | | message: '扫描的二维码未与此点检项目相匹配!' |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | function topContentClcik(code) { |
| | | radioValue = code |
| | | get('AppDeviceManage/RepairSelectScanDeviceQrCodeItem', { |
| | | eqpcode: code |
| | | }).then(res => { |
| | | if (res.code === '200') { |
| | | |
| | | dropdownValue = topContent.find(r => r.code === topContent[0].code).main_cycle |
| | | |
| | | centerContent = res.data |
| | | centerContent = JSON.parse(JSON.stringify(centerContent)) |
| | | centerContent.forEach(item => { |
| | | item.isDisabled = item.isscan === 'Y' |
| | | item.inputValue = '' |
| | | item.isOK = item.isscan !== 'Y' ? 'OK' : '' |
| | | }) |
| | | if (centerContent.every(r => r.isOK === 'OK')) { |
| | | resultValue = 'OK' |
| | | } |
| | | if (centerContent.some(r => r.isOK === 'NG')) { |
| | | resultValue = 'NG' |
| | | } |
| | | if (centerContent.some(r => r.isOK === '')) { |
| | | resultValue = '' |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | </script> |
| | | </head> |
| | | <!-- <body onload="loadNodes()"> --> |
| | | <body> |
| | | <div id="app"> |
| | | |
| | |
| | | </template> |
| | | </van-nav-bar> |
| | | |
| | | |
| | | <div class="head"> |
| | | <div class="head_block"> |
| | | <div class="head_left"> |
| | | <div class="head_bar"></div> |
| | | <div class="head_title"> |
| | | 扫描保养工位 |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="margin-right: 10px;"> |
| | | <van-icon name="scan" color='red' size='24' @click='topScanClick()' /> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="flex_between" style=""> |
| | | <div id="contentLeft" style="width: 100%;margin-top: 10px;"> |
| | | <div id="topContentID" v-for="item in topContent" :key="item.code" |
| | | style="margin-bottom: 10px;margin-left: 20px;" @click="topContentClcik(item.code)"> |
| | | <div style="display: flex;align-items: center;"> |
| | | <div> |
| | | <div>工位编码:</div> |
| | | <div>工位名称:</div> |
| | | <div>生产车间:</div> |
| | | </div> |
| | | <div> |
| | | <div>{{item.code}}</div> |
| | | <div>{{item.name}}</div> |
| | | <div>{{item.wksp_name}}</div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <div id="contentRight"> |
| | | <van-radio-group v-model="radioValue" style="padding-right: 12px;"> |
| | | <van-radio checked-color='red' icon-size="18px" |
| | | style="height: 63px;margin-bottom: 10px;" v-for="item in topContent" |
| | | :key="item.code" :name="item.code"></van-radio> |
| | | </van-radio-group> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="head" |
| | | :style="{marginTop:topContent.length===0?'100px':'0',minHeight:topContent.length===0?'0':'220px'}" |
| | | style="margin-bottom: 130px;padding-bottom: 10px;overflow-y: ;" |
| | | :style="{marginTop:topContent.length===0?'78px':'0'}"> |
| | | <div class="head_block" style="margin-bottom:10px;"> |
| | | <div class="head_left"> |
| | | <div class="head_bar"></div> |
| | | <div class="head_title"> |
| | | 保养项目内容 |
| | | </div> |
| | | </div> |
| | | <div style="margin-right: 10px;"> |
| | | |
| | | <van-button @click="sheetFlag=true" type="info" style="width:20px;height: 30px;"> |
| | | {{dropdownValue==='M'?'月':'年'}} |
| | | </van-button> |
| | | <van-action-sheet v-model="sheetFlag" :actions="actionsSheet" @select="onSelectSheet" /> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="center_border flex_column" style="margin: 5px;" v-for="item in centerContent" |
| | | :key="item.code"> |
| | | <div class="flex_between"> |
| | | <div class="center_title">{{item.name}}</div> |
| | | <div style="margin-right: 10px;" v-if="item.isscan==='Y'"> |
| | | <van-icon name="scan" color='red' size='24' @click='centerScanClick(item.code)' /> |
| | | </div> |
| | | </div> |
| | | <div class="flex_between "> |
| | | <div class='flex_between' style="width: 90%;"> |
| | | <van-field class="vanFieldInput" @blur="vanFieldBlur()" :disabled="item.isDisabled" |
| | | v-model="item.inputValue" placeholder="请输入" /> |
| | | </div> |
| | | |
| | | |
| | | <div class="" style="width: 40%;display: flex;justify-content: space-around;"> |
| | | <van-button class="buttonSmall" :disabled='item.isDisabled' size="small" |
| | | :plain="item.isOK!=='OK'" @click="bwClick(item,'OK')" type="primary">正常</van-button> |
| | | <van-button class="buttonSmall" size="small" :plain="item.isOK!=='NG'" |
| | | @click="bwClick(item,'NG')" :disabled='item.isDisabled' type="danger">异常 |
| | | </van-button> |
| | | </div> |
| | | </div> |
| | | <div style="font-weight: lighter;font-size: 14px;padding-right: 5px"> |
| | | {{item.chk_desc}} |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | |
| | | <div style=""> |
| | | <div class="footer"> |
| | | <div class="head_block" style="margin-bottom: 20rpx;align-items: center;"> |
| | | <div class="head_left"> |
| | | <div class="head_bar"></div> |
| | | <div class="head_title"> |
| | | 保养结果 |
| | | </div> |
| | | </div> |
| | | <div class="flex_center" style="width: 30%;display: flex;justify-content: space-around;"> |
| | | |
| | | <van-button class="buttonSmall" |
| | | :disabled="centerContent.some(item=>item.isDisabled===true)||centerContent.length===0" |
| | | size="small" :plain="resultValue!=='OK'" @click="resultClick('OK')" type="primary"> |
| | | 正常</van-button> |
| | | <van-button class="buttonSmall" size="small" :plain="resultValue!=='NG'" |
| | | :disabled="centerContent.some(item=>item.isDisabled===true)||centerContent.length===0" |
| | | @click="resultClick('NG')" type="danger">异常</van-button> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div |
| | | style="position:fixed;bottom: 0;width: 96%;display: flex;justify-content: center;flex-direction: column;align-items: center"> |
| | | <van-button class="vanButtonInfo" :disabled="resultValue===''" @click="submit" type="info"> |
| | | 确认提交</van-button> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | |
| | | <van-overlay :show="overlayShow" @click="overlayShow=false" /> |
| | | |
| | |
| | | icon: 'revoke', |
| | | text: '退出登录' |
| | | }], |
| | | actionsSheet: [{ |
| | | code: 'Y', |
| | | name: '年' |
| | | }, { |
| | | code: 'M', |
| | | name: '月' |
| | | }], |
| | | topContent2: topContent, |
| | | centerContent2: centerContent, |
| | | number2: number, |
| | | |
| | | sheetFlag: false, |
| | | } |
| | | }, |
| | | watch: { |
| | | 'topContent2.length': { |
| | | handler(newValue, oldValue) { |
| | | if (newValue !== oldValue) { |
| | | // this.topContent2 = topContent |
| | | // this.$forceUpdate() |
| | | if (topContent[0] && topContent[0].code) { |
| | | this.$forceUpdate() |
| | | this.topContentClcik(topContent[0].code) |
| | | } |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | deep: true, |
| | | immediate: true, |
| | | }, |
| | | |
| | | // 'topContent.length': { |
| | | // handler(newValue, oldValue) { |
| | | // if (newValue !== oldValue) { |
| | | // this.$forceUpdate() |
| | | // // if (topContent[0]&&topContent[0].code) { |
| | | // // this.$forceUpdate() |
| | | // // this.topContentClcik(topContent[0].code) |
| | | // // } |
| | | // } |
| | | // }, |
| | | // deep: true, |
| | | // immediate: true, |
| | | // }, |
| | | 'number2.length': { |
| | | handler(newValue, oldValue) { |
| | | this.$forceUpdate() |
| | | }, |
| | | deep: true, |
| | | immediate: true, |
| | | }, |
| | | // 'number.length': { |
| | | // handler(newValue, oldValue) { |
| | | // this.$forceUpdate() |
| | | // }, |
| | | // deep: true, |
| | | // immediate: true, |
| | | // }, |
| | | }, |
| | | created() {}, |
| | | mounted() { |
| | | // dropdownValue = topContent.find(r => r.code === 'SB001').main_cycle |
| | | |
| | | }, |
| | | methods: { |
| | | onSelectSheet(val) { |
| | | dropdownValue = val |
| | | this.$forceUpdate() |
| | | this.sheetFlag = false |
| | | }, |
| | | submit() { |
| | | let children = [] |
| | | centerContent.forEach(item => { |
| | | children.push({ |
| | | seq: item.seq, |
| | | itemcode: item.code, |
| | | cycle: item.main_cycle, |
| | | value: item.inputValue, |
| | | result: item.isOK |
| | | }) |
| | | }) |
| | | const data = { |
| | | code: radioValue, |
| | | name: topContent.find(r => r.code === radioValue).name, |
| | | standcode: topContent.find(r => r.code === radioValue).eapmai_code, |
| | | result: resultValue, |
| | | children: children |
| | | } |
| | | |
| | | console.log(data, 1) |
| | | |
| | | const params = { |
| | | username: localStorage.getItem('username'), |
| | | maintcyc: dropdownValue |
| | | } |
| | | |
| | | // vant.Notify(JSON.stringify(params)) |
| | | // vant.Toast(JSON.stringify(data)) |
| | | post('AppDeviceManage/AppDeviceRepairSave' + formatParams(params), data) |
| | | .then(res => { |
| | | if (res.code === '200') { |
| | | vant.Notify({ |
| | | type: 'primary', |
| | | message: '提交成功!' |
| | | }) |
| | | topContent.forEach((r, i) => { |
| | | if (r.code === radioValue) { |
| | | topContent.splice(i, 1) |
| | | } |
| | | }) |
| | | if (topContent.length >= 1) { |
| | | radioValue = topContent[0].code |
| | | this.topContentClcik(radioValue) |
| | | } else { |
| | | centerContent = [] |
| | | } |
| | | resultValue = '' |
| | | this.$forceUpdate() |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | // 输入框失焦触发事件 |
| | | vanFieldBlur() { |
| | | this.$forceUpdate() |
| | | }, |
| | | topContentClcik(code) { |
| | | radioValue = code |
| | | this.$forceUpdate() |
| | | get('AppDeviceManage/RepairSelectScanDeviceQrCodeItem', { |
| | | eqpcode: code |
| | | }).then(res => { |
| | | if (res.code === '200') { |
| | | |
| | | dropdownValue = topContent.find(r => r.code === code).main_cycle |
| | | |
| | | centerContent = res.data |
| | | centerContent.forEach(item => { |
| | | item.isDisabled = item.isscan === 'Y' |
| | | item.inputValue = '' |
| | | item.isOK = item.isscan !== 'Y' ? 'OK' : '' |
| | | }) |
| | | if (centerContent.every(r => r.isOK === 'OK')) { |
| | | resultValue = 'OK' |
| | | } |
| | | if (centerContent.some(r => r.isOK === 'NG')) { |
| | | resultValue = 'NG' |
| | | } |
| | | if (centerContent.some(r => r.isOK === '')) { |
| | | resultValue = '' |
| | | } |
| | | |
| | | this.$forceUpdate() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | resultClick(val) { |
| | | resultValue = val |
| | | this.$forceUpdate() |
| | | }, |
| | | |
| | | selected(id) { |
| | | alert(id) |
| | | }, |
| | | |
| | | // 扫描保养工位扫描 |
| | | topScanClick() { |
| | | createWithoutTitle('../../components/barcode_scan.html', { |
| | | titleNView: { |
| | | type: 'float', |
| | | backgroundColor: 'rgba(215,75,40,0.3)', |
| | | titleText: '扫一扫', |
| | | titleColor: '#FFFFFF', |
| | | autoBackButton: true, |
| | | buttons: [{ |
| | | fontSrc: '_www/helloh5.ttf', |
| | | text: '\ue302', |
| | | fontSize: '18px', |
| | | onclick: 'javascript:scanPicture()' |
| | | }] |
| | | } |
| | | }); |
| | | }, |
| | | // 保养项目内容扫描 |
| | | centerScanClick(code) { |
| | | bwcode = code |
| | | createWithoutTitle('../../components/barcode_scan2.html', { |
| | | titleNView: { |
| | | type: 'float', |
| | | backgroundColor: 'rgba(215,75,40,0.3)', |
| | | titleText: '扫一扫', |
| | | titleColor: '#FFFFFF', |
| | | autoBackButton: true, |
| | | buttons: [{ |
| | | fontSrc: '_www/helloh5.ttf', |
| | | text: '\ue302', |
| | | fontSize: '18px', |
| | | onclick: 'javascript:scanPicture()' |
| | | }] |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 部位正常 异常按钮点击 |
| | | bwClick(item, val) { |
| | | item.isOK = val |
| | | if (centerContent.every(item => item.isOK !== '')) { |
| | | if (centerContent.every(item => item.isOK === 'OK')) { |
| | | resultValue = 'OK' |
| | | } else { |
| | | resultValue = 'NG' |
| | | } |
| | | } |
| | | this.$forceUpdate() //强制视图更新 |
| | | }, |
| | | onClickleft(){ |
| | | history.back() |
| | | }, |
| | |
| | | this.overlayShow = true |
| | | }, |
| | | onSelect(action) { |
| | | vant.Toast(action.text); |
| | | if (action.text === '操作指导') { |
| | | topPopoverClick('操作指导') |
| | | } else if (action.text === '成品追溯') { |
| | | topPopoverClick('成品追溯') |
| | | } else if (action.text === '退出登录') { |
| | | topPopoverClick('退出登录') |
| | | } |
| | | this.overlayShow = false |
| | | }, |
| | | } |
| | | }) |
| | | </script> |
| | | <style type="text/css"> |
| | | @import url('../../css/global.css'); |
| | | |
| | | body { |
| | | background-color: #fff; |
| | | } |
| | | |
| | | .body { |
| | | height: 600px; |
| | | min-height: 600px; |
| | | background-color: grey; |
| | | margin-top: 0px; |
| | | background-color: #fff; |
| | |
| | | color: #fff; |
| | | letter-spacing: 2px; |
| | | } |
| | | |
| | | .van-nav-bar__arrow{ |
| | | color: #fff !important; |
| | | } |
| | | |
| | | .createElementDiv { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 10px; |
| | | margin-left: 20px; |
| | | } |
| | | |
| | | .vanFieldInput { |
| | | height: 36px; |
| | | line-height: 36px; |
| | | align-items: center; |
| | | /* width: 200px; */ |
| | | |
| | | padding: 0; |
| | | padding-left: 10px; |
| | | /* border-radius: 5px; */ |
| | | margin: 5px 0; |
| | | /* background-color: #fff; */ |
| | | } |
| | | |
| | | .buttonSmall { |
| | | /* border-radius: 5px; */ |
| | | } |
| | | |
| | | .vanButtonInfo { |
| | | width: 100%; |
| | | letter-spacing: 2px; |
| | | height: 50px; |
| | | font-size: 18px; |
| | | /* margin-left: 0; */ |
| | | |
| | | } |
| | | </style> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript"> |
| | | var topContent = [ |
| | | |
| | | // { |
| | | // code: 'SB001', |
| | | // code: 'SB003', |
| | | // name: '齿轮箱组', |
| | | // wksp_code: "CJ002", |
| | | // wksp_name: '装配车间', |
| | | // eqpchkmain_code: "djbz002" |
| | | // }, |
| | | // { |
| | | // code: 'SB003', |
| | | // code: 'SB001', |
| | | // name: '齿轮箱组', |
| | | // wksp_code: "CJ002", |
| | | // wksp_name: '装配车间', |
| | |
| | | immediate: true, |
| | | }, |
| | | |
| | | 'topContent.length': { |
| | | handler(newValue, oldValue) { |
| | | if (newValue !== oldValue) { |
| | | this.$forceUpdate() |
| | | // if (topContent[0]&&topContent[0].code) { |
| | | // 'topContent.length': { |
| | | // handler(newValue, oldValue) { |
| | | // if (newValue !== oldValue) { |
| | | // this.$forceUpdate() |
| | | // this.topContentClcik(topContent[0].code) |
| | | // // if (topContent[0]&&topContent[0].code) { |
| | | // // this.$forceUpdate() |
| | | // // this.topContentClcik(topContent[0].code) |
| | | // // } |
| | | // } |
| | | } |
| | | }, |
| | | deep: true, |
| | | immediate: true, |
| | | }, |
| | | // }, |
| | | // deep: true, |
| | | // immediate: true, |
| | | // }, |
| | | 'number2.length': { |
| | | handler(newValue, oldValue) { |
| | | this.$forceUpdate() |
| | |
| | | deep: true, |
| | | immediate: true, |
| | | }, |
| | | 'number.length': { |
| | | handler(newValue, oldValue) { |
| | | this.$forceUpdate() |
| | | }, |
| | | deep: true, |
| | | immediate: true, |
| | | }, |
| | | // 'number.length': { |
| | | // handler(newValue, oldValue) { |
| | | // this.$forceUpdate() |
| | | // }, |
| | | // deep: true, |
| | | // immediate: true, |
| | | // }, |
| | | }, |
| | | created() {}, |
| | | mounted() {}, |
| | |
| | | <van-button type="primary">浅色风格</van-button> |
| | | </template> |
| | | </van-popover> |
| | | |
| | | <van-dropdown-menu :overlay="false" style="width: 100px;"> |
| | | <van-dropdown-item style="width: 100px;" v-model="value1" :options="option1" /> |
| | | </van-dropdown-menu> |
| | | </div> |
| | | </div> |
| | | </body> |
| | |
| | | }, { |
| | | text: '选项三' |
| | | }], |
| | | value1: 0, |
| | | // value2: 'a', |
| | | option1: [ |
| | | { text: '全部商品', value: 0 }, |
| | | { text: '新款商品', value: 1 }, |
| | | { text: '活动商品', value: 2 }, |
| | | ], |
| | | // option2: [ |
| | | // { text: '默认排序', value: 'a' }, |
| | | // { text: '好评排序', value: 'b' }, |
| | | // { text: '销量排序', value: 'c' }, |
| | | // ], |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | // console.log(vant.Toast('xxx')) |
| | | }, |
| | | methods: { |
| | | |
| | | onSelect(action) { |
| | | Toast(action.text); |
| | | }, |
| | |
| | | (function(w) { |
| | | // 格式化地址栏参数 将对象自动拼接成地址栏传参形式 |
| | | w.formatParams = function() { |
| | | const data = { |
| | | userid: 33, |
| | | usercode: '002', |
| | | username: '张三', |
| | | usertype: 'APP' |
| | | } |
| | | return data; |
| | | w.formatParams = function(data) { |
| | | let temp = '' |
| | | Object.keys(data).map((key, index) => { |
| | | temp += '&' + key + '=' + data[key] |
| | | }) |
| | | let firstCharAt = temp.charAt(0) |
| | | temp = temp.replace(firstCharAt, '?') |
| | | return temp; |
| | | } |
| | | |
| | | w.topPopoverClick = function(type) { |
| | | |
| | | if (type === '操作指导') { |
| | | console.log('操作指导') |
| | | } else if (type === '成品追溯') { |
| | | console.log('成品追溯') |
| | | } else if (type === '退出登录') { |
| | | const data = { |
| | | userid: localStorage.getItem('userid'), |
| | | usercode: localStorage.getItem('usercode'), |
| | | username: localStorage.getItem('username'), |
| | | usertype: localStorage.getItem('usertype') |
| | | } |
| | | post('Login/LoginAppOut' + formatParams(data)).then(res => { |
| | | if (res.code === '200') { |
| | | window.location.href = '../login/index.html' |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // return 1 |
| | | } |
| | | |
| | | })(window); |
| | |
| | | </van-field> |
| | | </div> |
| | | <div style="margin-top:30px;"> |
| | | <van-button type="info" style="border-radius: 10px;" @click='loginClick' size="large">立即登录 |
| | | <van-button type="info" style="border-radius: 10px;" :disabled="username===''||password===''" |
| | | @click='loginClick' size="large">立即登录 |
| | | </van-button> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | }, |
| | | mounted() { |
| | | console.log(formatParams(),1) |
| | | |
| | | }, |
| | | methods: { |
| | | loginClick() { |
| | |
| | | username: res.data.username, |
| | | usertype: res.data.usertype |
| | | } |
| | | |
| | | |
| | | post('Login/ForcedOffline?userid=' + res.data.userid + '&usercode=' + res.data |
| | | .usercode + '&username=' + res.data.username + '&usertype=' + res.data |
| | | .usertype).then(res2 => { |
| | | post('Login/ForcedOffline' + formatParams(data2)).then(res2 => { |
| | | if (res2.code === '200') { |
| | | this.loginClick() |
| | | } |
| | | |
| | | }) |
| | | } |
| | | |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }); |
| | |
| | | <script type="text/javascript" src="../../js/axios.min.js"></script> |
| | | <script type="text/javascript" src="../../js/http.js"></script> |
| | | |
| | | <script type="text/javascript" src="../../js/common.js"></script> |
| | | |
| | | <link rel="stylesheet" href="../css/global.css" type="text/css" charset="utf-8" /> |
| | | <script type="text/javascript" src="../../js/global.js"></script> |
| | | |
| | | <!-- <link rel="stylesheet" href="../../css/global.css" type="text/css" charset="utf-8" /> --> |
| | | |
| | | <script type="text/javascript"> |
| | | var topContent = [ |
| | | // { |
| | | // code: 'SB001', |
| | | // name: '电池组一线', |
| | | // wksp_code: "CJ002", |
| | | // wksp_name: '电池车间', |
| | | // eapmai_code: "bybz004", |
| | | // eapmai_name: "标准4", |
| | | // main_cycle: "M", |
| | | // }, |
| | | // { |
| | | // code: 'SB003', |
| | | // name: '齿轮箱组一线', |
| | | // wksp_code: "CJ001", |
| | | // "wksp_name": "装配车间", |
| | | // "eapmai_code": "bybz003", |
| | | // "eapmai_name": "标准名称3", |
| | | // "main_cycle": "M" |
| | | // }, |
| | | ]; |
| | | |
| | | var centerContent = [ |
| | | // { |
| | | // "seq": 1, |
| | | // "code": "bwbm004", |
| | | // "name": "部位名称4", |
| | | // "chk_desc": "", |
| | | // "isscan": "N", |
| | | // "main_cycle": "M" |
| | | // }, |
| | | // { |
| | | // "seq": 2, |
| | | // "code": "bwbm002", |
| | | // "name": "部位名称2", |
| | | // "chk_desc": "", |
| | | // "isscan": "N", |
| | | // "main_cycle": "M" |
| | | // } |
| | | ] |
| | | |
| | | |
| | | let radioValue = '' //单选框选中的项 |
| | | |
| | | let resultValue = '' //点检结果 |
| | | |
| | | let dropdownValue = 'M' //下拉默认选中的值 |
| | | |
| | | let bwcode = '' //点击部位的扫描框 点检项目code |
| | | |
| | | let number = [] //保养项目内容 假数组 做扫码回来视图更新用 |
| | | |
| | | // 扫描保养工位返回时执行方法 |
| | | function scaned(r) { |
| | | let flag = false |
| | | topContent.forEach((item, index) => { |
| | | if (item.code === r) { |
| | | flag = true |
| | | } |
| | | }) |
| | | if (flag) { |
| | | vant.Notify({ |
| | | type: 'danger', |
| | | message: '此条码已扫描,已在列表中!' |
| | | }); |
| | | } else { |
| | | get('AppDeviceManage/RepairScanDeviceQrCodeData', { |
| | | eqpcode: r |
| | | }).then(res => { |
| | | if (res.code === '200' && res.data[0].eqpchkmain_code !== null) { |
| | | topContent.unshift(res.data[0]) |
| | | topContentClcik(topContent[0].code) |
| | | } |
| | | |
| | | if (res.code === '200' && res.data[0].eqpchkmain_code === null) { |
| | | vant.Notify({ |
| | | type: 'danger', |
| | | message: '当前设备未设置保养标准绑定点检项目!' |
| | | }); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | // 扫描保养项目内容返回时执行方法 |
| | | function scaned2(r) { |
| | | if (bwcode === r) { |
| | | centerContent.forEach(item => { |
| | | if (item.code === bwcode) { |
| | | item.isDisabled = false |
| | | item.isOK = 'OK' |
| | | |
| | | |
| | | if (centerContent.every(r => r.isOK === 'OK')) { |
| | | resultValue = 'OK' |
| | | } |
| | | if (centerContent.some(r => r.isOK === 'NG')) { |
| | | resultValue = 'NG' |
| | | } |
| | | if (centerContent.some(r => r.isOK === '')) { |
| | | resultValue = '' |
| | | } |
| | | |
| | | |
| | | number.push({ |
| | | id: '1' |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | vant.Notify({ |
| | | type: 'danger', |
| | | message: '扫描的二维码未与此点检项目相匹配!' |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | function topContentClcik(code) { |
| | | radioValue = code |
| | | get('AppDeviceManage/RepairSelectScanDeviceQrCodeItem', { |
| | | eqpcode: code |
| | | }).then(res => { |
| | | if (res.code === '200') { |
| | | |
| | | dropdownValue = topContent.find(r => r.code === topContent[0].code).main_cycle |
| | | |
| | | centerContent = res.data |
| | | centerContent = JSON.parse(JSON.stringify(centerContent)) |
| | | centerContent.forEach(item => { |
| | | item.isDisabled = item.isscan === 'Y' |
| | | item.inputValue = '' |
| | | item.isOK = item.isscan !== 'Y' ? 'OK' : '' |
| | | }) |
| | | if (centerContent.every(r => r.isOK === 'OK')) { |
| | | resultValue = 'OK' |
| | | } |
| | | if (centerContent.some(r => r.isOK === 'NG')) { |
| | | resultValue = 'NG' |
| | | } |
| | | if (centerContent.some(r => r.isOK === '')) { |
| | | resultValue = '' |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | </script> |
| | | </head> |
| | | <!-- <body onload="loadNodes()"> --> |
| | | <body> |
| | | <div id="app"> |
| | | |
| | |
| | | </template> |
| | | </van-nav-bar> |
| | | |
| | | |
| | | <div class="head"> |
| | | <div class="head_block"> |
| | | <div class="head_left"> |
| | | <div class="head_bar"></div> |
| | | <div class="head_title"> |
| | | 扫描保养工位 |
| | | </div> |
| | | </div> |
| | | |
| | | <div style="margin-right: 10px;"> |
| | | <van-icon name="scan" color='red' size='24' @click='topScanClick()' /> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="flex_between" style=""> |
| | | <div id="contentLeft" style="width: 100%;margin-top: 10px;"> |
| | | <div id="topContentID" v-for="item in topContent" :key="item.code" |
| | | style="margin-bottom: 10px;margin-left: 20px;" @click="topContentClcik(item.code)"> |
| | | <div style="display: flex;align-items: center;"> |
| | | <div> |
| | | <div>工位编码:</div> |
| | | <div>工位名称:</div> |
| | | <div>生产车间:</div> |
| | | </div> |
| | | <div> |
| | | <div>{{item.code}}</div> |
| | | <div>{{item.name}}</div> |
| | | <div>{{item.wksp_name}}</div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <div id="contentRight"> |
| | | <van-radio-group v-model="radioValue" style="padding-right: 12px;"> |
| | | <van-radio checked-color='red' icon-size="18px" |
| | | style="height: 63px;margin-bottom: 10px;" v-for="item in topContent" |
| | | :key="item.code" :name="item.code"></van-radio> |
| | | </van-radio-group> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="head" |
| | | :style="{marginTop:topContent.length===0?'100px':'0',minHeight:topContent.length===0?'0':'220px'}" |
| | | style="margin-bottom: 130px;padding-bottom: 10px;overflow-y: ;" |
| | | :style="{marginTop:topContent.length===0?'78px':'0'}"> |
| | | <div class="head_block" style="margin-bottom:10px;"> |
| | | <div class="head_left"> |
| | | <div class="head_bar"></div> |
| | | <div class="head_title"> |
| | | 保养项目内容 |
| | | </div> |
| | | </div> |
| | | <div style="margin-right: 10px;"> |
| | | |
| | | <van-button @click="sheetFlag=true" type="info" style="width:20px;height: 30px;"> |
| | | {{dropdownValue==='M'?'月':'年'}} |
| | | </van-button> |
| | | <van-action-sheet v-model="sheetFlag" :actions="actionsSheet" @select="onSelectSheet" /> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="center_border flex_column" style="margin: 5px;" v-for="item in centerContent" |
| | | :key="item.code"> |
| | | <div class="flex_between"> |
| | | <div class="center_title">{{item.name}}</div> |
| | | <div style="margin-right: 10px;" v-if="item.isscan==='Y'"> |
| | | <van-icon name="scan" color='red' size='24' @click='centerScanClick(item.code)' /> |
| | | </div> |
| | | </div> |
| | | <div class="flex_between "> |
| | | <div class='flex_between' style="width: 90%;"> |
| | | <van-field class="vanFieldInput" @blur="vanFieldBlur()" :disabled="item.isDisabled" |
| | | v-model="item.inputValue" placeholder="请输入" /> |
| | | </div> |
| | | |
| | | |
| | | <div class="" style="width: 40%;display: flex;justify-content: space-around;"> |
| | | <van-button class="buttonSmall" :disabled='item.isDisabled' size="small" |
| | | :plain="item.isOK!=='OK'" @click="bwClick(item,'OK')" type="primary">正常</van-button> |
| | | <van-button class="buttonSmall" size="small" :plain="item.isOK!=='NG'" |
| | | @click="bwClick(item,'NG')" :disabled='item.isDisabled' type="danger">异常 |
| | | </van-button> |
| | | </div> |
| | | </div> |
| | | <div style="font-weight: lighter;font-size: 14px;padding-right: 5px"> |
| | | {{item.chk_desc}} |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | |
| | | <div style=""> |
| | | <div class="footer"> |
| | | <div class="head_block" style="margin-bottom: 20rpx;align-items: center;"> |
| | | <div class="head_left"> |
| | | <div class="head_bar"></div> |
| | | <div class="head_title"> |
| | | 保养结果 |
| | | </div> |
| | | </div> |
| | | <div class="flex_center" style="width: 30%;display: flex;justify-content: space-around;"> |
| | | |
| | | <van-button class="buttonSmall" |
| | | :disabled="centerContent.some(item=>item.isDisabled===true)||centerContent.length===0" |
| | | size="small" :plain="resultValue!=='OK'" @click="resultClick('OK')" type="primary"> |
| | | 正常</van-button> |
| | | <van-button class="buttonSmall" size="small" :plain="resultValue!=='NG'" |
| | | :disabled="centerContent.some(item=>item.isDisabled===true)||centerContent.length===0" |
| | | @click="resultClick('NG')" type="danger">异常</van-button> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div |
| | | style="position:fixed;bottom: 0;width: 96%;display: flex;justify-content: center;flex-direction: column;align-items: center"> |
| | | <van-button class="vanButtonInfo" :disabled="resultValue===''" @click="submit" type="info"> |
| | | 确认提交</van-button> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | |
| | | <van-overlay :show="overlayShow" @click="overlayShow=false" /> |
| | | |
| | |
| | | icon: 'revoke', |
| | | text: '退出登录' |
| | | }], |
| | | actionsSheet: [{ |
| | | code: 'Y', |
| | | name: '年' |
| | | }, { |
| | | code: 'M', |
| | | name: '月' |
| | | }], |
| | | topContent2: topContent, |
| | | centerContent2: centerContent, |
| | | number2: number, |
| | | |
| | | sheetFlag: false, |
| | | } |
| | | }, |
| | | watch: { |
| | | 'topContent2.length': { |
| | | handler(newValue, oldValue) { |
| | | if (newValue !== oldValue) { |
| | | // this.topContent2 = topContent |
| | | // this.$forceUpdate() |
| | | if (topContent[0] && topContent[0].code) { |
| | | this.$forceUpdate() |
| | | this.topContentClcik(topContent[0].code) |
| | | } |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | deep: true, |
| | | immediate: true, |
| | | }, |
| | | |
| | | // 'topContent.length': { |
| | | // handler(newValue, oldValue) { |
| | | // if (newValue !== oldValue) { |
| | | // this.$forceUpdate() |
| | | // // if (topContent[0]&&topContent[0].code) { |
| | | // // this.$forceUpdate() |
| | | // // this.topContentClcik(topContent[0].code) |
| | | // // } |
| | | // } |
| | | // }, |
| | | // deep: true, |
| | | // immediate: true, |
| | | // }, |
| | | 'number2.length': { |
| | | handler(newValue, oldValue) { |
| | | this.$forceUpdate() |
| | | }, |
| | | deep: true, |
| | | immediate: true, |
| | | }, |
| | | // 'number.length': { |
| | | // handler(newValue, oldValue) { |
| | | // this.$forceUpdate() |
| | | // }, |
| | | // deep: true, |
| | | // immediate: true, |
| | | // }, |
| | | }, |
| | | created() {}, |
| | | mounted() { |
| | | // dropdownValue = topContent.find(r => r.code === 'SB001').main_cycle |
| | | |
| | | }, |
| | | methods: { |
| | | onSelectSheet(val) { |
| | | dropdownValue = val |
| | | this.$forceUpdate() |
| | | this.sheetFlag = false |
| | | }, |
| | | submit() { |
| | | let children = [] |
| | | centerContent.forEach(item => { |
| | | children.push({ |
| | | seq: item.seq, |
| | | itemcode: item.code, |
| | | cycle: item.main_cycle, |
| | | value: item.inputValue, |
| | | result: item.isOK |
| | | }) |
| | | }) |
| | | const data = { |
| | | code: radioValue, |
| | | name: topContent.find(r => r.code === radioValue).name, |
| | | standcode: topContent.find(r => r.code === radioValue).eapmai_code, |
| | | result: resultValue, |
| | | children: children |
| | | } |
| | | |
| | | console.log(data, 1) |
| | | |
| | | const params = { |
| | | username: localStorage.getItem('username'), |
| | | maintcyc: dropdownValue |
| | | } |
| | | |
| | | // vant.Notify(JSON.stringify(params)) |
| | | // vant.Toast(JSON.stringify(data)) |
| | | post('AppDeviceManage/AppDeviceRepairSave' + formatParams(params), data) |
| | | .then(res => { |
| | | if (res.code === '200') { |
| | | vant.Notify({ |
| | | type: 'primary', |
| | | message: '提交成功!' |
| | | }) |
| | | topContent.forEach((r, i) => { |
| | | if (r.code === radioValue) { |
| | | topContent.splice(i, 1) |
| | | } |
| | | }) |
| | | if (topContent.length >= 1) { |
| | | radioValue = topContent[0].code |
| | | this.topContentClcik(radioValue) |
| | | } else { |
| | | centerContent = [] |
| | | } |
| | | resultValue = '' |
| | | this.$forceUpdate() |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | // 输入框失焦触发事件 |
| | | vanFieldBlur() { |
| | | this.$forceUpdate() |
| | | }, |
| | | topContentClcik(code) { |
| | | radioValue = code |
| | | this.$forceUpdate() |
| | | get('AppDeviceManage/RepairSelectScanDeviceQrCodeItem', { |
| | | eqpcode: code |
| | | }).then(res => { |
| | | if (res.code === '200') { |
| | | |
| | | dropdownValue = topContent.find(r => r.code === code).main_cycle |
| | | |
| | | centerContent = res.data |
| | | centerContent.forEach(item => { |
| | | item.isDisabled = item.isscan === 'Y' |
| | | item.inputValue = '' |
| | | item.isOK = item.isscan !== 'Y' ? 'OK' : '' |
| | | }) |
| | | if (centerContent.every(r => r.isOK === 'OK')) { |
| | | resultValue = 'OK' |
| | | } |
| | | if (centerContent.some(r => r.isOK === 'NG')) { |
| | | resultValue = 'NG' |
| | | } |
| | | if (centerContent.some(r => r.isOK === '')) { |
| | | resultValue = '' |
| | | } |
| | | |
| | | this.$forceUpdate() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | resultClick(val) { |
| | | resultValue = val |
| | | this.$forceUpdate() |
| | | }, |
| | | |
| | | selected(id) { |
| | | alert(id) |
| | | }, |
| | | |
| | | // 扫描保养工位扫描 |
| | | topScanClick() { |
| | | createWithoutTitle('../../components/barcode_scan.html', { |
| | | titleNView: { |
| | | type: 'float', |
| | | backgroundColor: 'rgba(215,75,40,0.3)', |
| | | titleText: '扫一扫', |
| | | titleColor: '#FFFFFF', |
| | | autoBackButton: true, |
| | | buttons: [{ |
| | | fontSrc: '_www/helloh5.ttf', |
| | | text: '\ue302', |
| | | fontSize: '18px', |
| | | onclick: 'javascript:scanPicture()' |
| | | }] |
| | | } |
| | | }); |
| | | }, |
| | | // 保养项目内容扫描 |
| | | centerScanClick(code) { |
| | | bwcode = code |
| | | createWithoutTitle('../../components/barcode_scan2.html', { |
| | | titleNView: { |
| | | type: 'float', |
| | | backgroundColor: 'rgba(215,75,40,0.3)', |
| | | titleText: '扫一扫', |
| | | titleColor: '#FFFFFF', |
| | | autoBackButton: true, |
| | | buttons: [{ |
| | | fontSrc: '_www/helloh5.ttf', |
| | | text: '\ue302', |
| | | fontSize: '18px', |
| | | onclick: 'javascript:scanPicture()' |
| | | }] |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 部位正常 异常按钮点击 |
| | | bwClick(item, val) { |
| | | item.isOK = val |
| | | if (centerContent.every(item => item.isOK !== '')) { |
| | | if (centerContent.every(item => item.isOK === 'OK')) { |
| | | resultValue = 'OK' |
| | | } else { |
| | | resultValue = 'NG' |
| | | } |
| | | } |
| | | this.$forceUpdate() //强制视图更新 |
| | | }, |
| | | onClickleft(){ |
| | | history.back() |
| | | }, |
| | |
| | | this.overlayShow = true |
| | | }, |
| | | onSelect(action) { |
| | | vant.Toast(action.text); |
| | | if (action.text === '操作指导') { |
| | | topPopoverClick('操作指导') |
| | | } else if (action.text === '成品追溯') { |
| | | topPopoverClick('成品追溯') |
| | | } else if (action.text === '退出登录') { |
| | | topPopoverClick('退出登录') |
| | | } |
| | | this.overlayShow = false |
| | | }, |
| | | } |
| | | }) |
| | | </script> |
| | | <style type="text/css"> |
| | | @import url('../../css/global.css'); |
| | | |
| | | body { |
| | | background-color: #fff; |
| | | } |
| | | |
| | | .body { |
| | | height: 600px; |
| | | min-height: 600px; |
| | | background-color: grey; |
| | | margin-top: 0px; |
| | | background-color: #fff; |
| | |
| | | color: #fff; |
| | | letter-spacing: 2px; |
| | | } |
| | | |
| | | .van-nav-bar__arrow{ |
| | | color: #fff !important; |
| | | } |
| | | |
| | | .createElementDiv { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 10px; |
| | | margin-left: 20px; |
| | | } |
| | | |
| | | .vanFieldInput { |
| | | height: 36px; |
| | | line-height: 36px; |
| | | align-items: center; |
| | | /* width: 200px; */ |
| | | |
| | | padding: 0; |
| | | padding-left: 10px; |
| | | /* border-radius: 5px; */ |
| | | margin: 5px 0; |
| | | /* background-color: #fff; */ |
| | | } |
| | | |
| | | .buttonSmall { |
| | | /* border-radius: 5px; */ |
| | | } |
| | | |
| | | .vanButtonInfo { |
| | | width: 100%; |
| | | letter-spacing: 2px; |
| | | height: 50px; |
| | | font-size: 18px; |
| | | /* margin-left: 0; */ |
| | | |
| | | } |
| | | </style> |
| | | </html> |
| | |
| | | |
| | | <script type="text/javascript" src="../../js/common.js"></script> |
| | | |
| | | <script type="text/javascript" src="../../js/global.js"></script> |
| | | |
| | | <!-- <link rel="stylesheet" href="../../css/global.css" type="text/css" charset="utf-8" /> --> |
| | | |
| | | <script type="text/javascript"> |
| | | var topContent = [ |
| | | |
| | | // { |
| | | // code: 'SB001', |
| | | // code: 'SB003', |
| | | // name: '齿轮箱组', |
| | | // wksp_code: "CJ002", |
| | | // wksp_name: '装配车间', |
| | | // eqpchkmain_code: "djbz002" |
| | | // }, |
| | | // { |
| | | // code: 'SB003', |
| | | // code: 'SB001', |
| | | // name: '齿轮箱组', |
| | | // wksp_code: "CJ002", |
| | | // wksp_name: '装配车间', |
| | |
| | | ] |
| | | |
| | | |
| | | let radioValue = '' |
| | | let radioValue = '' //单选框选中的项 |
| | | |
| | | let resultValue = '' |
| | | let resultValue = '' //点检结果 |
| | | |
| | | |
| | | let bwcode = '' |
| | | let bwcode = '' //点击部位的扫描框 点检项目code |
| | | |
| | | let number = [] |
| | | let number = [] //点检项目内容 假数组 做扫码回来视图更新用 |
| | | |
| | | // 扫描点检工位返回时执行方法 |
| | | function scaned(r) { |
| | | |
| | | let flag = false |
| | | topContent.forEach((item, index) => { |
| | | if (item.code === r) { |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | // 扫描点检项目内容返回时执行方法 |
| | | function scaned2(r) { |
| | | if (bwcode === r) { |
| | | centerContent.forEach(item => { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | function topContentClcik(code) { |
| | | radioValue = code |
| | |
| | | </div> |
| | | <div class="flex_between "> |
| | | <div class='flex_between' style="width: 90%;"> |
| | | <van-field class="vanFieldInput" :disabled="item.isDisabled" v-model="item.inputValue" |
| | | placeholder="请输入" /> |
| | | <van-field class="vanFieldInput" @blur="vanFieldBlur()" :disabled="item.isDisabled" |
| | | v-model="item.inputValue" placeholder="请输入" /> |
| | | </div> |
| | | |
| | | |
| | |
| | | immediate: true, |
| | | }, |
| | | |
| | | 'topContent.length': { |
| | | handler(newValue, oldValue) { |
| | | if (newValue !== oldValue) { |
| | | this.$forceUpdate() |
| | | // if (topContent[0]&&topContent[0].code) { |
| | | // 'topContent.length': { |
| | | // handler(newValue, oldValue) { |
| | | // if (newValue !== oldValue) { |
| | | // this.$forceUpdate() |
| | | // this.topContentClcik(topContent[0].code) |
| | | // // if (topContent[0]&&topContent[0].code) { |
| | | // // this.$forceUpdate() |
| | | // // this.topContentClcik(topContent[0].code) |
| | | // // } |
| | | // } |
| | | } |
| | | }, |
| | | deep: true, |
| | | immediate: true, |
| | | }, |
| | | // }, |
| | | // deep: true, |
| | | // immediate: true, |
| | | // }, |
| | | 'number2.length': { |
| | | handler(newValue, oldValue) { |
| | | this.$forceUpdate() |
| | |
| | | deep: true, |
| | | immediate: true, |
| | | }, |
| | | 'number.length': { |
| | | handler(newValue, oldValue) { |
| | | this.$forceUpdate() |
| | | }, |
| | | deep: true, |
| | | immediate: true, |
| | | }, |
| | | // 'number.length': { |
| | | // handler(newValue, oldValue) { |
| | | // this.$forceUpdate() |
| | | // }, |
| | | // deep: true, |
| | | // immediate: true, |
| | | // }, |
| | | }, |
| | | created() {}, |
| | | mounted() {}, |
| | | methods: { |
| | | submit() { |
| | | vant.Toast('xxx1') |
| | | let children = [] |
| | | centerContent.forEach(item => { |
| | | children.push({ |
| | | seq: item.seq, |
| | | itemcode: item.code, |
| | | cycle: item.cycle, |
| | | value: item.inputValue, |
| | | result: item.isOK |
| | | }) |
| | | }) |
| | | const data = { |
| | | code: radioValue, |
| | | name: topContent.find(r => r.code === radioValue).name, |
| | | standcode: topContent.find(r => r.code === radioValue).eqpchkmain_code, |
| | | result: resultValue, |
| | | children: children |
| | | } |
| | | |
| | | console.log(data, 1) |
| | | |
| | | post('AppDeviceManage/AppDeviceCheckSave?username=' + localStorage.getItem('username'), data) |
| | | .then(res => { |
| | | if (res.code === '200') { |
| | | vant.Notify({ |
| | | type: 'primary', |
| | | message: '提交成功!' |
| | | }) |
| | | topContent.forEach((r, i) => { |
| | | if (r.code === radioValue) { |
| | | topContent.splice(i, 1) |
| | | } |
| | | }) |
| | | if (topContent.length >= 1) { |
| | | radioValue = topContent[0].code |
| | | this.topContentClcik(radioValue) |
| | | } else { |
| | | centerContent = [] |
| | | } |
| | | resultValue = '' |
| | | this.$forceUpdate() |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | // 输入框失焦触发事件 |
| | | vanFieldBlur() { |
| | | this.$forceUpdate() |
| | | }, |
| | | topContentClcik(code) { |
| | | radioValue = code |
| | |
| | | this.overlayShow = true |
| | | }, |
| | | onSelect(action) { |
| | | vant.Toast(action.text); |
| | | if(action.text==='操作指导'){ |
| | | topPopoverClick('操作指导') |
| | | }else if(action.text==='成品追溯'){ |
| | | topPopoverClick('成品追溯') |
| | | }else if(action.text==='退出登录'){ |
| | | topPopoverClick('退出登录') |
| | | } |
| | | this.overlayShow = false |
| | | }, |
| | | } |
| | |
| | | <van-button type="primary">浅色风格</van-button> |
| | | </template> |
| | | </van-popover> |
| | | |
| | | <van-dropdown-menu :overlay="false" style="width: 100px;"> |
| | | <van-dropdown-item style="width: 100px;" v-model="value1" :options="option1" /> |
| | | </van-dropdown-menu> |
| | | </div> |
| | | </div> |
| | | </body> |
| | |
| | | }, { |
| | | text: '选项三' |
| | | }], |
| | | value1: 0, |
| | | // value2: 'a', |
| | | option1: [ |
| | | { text: '全部商品', value: 0 }, |
| | | { text: '新款商品', value: 1 }, |
| | | { text: '活动商品', value: 2 }, |
| | | ], |
| | | // option2: [ |
| | | // { text: '默认排序', value: 'a' }, |
| | | // { text: '好评排序', value: 'b' }, |
| | | // { text: '销量排序', value: 'c' }, |
| | | // ], |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | // console.log(vant.Toast('xxx')) |
| | | }, |
| | | methods: { |
| | | |
| | | onSelect(action) { |
| | | Toast(action.text); |
| | | }, |
| | |
| | | |
| | | |
| | | <link rel="stylesheet" href="../css/global.css" type="text/css" charset="utf-8" /> |
| | | <script type="text/javascript" src="../../js/global.js"></script> |
| | | |
| | | </head> |
| | | <body> |
| | |
| | | }, |
| | | // 顶部右图标下拉选择 |
| | | onSelect(action) { |
| | | vant.Toast(action.text); |
| | | if(action.text==='操作指导'){ |
| | | topPopoverClick('操作指导') |
| | | }else if(action.text==='成品追溯'){ |
| | | topPopoverClick('成品追溯') |
| | | }else if(action.text==='退出登录'){ |
| | | topPopoverClick('退出登录') |
| | | } |
| | | this.overlayShow = false |
| | | }, |
| | | } |