| | |
| | | |
| | | <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: 'SB003', |
| | | // name: '齿轮箱组', |
| | | // wksp_code: "CJ002", |
| | | // wksp_name: '装配车间', |
| | | // eqpchkmain_code: "djbz002" |
| | | // }, |
| | | // { |
| | | // code: 'SB001', |
| | | // name: '齿轮箱组', |
| | |
| | | // wksp_name: '装配车间', |
| | | // eqpchkmain_code: "djbz002" |
| | | // }, |
| | | // { |
| | | // code: 'SB003', |
| | | // name: '齿轮箱组', |
| | | // wksp_code: "CJ002", |
| | | // wksp_name: '装配车间', |
| | | // eqpchkmain_code: "djbz002" |
| | | // }, |
| | | ]; |
| | | |
| | | var centerContent = [ |
| | |
| | | ] |
| | | |
| | | |
| | | 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) { |
| | | // this.$forceUpdate() |
| | | // this.topContentClcik(topContent[0].code) |
| | | // } |
| | | } |
| | | }, |
| | | 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, |
| | | }, |
| | | // '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 |
| | | }, |
| | | } |