| | |
| | | |
| | | |
| | | # 任康æ¬å° |
| | | # VUE_APP_API = 'http://192.168.0.15:10021/' |
| | | VUE_APP_API = 'http://192.168.0.15:10021/' |
| | | |
| | | VUE_APP_API = 'https://dmtest.ahapp.net/doumeeplant_api/' |
| | | # VUE_APP_API = 'https://dmtest.ahapp.net/doumeeplant_api/' |
| | | |
| | | # VUE_APP_API = 'http://192.168.0.13:10012/' |
| | | |
| | |
| | | "axios": "^0.27.2", |
| | | "dingtalk-jsapi": "^2.13.92", |
| | | "echarts": "^4.8.0", |
| | | "js-sha1": "^0.6.0", |
| | | "jsqr": "^1.4.0", |
| | | "lib-flexible": "^0.3.2", |
| | | "mitt": "^3.0.0", |
| | |
| | | "vue": "^3.2.13", |
| | | "vue-pdf-embed": "^1.1.4", |
| | | "vue-router": "^4.0.3", |
| | | "vuex": "^4.0.0" |
| | | "vuex": "^4.0.0", |
| | | "weixin-js-sdk": "^1.6.0" |
| | | }, |
| | | "devDependencies": { |
| | | "@types/echarts": "^4.9.15", |
| | | "@types/js-sha1": "^0.6.0", |
| | | "@vue/cli-plugin-router": "~5.0.0", |
| | | "@vue/cli-plugin-typescript": "~5.0.0", |
| | | "@vue/cli-plugin-vuex": "~5.0.0", |
| | |
| | | "dependencies": { |
| | | "@types/node": "*" |
| | | } |
| | | }, |
| | | "node_modules/@types/js-sha1": { |
| | | "version": "0.6.0", |
| | | "resolved": "https://registry.npmjs.org/@types/js-sha1/-/js-sha1-0.6.0.tgz", |
| | | "integrity": "sha512-TBJguE0wDNgtAwL7TpjzPbj5Sz5fsIuTQbgyXDJ7nV1eExhE/kd3YNS/q6JSiPAdElcFoKY3zlSifzjb/vO6xw==", |
| | | "dev": true |
| | | }, |
| | | "node_modules/@types/json-schema": { |
| | | "version": "7.0.11", |
| | |
| | | "engines": { |
| | | "node": ">=0.6.0" |
| | | } |
| | | }, |
| | | "node_modules/js-sha1": { |
| | | "version": "0.6.0", |
| | | "resolved": "https://registry.npmjs.org/js-sha1/-/js-sha1-0.6.0.tgz", |
| | | "integrity": "sha512-01gwBFreYydzmU9BmZxpVk6svJJHrVxEN3IOiGl6VO93bVKYETJ0sIth6DASI6mIFdt7NmfX9UiByRzsYHGU9w==" |
| | | }, |
| | | "node_modules/js-tokens": { |
| | | "version": "4.0.0", |
| | |
| | | "node": ">=0.8.0" |
| | | } |
| | | }, |
| | | "node_modules/weixin-js-sdk": { |
| | | "version": "1.6.0", |
| | | "resolved": "https://registry.npmjs.org/weixin-js-sdk/-/weixin-js-sdk-1.6.0.tgz", |
| | | "integrity": "sha512-3IYQH7aalJGFJrwdT3epvTdR1MboMiH7vIZ5BRL2eYOJ12BNah7csoMkmSZzkq1+l92sSq29XdTCVjCJoK2sBQ==" |
| | | }, |
| | | "node_modules/whatwg-fetch": { |
| | | "version": "3.6.2", |
| | | "resolved": "https://registry.npmmirror.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz", |
| | |
| | | "requires": { |
| | | "@types/node": "*" |
| | | } |
| | | }, |
| | | "@types/js-sha1": { |
| | | "version": "0.6.0", |
| | | "resolved": "https://registry.npmjs.org/@types/js-sha1/-/js-sha1-0.6.0.tgz", |
| | | "integrity": "sha512-TBJguE0wDNgtAwL7TpjzPbj5Sz5fsIuTQbgyXDJ7nV1eExhE/kd3YNS/q6JSiPAdElcFoKY3zlSifzjb/vO6xw==", |
| | | "dev": true |
| | | }, |
| | | "@types/json-schema": { |
| | | "version": "7.0.11", |
| | |
| | | "resolved": "https://registry.npmmirror.com/js-message/-/js-message-1.0.7.tgz", |
| | | "integrity": "sha512-efJLHhLjIyKRewNS9EGZ4UpI8NguuL6fKkhRxVuMmrGV2xN/0APGdQYwLFky5w9naebSZ0OwAGp0G6/2Cg90rA==", |
| | | "dev": true |
| | | }, |
| | | "js-sha1": { |
| | | "version": "0.6.0", |
| | | "resolved": "https://registry.npmjs.org/js-sha1/-/js-sha1-0.6.0.tgz", |
| | | "integrity": "sha512-01gwBFreYydzmU9BmZxpVk6svJJHrVxEN3IOiGl6VO93bVKYETJ0sIth6DASI6mIFdt7NmfX9UiByRzsYHGU9w==" |
| | | }, |
| | | "js-tokens": { |
| | | "version": "4.0.0", |
| | |
| | | "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", |
| | | "dev": true |
| | | }, |
| | | "weixin-js-sdk": { |
| | | "version": "1.6.0", |
| | | "resolved": "https://registry.npmjs.org/weixin-js-sdk/-/weixin-js-sdk-1.6.0.tgz", |
| | | "integrity": "sha512-3IYQH7aalJGFJrwdT3epvTdR1MboMiH7vIZ5BRL2eYOJ12BNah7csoMkmSZzkq1+l92sSq29XdTCVjCJoK2sBQ==" |
| | | }, |
| | | "whatwg-fetch": { |
| | | "version": "3.6.2", |
| | | "resolved": "https://registry.npmmirror.com/whatwg-fetch/-/whatwg-fetch-3.6.2.tgz", |
| | |
| | | "axios": "^0.27.2", |
| | | "dingtalk-jsapi": "^2.13.92", |
| | | "echarts": "^4.8.0", |
| | | "js-sha1": "^0.6.0", |
| | | "jsqr": "^1.4.0", |
| | | "lib-flexible": "^0.3.2", |
| | | "mitt": "^3.0.0", |
| | |
| | | "vue": "^3.2.13", |
| | | "vue-pdf-embed": "^1.1.4", |
| | | "vue-router": "^4.0.3", |
| | | "vuex": "^4.0.0" |
| | | "vuex": "^4.0.0", |
| | | "weixin-js-sdk": "^1.6.0" |
| | | }, |
| | | "devDependencies": { |
| | | "@types/echarts": "^4.9.15", |
| | | "@types/js-sha1": "^0.6.0", |
| | | "@vue/cli-plugin-router": "~5.0.0", |
| | | "@vue/cli-plugin-typescript": "~5.0.0", |
| | | "@vue/cli-plugin-vuex": "~5.0.0", |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8"> |
| | | <title></title> |
| | | </head> |
| | | <body> |
| | | <script> |
| | | var url = window.location.href |
| | | if (url.indexOf('?code') === -1) { |
| | | let query = url.split('?')[1] |
| | | let tempUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx4d7c10bdec51942b&redirect_uri=https://dmtest.ahapp.net/doumeeplant_h5/redirect.html&response_type=code&scope=snsapi_base&state=#wechat_redirect` |
| | | window.location.replace(tempUrl) |
| | | } else { |
| | | var code = url.substring(url.indexOf('?') + 6, url.indexOf('&')) |
| | | let href1 = `https://dmtest.ahapp.net/doumeeplant_h5/#/wxLogin?code=${code}` |
| | | window.location.replace(href1) |
| | | } |
| | | </script> |
| | | </body> |
| | | </html> |
| | |
| | | }) |
| | | } |
| | | |
| | | // è·å微信openId |
| | | export function wxLogin(params: any): Promise<any> { |
| | | return httpRequest({ |
| | | url: '/system/wxLogin', |
| | | method: 'get', |
| | | params |
| | | }) |
| | | } |
| | | |
| | | // 微信端ç»å½ |
| | | export function wxAccountLogin(data: any): Promise<any> { |
| | | return httpRequest({ |
| | | url: '/system/wxAccountLogin', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | // è·åä¼ä¸id |
| | | export function getDingdingCorpId(companyId: any): Promise<any> { |
| | | return httpRequest({ |
| | |
| | | component: () => import('@/views/needToBeDealtWith/warehousing.vue') |
| | | }, |
| | | { |
| | | path: '/needToBeDealtWith/outbound', |
| | | name: 'outbound', |
| | | meta: { |
| | | title: 'åºåº', |
| | | keepAlive: false |
| | | }, |
| | | component: () => import('@/views/needToBeDealtWith/outbound.vue') |
| | | }, |
| | | { |
| | | path: '/needToBeDealtWith/addWarehousing', |
| | | name: 'addWarehousing', |
| | | meta: { |
| | | title: 'å
¥åº', |
| | | keepAlive: false |
| | | }, |
| | | component: () => import('@/views/needToBeDealtWith/addWarehousing.vue') |
| | | }, |
| | | { |
| | | path: '/needToBeDealtWith/codeScanningWarehousing', |
| | | name: 'codeScanningWarehousing', |
| | | meta: { |
| | |
| | | path: '/productionInspection/manualInspection', |
| | | name: 'manualInspection', |
| | | meta: { |
| | | title: 'æå¨æ£éª', |
| | | title: '巡线', |
| | | keepAlive: true |
| | | }, |
| | | component: () => import('@/views/productionInspection/manualInspection.vue') |
| | | }, |
| | | { |
| | | path: '/productionInspection/manualInspection1', |
| | | name: 'manualInspection1', |
| | | meta: { |
| | | title: 'å·¡æ£', |
| | | keepAlive: true |
| | | }, |
| | | component: () => import('@/views/productionInspection/manualInspection1.vue') |
| | | }, |
| | | { |
| | | path: '/productionInspection/manualInspection2', |
| | | name: 'manualInspection2', |
| | | meta: { |
| | | title: 'å®å·¥æ£', |
| | | keepAlive: true |
| | | }, |
| | | component: () => import('@/views/productionInspection/manualInspection2.vue') |
| | | }, |
| | | { |
| | | path: '/productionInspection/selectWorkOrder', |
| | | name: 'selectWorkOrder', |
| | | meta: { |
| | |
| | | import * as dd from 'dingtalk-jsapi' |
| | | import sha1 from 'js-sha1' |
| | | import store from '@/store' |
| | | |
| | | /** |
| | | * è·åå½åæ¶é´ æ¶é´æ³ |
| | | * @returns {number} |
| | | */ |
| | | export function getTimestamp () { |
| | | return new Date().getTime() |
| | | } |
| | | |
| | | /** |
| | | * è·åéæºå符串 |
| | | * @param {number} len 坿å®é¿åº¦ |
| | | * @returns {string} |
| | | */ |
| | | export function randomString (len: number): string { |
| | | len = len || 32 |
| | | let $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678' |
| | | let maxPos = $chars.length |
| | | let pwd = '' |
| | | for (let i = 0; i < len; i++) { |
| | | pwd += $chars.charAt(Math.floor(Math.random() * maxPos)) |
| | | } |
| | | return pwd |
| | | } |
| | | |
| | | /** |
| | | * æ¼æ¥ç¾åå符串 |
| | | * @param {string} ticket éè¿access_tokenè·åçjsapi_ticket |
| | | * @param {string} noncestr èªå·±çæçéæºå符串 |
| | | * @param {string} timestamp çæç¾åæ¶çæ¶é´æ³ |
| | | * @param {string} urlLink urlå°åè·åcode |
| | | * @param {string} return {*} |
| | | */ |
| | | export function getSignature (ticket: String, noncestr: String, timestamp: String, urlLink: String): String { |
| | | let url = urlLink |
| | | let jsapi_ticket = `jsapi_ticket=${ticket}&noncestr=${noncestr}×tamp=${timestamp}&url=${url}` |
| | | return sha1(jsapi_ticket) |
| | | } |
| | | |
| | | /*** |
| | | * phoneRegular: ææºå·éªè¯ |
| | | * mailboxRegular: é®ç®±éªè¯ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import wx from 'weixin-js-sdk' |
| | | import { Toast } from 'vant' |
| | | import { getTimestamp, randomString, getSignature } from './utils.ts' |
| | | |
| | | class AuthWechat { |
| | | |
| | | /** |
| | | * è·åæµè§å¨å°å |
| | | * */ |
| | | signLink() { |
| | | if (typeof window.entryUrl === 'undefined' || window.entryUrl === '') { |
| | | window.entryUrl = document.location.href |
| | | } |
| | | let url = /(Android)/i.test(navigator.userAgent) ? document.location.href : window.entryUrl; |
| | | return url.split('#')[0] |
| | | } |
| | | |
| | | /** |
| | | * å½åæ¯å¦æ¯å¾®ä¿¡ç¯å¢ |
| | | * */ |
| | | isWeixin() { |
| | | return navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1; |
| | | } |
| | | |
| | | /** |
| | | * åå§å |
| | | * */ |
| | | wechat(ticket) { |
| | | if (!this.isWeixin()) { |
| | | return Toast.fail('å½å䏿¯å¾®ä¿¡ç¯å¢'); |
| | | } |
| | | |
| | | return new Promise((resolve, reject) => { |
| | | let url = this.signLink() |
| | | let timestamp = getTimestamp() |
| | | let nonceStr = randomString() |
| | | let signature = getSignature(ticket, nonceStr, timestamp, url) |
| | | |
| | | wx.config({ |
| | | debug: false, // å¼å¯è°è¯æ¨¡å¼,è°ç¨çææapiçè¿åå¼ä¼å¨å®¢æ·ç«¯alertåºæ¥ï¼è¥è¦æ¥çä¼ å
¥çåæ°ï¼å¯ä»¥å¨pc端æå¼ï¼åæ°ä¿¡æ¯ä¼éè¿logæåºï¼ä»
å¨pcç«¯æ¶æä¼æå°ã |
| | | appId: process.env.VUE_APP_APPID, // å¿
å¡«ï¼å
¬ä¼å·çå¯ä¸æ è¯ |
| | | timestamp, // å¿
å¡«ï¼çæç¾åçæ¶é´æ³ |
| | | nonceStr, // å¿
å¡«ï¼çæç¾åçéæºä¸² |
| | | signature, // å¿
å¡«ï¼ç¾å |
| | | jsApiList: [ |
| | | 'updateAppMessageShareData', // èªå®ä¹âåäº«ç»æåâåâå享å°QQâæé®çå享å
容 |
| | | 'updateTimelineShareData', // èªå®ä¹âåäº«å°æååâåâå享å°QQ空é´âæé®çå享å
容ï¼1.4.0ï¼ |
| | | 'closeWindow', //å
³éå½åç½é¡µçªå£æ¥å£ |
| | | 'chooseWXPay' |
| | | ] |
| | | }) |
| | | wx.ready(res => { |
| | | // 微信SDKåå¤å°±ç»ªåæ§è¡çåè°ã |
| | | // console.log('wx.ready',res); |
| | | resolve(wx, res) |
| | | }) |
| | | wx.error(err => { |
| | | // console.log('wx.error',err) |
| | | reject(wx, err) |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * 微信å享 |
| | | * @param {object} shareObj å享å
容对象 |
| | | * */ |
| | | wxShare(shareObj) { |
| | | if (!this.isWeixin()) { |
| | | return Toast.fail('å½å䏿¯å¾®ä¿¡ç¯å¢'); |
| | | } |
| | | console.log('å享', shareObj) |
| | | let norShare = new Promise((resolve, reject) => { |
| | | wx.ready(() => { |
| | | wx.updateAppMessageShareData({ |
| | | title: shareObj.title, // å享æ é¢ |
| | | desc: shareObj.desc, // å享æè¿° |
| | | link: shareObj.link, // åäº«é¾æ¥ï¼è¯¥é¾æ¥ååæè·¯å¾å¿
é¡»ä¸å½å页é¢å¯¹åºçå
¬ä¼å· JS å®å
¨ååä¸è´ |
| | | imgUrl: shareObj.imgUrl, // åäº«å¾æ |
| | | success: function () { |
| | | resolve('æåäº') |
| | | }, |
| | | fail: function (res) { |
| | | console.log('好åå享 失败', res); |
| | | alert('fail:' + JSON.stringify(res)); |
| | | reject(JSON.stringify(res)) |
| | | } |
| | | }) |
| | | }) |
| | | }) |
| | | let friendShare = new Promise((resolve, reject) => { |
| | | wx.ready(() => { |
| | | wx.updateTimelineShareData({ |
| | | title: shareObj.title, // å享æ é¢ |
| | | desc: shareObj.desc, // å享æè¿° |
| | | link: shareObj.link, // åäº«é¾æ¥ï¼è¯¥é¾æ¥ååæè·¯å¾å¿
é¡»ä¸å½å页é¢å¯¹åºçå
¬ä¼å· JS å®å
¨ååä¸è´ |
| | | imgUrl: shareObj.imgUrl, // åäº«å¾æ |
| | | success: function () { |
| | | resolve('æåäº') |
| | | }, |
| | | fail: function (res) { |
| | | console.log('æååå享 失败', res); |
| | | alert('fail:' + JSON.stringify(res)); |
| | | reject(JSON.stringify(res)) |
| | | } |
| | | }) |
| | | }) |
| | | }) |
| | | return Promise.all([norShare, friendShare]) |
| | | } |
| | | |
| | | wxPay(response) { |
| | | if (!this.isWeixin()) { |
| | | return Toast.fail('å½å䏿¯å¾®ä¿¡ç¯å¢'); |
| | | } |
| | | console.log('æ¯ä»', response); |
| | | return new Promise((resolve, reject) => { |
| | | wx.chooseWXPay({ |
| | | appId: response.appId, |
| | | timestamp: response.timeStamp, // æ¯ä»ç¾åæ¶é´æ³ï¼æ³¨æå¾®ä¿¡ jssdk ä¸çææä½¿ç¨ timestamp åæ®µå为å°åã使æ°ççæ¯ä»åå°çæç¾å使ç¨ç timeStamp åæ®µåé大åå
¶ä¸ç S å符 |
| | | nonceStr: response.nonceStr, // æ¯ä»ç¾åéæºä¸²ï¼ä¸é¿äº 32 ä½ |
| | | package: response.packageValue, // ç»ä¸æ¯ä»æ¥å£è¿åçprepay_idåæ°å¼ï¼æäº¤æ ¼å¼å¦ï¼prepay_id=\*\*\*ï¼ |
| | | signType: response.signType, // 微信æ¯ä»V3çä¼ å
¥ RSA ,微信æ¯ä»V2çä¼ å
¥æ ¼å¼ä¸V2ç»ä¸ä¸åçç¾åæ ¼å¼ä¿æä¸è´ |
| | | paySign: response.paySign, // æ¯ä»ç¾å |
| | | complete: (res) => { |
| | | console.log(res); |
| | | reject(res) |
| | | }, |
| | | success: function (res) { |
| | | // æ¯ä»æååçåè°å½æ° |
| | | console.log(res); |
| | | resolve(res) |
| | | }, |
| | | // cancel: function (err) { |
| | | // reject(err) |
| | | // } |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | export default new AuthWechat(); |
| | |
| | | window.localStorage.setItem('token', res.data) |
| | | let info: any = await getUserInfo() |
| | | if (info.code === 200) { |
| | | // await store.commit('setEntrance', 'H5') |
| | | await store.commit('setEntrance', 'H5') |
| | | await store.commit('setUserInfo', info.data) |
| | | await store.dispatch('getMenuList', 2) |
| | | await router.go(-1) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | æ°å¢å
¥åº |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .page { |
| | | width: 100%; |
| | | height: 100%; |
| | | position: absolute; |
| | | background: #F7F7F7; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="page"> |
| | | æ°å¢åºåº |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .page { |
| | | width: 100%; |
| | | height: 100%; |
| | | position: absolute; |
| | | background: #F7F7F7; |
| | | } |
| | | </style> |
| | |
| | | <div class="inspection_list"> |
| | | <div class="inspection_list_item"> |
| | | <span>æ£éªç±»å</span> |
| | | <div class="right"> |
| | | <!-- <div class="right"> |
| | | <div class="right_item" :class="{ 'active': item.active }" v-for="(item, index) in status" :key="index" @click="changeItem(index, item.id)">{{item.name}}</div> |
| | | </div> --> |
| | | <div class="right"> |
| | | <div class="right_item active">巡线</div> |
| | | <!-- <div class="right_item active" v-if="form.status == '1'">å·¡æ£</div> |
| | | <div class="right_item active" v-if="form.status == '2'">å®å·¥æ£</div> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | onMounted(() => { |
| | | checkAllLists() |
| | | // /productionInspection/manualInspection |
| | | // getListByConditions1() |
| | | // toolingQueryByIds() |
| | | }) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="inspection"> |
| | | <div class="inspection_list"> |
| | | <div class="inspection_list_item"> |
| | | <span>æ£éªç±»å</span> |
| | | <!-- <div class="right"> |
| | | <div class="right_item" :class="{ 'active': item.active }" v-for="(item, index) in status" :key="index" @click="changeItem(index, item.id)">{{item.name}}</div> |
| | | </div> --> |
| | | <div class="right"> |
| | | <!-- <div class="right_item active">巡线</div> --> |
| | | <div class="right_item active">å·¡æ£</div> |
| | | <!-- <div class="right_item active" v-if="form.status == '2'">å®å·¥æ£</div> --> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="x"></div> |
| | | <div class="inspection_list"> |
| | | <div class="inspection_list_item" @click="jumpGD"> |
| | | <span>æ£éªå·¥å</span> |
| | | <div class="right1"> |
| | | <span :style="form.gdmc ? 'color: #000;' : ''">{{ form.gdmc ? form.gdmc : 'ç¹å»éæ©æ£éªå·¥å'}}</span> |
| | | <van-icon name="arrow" color="#999999" size="18" /> |
| | | </div> |
| | | </div> |
| | | <div class="inspection_list_item" v-if="form.gdmc"> |
| | | <span>è®¡åæ°é</span> |
| | | <div class="right1"> |
| | | <span style="color: black;">{{data.info.planNum}}{{data.info.umodel ? data.info.umodel.name : ''}}</span> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="inspection_list_item" @click="openGZ"> |
| | | <span>æ£éªå·¥è£
</span> |
| | | <div class="right1"> |
| | | <span :style="form.jygzmc ? 'color: #000' : ''">{{ form.jygzmc ? form.jygzmc : 'ç¹å»éæ©æ£éªå·¥è£
'}}</span> |
| | | <van-icon name="arrow" color="#999999" size="18" /> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | <div class="x"></div> |
| | | <div class="inspection_list"> |
| | | <div class="inspection_list_item"> |
| | | <span>è¯åæ°</span> |
| | | <div class="right1"> |
| | | <input type="number" v-model="form.hgsl" placeholder="0" /> |
| | | <span class="dw" v-if="data.info.umodel">{{data.info.umodel.name}}</span> |
| | | </div> |
| | | </div> |
| | | <div class="inspection_list_item"> |
| | | <span>ä¸è¯æ°é</span> |
| | | <div class="right1"> |
| | | <input type="number" v-model="form.blsl" placeholder="0" /> |
| | | <span class="dw" v-if="data.info.umodel">{{data.info.umodel.name}}</span> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="inspection_list_item" @click="openBLGZ" v-show="form.blsl > 0"> |
| | | <span>ä¸è¯å·¥è£
</span> |
| | | <div class="right1"> |
| | | <span :style="form.blgzmc ? 'color: #000;' : ''">{{ form.blgzmc ? form.blgzmc : 'ç¹å»éæ©å·¥è£
'}}</span> |
| | | <van-icon name="arrow" color="#999999" size="18" /> |
| | | </div> |
| | | </div> --> |
| | | <div class="inspection_list_item" @click="openBL" v-show="form.blsl > 0"> |
| | | <span>ä¸è¯è¯´æ</span> |
| | | <div class="right1"> |
| | | <span :style="form.blsm ? 'color: #000;' : ''">{{ form.blsm ? form.blsm : 'ç¹å»éæ©ä¸è¯åå '}}</span> |
| | | <van-icon name="arrow" color="#999999" size="18" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="inspection_footer"> |
| | | <button class="inspection_footer_sub" @click="submit" v-preventReClick>æäº¤</button> |
| | | </div> |
| | | <!-- ä¸è¯è¯´æ --> |
| | | <van-popup v-model:show="data.show1" position="bottom" round :style="{ height: '50%' }"> |
| | | <van-picker |
| | | title="è¯·éæ©ä¸è¯è¯´æ" |
| | | :columns="data.columns1" |
| | | @confirm="onConfirm1" |
| | | @cancel="onCancel1" |
| | | /> |
| | | </van-popup> |
| | | <!-- å·¥è£
--> |
| | | <Tooling :show="gzShow1" :classification="true" :statusname="'1,2,3'" :attribute="Attribute.HG" @close="close1" @value="getValue1" /> |
| | | <!-- ä¸è¯å·¥è£
--> |
| | | <Tooling :show="gzShow" :attribute="Attribute.BF + ',' + Attribute.BL" @close="close" @value="getValue" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref, reactive, onMounted, onActivated } from 'vue' |
| | | import { useRouter } from "vue-router" |
| | | import { Toast } from 'vant' |
| | | import { REGULAR } from '@/utils/utils' |
| | | import { Attribute } from '@/enum' |
| | | import { createStandard } from '@/apis/QualityAPI' |
| | | import { checkAllList, getListByCondition, toolingQueryById } from "@/apis/WorkOrderAPI" |
| | | import Tooling from '@/components/common/Tooling.vue' |
| | | |
| | | const router = useRouter() |
| | | |
| | | let gzShow = ref<boolean>(false) |
| | | |
| | | let gzShow1 = ref<boolean>(false) |
| | | |
| | | let data = reactive<any>({ |
| | | info: {}, |
| | | show1: false, |
| | | columns: [], |
| | | columns1: [] |
| | | }) |
| | | |
| | | let form = reactive({ |
| | | status: '1', |
| | | gdid: '', |
| | | gdmc: '', |
| | | jygz: '', |
| | | jygzmc: '', |
| | | hgsl: 0, |
| | | blsl: 0, |
| | | blgz: '', |
| | | blgzmc: '', |
| | | blsm: '', |
| | | dw: '' |
| | | }) |
| | | |
| | | let status = ref<Array<object>>([ |
| | | { id: '0', name: '巡线', active: true }, |
| | | { id: '1', name: 'å·¡æ£', active: false }, |
| | | { id: '2', name: 'å®å·¥æ£', active: false } |
| | | ]) |
| | | |
| | | // å
³éä¸è¯å·¥è£
|
| | | const close = () => { |
| | | gzShow.value = false |
| | | } |
| | | |
| | | // å
³éå·¥è£
|
| | | const close1 = () => { |
| | | gzShow1.value = false |
| | | } |
| | | |
| | | // è·åä¸è¯å·¥è£
æ°æ® |
| | | const getValue = (item: any) => { |
| | | form.blgzmc = item.code |
| | | form.blgz = item.id |
| | | gzShow.value = false |
| | | } |
| | | |
| | | // è·åå·¥è£
æ°æ® |
| | | const getValue1 = (item: any) => { |
| | | form.dw = item.umodelData |
| | | form.jygz = item.id |
| | | form.jygzmc = item.code |
| | | gzShow1.value = false |
| | | } |
| | | |
| | | // æå¼æ£éªå·¥è£
|
| | | const openGZ = () => { |
| | | gzShow1.value = true |
| | | } |
| | | |
| | | // å»éæ©è®¾å¤ |
| | | const jumpGD = () => { |
| | | router.push({ name: 'selectWorkOrder' }) |
| | | } |
| | | |
| | | const openBL = () => { |
| | | data.show1 = true |
| | | } |
| | | |
| | | const openBLGZ = () => { |
| | | gzShow.value = true |
| | | } |
| | | |
| | | const onConfirm1 = (value: any): void => { |
| | | form.blsm = value.text |
| | | data.show1 = false |
| | | } |
| | | |
| | | const onCancel1 = () => { |
| | | data.show1 = false |
| | | } |
| | | |
| | | // åæ¢ç¶æ |
| | | const changeItem = (i: number, id: string): void => { |
| | | status.value.forEach((item: any, index: number) => { |
| | | item.active = i === index; |
| | | }) |
| | | form.status = id |
| | | } |
| | | |
| | | // æäº¤ |
| | | const submit = () => { |
| | | if (!form.gdid) return Toast.fail({ message: 'å·¥åä¸è½ä¸ºç©º' }) |
| | | // if (!form.jygz) return Toast.fail({ message: 'æ£éªå·¥è£
ä¸è½ä¸ºç©º' }) |
| | | if (form.hgsl || form.blsl) { |
| | | if (form.hgsl) { |
| | | if (form.dw == '0') { // æ´æ° |
| | | if (!REGULAR.positiveInteger.test(form.hgsl as never)) return Toast.fail({ message: 'è¯åæ°éåªè½ä¸ºæ£æ´æ°' }) |
| | | } else if (form.dw == '1') { // å°æ° |
| | | if (!REGULAR.number.test(form.hgsl as never)) { |
| | | return Toast.fail({ message: 'è¯åæ°éåªè½ä¸ºæ£æ´æ°æåä½å°æ°' }) |
| | | } |
| | | } |
| | | } |
| | | if (form.blsl) { |
| | | if (form.dw == '0') { // æ´æ° |
| | | if (!REGULAR.positiveInteger.test(form.blsl as never)) return Toast.fail({ message: 'ä¸è¯æ°éåªè½ä¸ºæ£æ´æ°' }) |
| | | } else if (form.dw == '1') { // å°æ° |
| | | if (!REGULAR.number.test(form.blsl as never)) { |
| | | return Toast.fail({ message: 'ä¸è¯æ°éåªè½ä¸ºæ£æ´æ°æåä½å°æ°' }) |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | return Toast.fail({ message: 'è¯ååä¸è¯ä¸è½åæ¶ä¸ºç©º' }) |
| | | } |
| | | let total = (form.hgsl ? form.hgsl : 0) + (form.blsl ? form.blsl : 0) |
| | | if (total > data.info.planNum) { |
| | | return Toast.fail({ message: 'åæ ¼ä¸è¯ç¸å ä¸è½è¶
è¿è®¡åæ°é' }) |
| | | } |
| | | if (Number(form.blsl) > 0) { |
| | | // if (!form.blgz) return Toast.fail({ message: 'ä¸è¯å·¥è£
ä¸è½ä¸ºç©º' }) |
| | | if (!form.blsm) return Toast.fail({ message: 'ä¸è¯è¯´æä¸è½ä¸ºç©º' }) |
| | | } |
| | | createStandard({ |
| | | workorderId: form.gdid, |
| | | // appliancesId: form.jygz, |
| | | qualifiedNum: form.hgsl ? form.hgsl : 0, |
| | | unqualifiedNum: form.blsl ? form.blsl : 0, |
| | | // qualifiedApplianceId: form.blgz, |
| | | checkInfo: form.blsm, |
| | | checkType: form.status |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | Toast.success({ message: 'æ£éªæåï¼', duration: 2000, forbidClick: true }) |
| | | setTimeout(() => { |
| | | router.go(-1) |
| | | }, 2000) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // ä¸è¯åå æ°æ® |
| | | const checkAllLists = () => { |
| | | checkAllList({ bmodelCateType: '3' }) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | res.data.forEach((item: any) => { |
| | | data.columns1.push({ text: item.combinationName, id: item.id }) |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢ä¸è¯/æ¥åºå·¥è£
|
| | | const getListByConditions1 = () => { |
| | | data.columns2 = [] |
| | | getListByCondition({ |
| | | smodelLabel: 'APPLIANCE_OFFTEST,APPLIANCE_USELESS' |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | res.data.forEach((item: any) => { |
| | | data.columns2.push({ text: '[' + item.smodelCode + '] ' + item.code, id: item.id }) |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // è·åææå·¥è£
|
| | | const toolingQueryByIds = () => { |
| | | data.columns3 = [] |
| | | toolingQueryById({}) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | res.data.forEach((item: any) => { |
| | | data.columns3.push({ text: item.code, id: item.id }) |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | checkAllLists() |
| | | // /productionInspection/manualInspection |
| | | // getListByConditions1() |
| | | // toolingQueryByIds() |
| | | }) |
| | | |
| | | onActivated(() => { |
| | | let res: any = localStorage.getItem('workOder') |
| | | if (res) { |
| | | form.gdmc = JSON.parse(res).mmodel.name + '-' + JSON.parse(res).pgmodel.name |
| | | form.gdid = JSON.parse(res).id |
| | | data.info = JSON.parse(res) |
| | | localStorage.removeItem('workOder') |
| | | } |
| | | }) |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .inspection { |
| | | width: 100%; |
| | | height: 100%; |
| | | position: absolute; |
| | | background: #F7F7F7; |
| | | .x { |
| | | height: 20px; |
| | | } |
| | | .inspection_list { |
| | | padding: 0 30px; |
| | | background: white; |
| | | .inspection_list_item { |
| | | height: 98px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | border-bottom: 1PX solid #E5E5E5; |
| | | &:last-child { |
| | | border: none; |
| | | } |
| | | span { |
| | | font-size: 30px; |
| | | font-weight: 400; |
| | | color: #222222; |
| | | } |
| | | .right1 { |
| | | display: flex; |
| | | align-items: center; |
| | | span { |
| | | font-size: 28px; |
| | | font-weight: 400; |
| | | color: #999999; |
| | | margin-right: 10px; |
| | | } |
| | | input { |
| | | width: 180px; |
| | | height: 60px; |
| | | border-radius: 8px; |
| | | border: 1PX solid #CCCCCC; |
| | | margin-right: 10px; |
| | | padding: 0 30px; |
| | | box-sizing: border-box; |
| | | font-size: 28px; |
| | | } |
| | | input::-webkit-input-placeholder { |
| | | font-size: 28px; |
| | | font-weight: 400; |
| | | color: #999999; |
| | | } |
| | | .dw { |
| | | font-size: 28px; |
| | | font-weight: 400; |
| | | color: #666666; |
| | | } |
| | | } |
| | | .right { |
| | | display: flex; |
| | | align-items: center; |
| | | .active { |
| | | background: $nav-color !important; |
| | | color: #ffffff !important; |
| | | } |
| | | .right_item { |
| | | padding: 18px 32px; |
| | | background: #F2F2F2; |
| | | border-radius: 8px; |
| | | font-size: 26px; |
| | | font-weight: 400; |
| | | color: #333333; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | margin-left: 20px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .inspection_footer { |
| | | position: fixed; |
| | | bottom: 0; |
| | | left: 0; |
| | | width: calc(100% - 60px); |
| | | padding: 30px 30px 68px 30px; |
| | | background: #F7F7F7; |
| | | .inspection_footer_sub { |
| | | width: 100%; |
| | | height: 88px; |
| | | background: #4275FC; |
| | | box-shadow: 0 0 12px 0 rgba(0,0,0,0.0800); |
| | | border-radius: 8px; |
| | | font-size: 30px; |
| | | font-weight: 500; |
| | | color: #FFFFFF; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | border: none; |
| | | } |
| | | } |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="inspection"> |
| | | <div class="inspection_list"> |
| | | <div class="inspection_list_item"> |
| | | <span>æ£éªç±»å</span> |
| | | <!-- <div class="right"> |
| | | <div class="right_item" :class="{ 'active': item.active }" v-for="(item, index) in status" :key="index" @click="changeItem(index, item.id)">{{item.name}}</div> |
| | | </div> --> |
| | | <div class="right"> |
| | | <!-- <div class="right_item active">巡线</div> --> |
| | | <!-- <div class="right_item active">å·¡æ£</div> --> |
| | | <div class="right_item active">å®å·¥æ£</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="x"></div> |
| | | <div class="inspection_list"> |
| | | <div class="inspection_list_item" @click="jumpGD"> |
| | | <span>æ£éªå·¥å</span> |
| | | <div class="right1"> |
| | | <span :style="form.gdmc ? 'color: #000;' : ''">{{ form.gdmc ? form.gdmc : 'ç¹å»éæ©æ£éªå·¥å'}}</span> |
| | | <van-icon name="arrow" color="#999999" size="18" /> |
| | | </div> |
| | | </div> |
| | | <div class="inspection_list_item" v-if="form.gdmc"> |
| | | <span>è®¡åæ°é</span> |
| | | <div class="right1"> |
| | | <span style="color: black;">{{data.info.planNum}}{{data.info.umodel ? data.info.umodel.name : ''}}</span> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="inspection_list_item" @click="openGZ"> |
| | | <span>æ£éªå·¥è£
</span> |
| | | <div class="right1"> |
| | | <span :style="form.jygzmc ? 'color: #000' : ''">{{ form.jygzmc ? form.jygzmc : 'ç¹å»éæ©æ£éªå·¥è£
'}}</span> |
| | | <van-icon name="arrow" color="#999999" size="18" /> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | <div class="x"></div> |
| | | <div class="inspection_list"> |
| | | <div class="inspection_list_item"> |
| | | <span>è¯åæ°</span> |
| | | <div class="right1"> |
| | | <input type="number" v-model="form.hgsl" placeholder="0" /> |
| | | <span class="dw" v-if="data.info.umodel">{{data.info.umodel.name}}</span> |
| | | </div> |
| | | </div> |
| | | <div class="inspection_list_item"> |
| | | <span>ä¸è¯æ°é</span> |
| | | <div class="right1"> |
| | | <input type="number" v-model="form.blsl" placeholder="0" /> |
| | | <span class="dw" v-if="data.info.umodel">{{data.info.umodel.name}}</span> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="inspection_list_item" @click="openBLGZ" v-show="form.blsl > 0"> |
| | | <span>ä¸è¯å·¥è£
</span> |
| | | <div class="right1"> |
| | | <span :style="form.blgzmc ? 'color: #000;' : ''">{{ form.blgzmc ? form.blgzmc : 'ç¹å»éæ©å·¥è£
'}}</span> |
| | | <van-icon name="arrow" color="#999999" size="18" /> |
| | | </div> |
| | | </div> --> |
| | | <div class="inspection_list_item" @click="openBL" v-show="form.blsl > 0"> |
| | | <span>ä¸è¯è¯´æ</span> |
| | | <div class="right1"> |
| | | <span :style="form.blsm ? 'color: #000;' : ''">{{ form.blsm ? form.blsm : 'ç¹å»éæ©ä¸è¯åå '}}</span> |
| | | <van-icon name="arrow" color="#999999" size="18" /> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="inspection_footer"> |
| | | <button class="inspection_footer_sub" @click="submit" v-preventReClick>æäº¤</button> |
| | | </div> |
| | | <!-- ä¸è¯è¯´æ --> |
| | | <van-popup v-model:show="data.show1" position="bottom" round :style="{ height: '50%' }"> |
| | | <van-picker |
| | | title="è¯·éæ©ä¸è¯è¯´æ" |
| | | :columns="data.columns1" |
| | | @confirm="onConfirm1" |
| | | @cancel="onCancel1" |
| | | /> |
| | | </van-popup> |
| | | <!-- å·¥è£
--> |
| | | <Tooling :show="gzShow1" :classification="true" :statusname="'1,2,3'" :attribute="Attribute.HG" @close="close1" @value="getValue1" /> |
| | | <!-- ä¸è¯å·¥è£
--> |
| | | <Tooling :show="gzShow" :attribute="Attribute.BF + ',' + Attribute.BL" @close="close" @value="getValue" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { ref, reactive, onMounted, onActivated } from 'vue' |
| | | import { useRouter } from "vue-router" |
| | | import { Toast } from 'vant' |
| | | import { REGULAR } from '@/utils/utils' |
| | | import { Attribute } from '@/enum' |
| | | import { createStandard } from '@/apis/QualityAPI' |
| | | import { checkAllList, getListByCondition, toolingQueryById } from "@/apis/WorkOrderAPI" |
| | | import Tooling from '@/components/common/Tooling.vue' |
| | | |
| | | const router = useRouter() |
| | | |
| | | let gzShow = ref<boolean>(false) |
| | | |
| | | let gzShow1 = ref<boolean>(false) |
| | | |
| | | let data = reactive<any>({ |
| | | info: {}, |
| | | show1: false, |
| | | columns: [], |
| | | columns1: [] |
| | | }) |
| | | |
| | | let form = reactive({ |
| | | status: '2', |
| | | gdid: '', |
| | | gdmc: '', |
| | | jygz: '', |
| | | jygzmc: '', |
| | | hgsl: 0, |
| | | blsl: 0, |
| | | blgz: '', |
| | | blgzmc: '', |
| | | blsm: '', |
| | | dw: '' |
| | | }) |
| | | |
| | | let status = ref<Array<object>>([ |
| | | { id: '0', name: '巡线', active: true }, |
| | | { id: '1', name: 'å·¡æ£', active: false }, |
| | | { id: '2', name: 'å®å·¥æ£', active: false } |
| | | ]) |
| | | |
| | | // å
³éä¸è¯å·¥è£
|
| | | const close = () => { |
| | | gzShow.value = false |
| | | } |
| | | |
| | | // å
³éå·¥è£
|
| | | const close1 = () => { |
| | | gzShow1.value = false |
| | | } |
| | | |
| | | // è·åä¸è¯å·¥è£
æ°æ® |
| | | const getValue = (item: any) => { |
| | | form.blgzmc = item.code |
| | | form.blgz = item.id |
| | | gzShow.value = false |
| | | } |
| | | |
| | | // è·åå·¥è£
æ°æ® |
| | | const getValue1 = (item: any) => { |
| | | form.dw = item.umodelData |
| | | form.jygz = item.id |
| | | form.jygzmc = item.code |
| | | gzShow1.value = false |
| | | } |
| | | |
| | | // æå¼æ£éªå·¥è£
|
| | | const openGZ = () => { |
| | | gzShow1.value = true |
| | | } |
| | | |
| | | // å»éæ©è®¾å¤ |
| | | const jumpGD = () => { |
| | | router.push({ name: 'selectWorkOrder' }) |
| | | } |
| | | |
| | | const openBL = () => { |
| | | data.show1 = true |
| | | } |
| | | |
| | | const openBLGZ = () => { |
| | | gzShow.value = true |
| | | } |
| | | |
| | | const onConfirm1 = (value: any): void => { |
| | | form.blsm = value.text |
| | | data.show1 = false |
| | | } |
| | | |
| | | const onCancel1 = () => { |
| | | data.show1 = false |
| | | } |
| | | |
| | | // åæ¢ç¶æ |
| | | const changeItem = (i: number, id: string): void => { |
| | | status.value.forEach((item: any, index: number) => { |
| | | item.active = i === index; |
| | | }) |
| | | form.status = id |
| | | } |
| | | |
| | | // æäº¤ |
| | | const submit = () => { |
| | | if (!form.gdid) return Toast.fail({ message: 'å·¥åä¸è½ä¸ºç©º' }) |
| | | // if (!form.jygz) return Toast.fail({ message: 'æ£éªå·¥è£
ä¸è½ä¸ºç©º' }) |
| | | if (form.hgsl || form.blsl) { |
| | | if (form.hgsl) { |
| | | if (form.dw == '0') { // æ´æ° |
| | | if (!REGULAR.positiveInteger.test(form.hgsl as never)) return Toast.fail({ message: 'è¯åæ°éåªè½ä¸ºæ£æ´æ°' }) |
| | | } else if (form.dw == '1') { // å°æ° |
| | | if (!REGULAR.number.test(form.hgsl as never)) { |
| | | return Toast.fail({ message: 'è¯åæ°éåªè½ä¸ºæ£æ´æ°æåä½å°æ°' }) |
| | | } |
| | | } |
| | | } |
| | | if (form.blsl) { |
| | | if (form.dw == '0') { // æ´æ° |
| | | if (!REGULAR.positiveInteger.test(form.blsl as never)) return Toast.fail({ message: 'ä¸è¯æ°éåªè½ä¸ºæ£æ´æ°' }) |
| | | } else if (form.dw == '1') { // å°æ° |
| | | if (!REGULAR.number.test(form.blsl as never)) { |
| | | return Toast.fail({ message: 'ä¸è¯æ°éåªè½ä¸ºæ£æ´æ°æåä½å°æ°' }) |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | | return Toast.fail({ message: 'è¯ååä¸è¯ä¸è½åæ¶ä¸ºç©º' }) |
| | | } |
| | | let total = (form.hgsl ? form.hgsl : 0) + (form.blsl ? form.blsl : 0) |
| | | if (total > data.info.planNum) { |
| | | return Toast.fail({ message: 'åæ ¼ä¸è¯ç¸å ä¸è½è¶
è¿è®¡åæ°é' }) |
| | | } |
| | | if (Number(form.blsl) > 0) { |
| | | // if (!form.blgz) return Toast.fail({ message: 'ä¸è¯å·¥è£
ä¸è½ä¸ºç©º' }) |
| | | if (!form.blsm) return Toast.fail({ message: 'ä¸è¯è¯´æä¸è½ä¸ºç©º' }) |
| | | } |
| | | createStandard({ |
| | | workorderId: form.gdid, |
| | | // appliancesId: form.jygz, |
| | | qualifiedNum: form.hgsl ? form.hgsl : 0, |
| | | unqualifiedNum: form.blsl ? form.blsl : 0, |
| | | // qualifiedApplianceId: form.blgz, |
| | | checkInfo: form.blsm, |
| | | checkType: form.status |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | Toast.success({ message: 'æ£éªæåï¼', duration: 2000, forbidClick: true }) |
| | | setTimeout(() => { |
| | | router.go(-1) |
| | | }, 2000) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // ä¸è¯åå æ°æ® |
| | | const checkAllLists = () => { |
| | | checkAllList({ bmodelCateType: '3' }) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | res.data.forEach((item: any) => { |
| | | data.columns1.push({ text: item.combinationName, id: item.id }) |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // æ¥è¯¢ä¸è¯/æ¥åºå·¥è£
|
| | | const getListByConditions1 = () => { |
| | | data.columns2 = [] |
| | | getListByCondition({ |
| | | smodelLabel: 'APPLIANCE_OFFTEST,APPLIANCE_USELESS' |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | res.data.forEach((item: any) => { |
| | | data.columns2.push({ text: '[' + item.smodelCode + '] ' + item.code, id: item.id }) |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // è·åææå·¥è£
|
| | | const toolingQueryByIds = () => { |
| | | data.columns3 = [] |
| | | toolingQueryById({}) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | res.data.forEach((item: any) => { |
| | | data.columns3.push({ text: item.code, id: item.id }) |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | onMounted(() => { |
| | | checkAllLists() |
| | | // /productionInspection/manualInspection |
| | | // getListByConditions1() |
| | | // toolingQueryByIds() |
| | | }) |
| | | |
| | | onActivated(() => { |
| | | let res: any = localStorage.getItem('workOder') |
| | | if (res) { |
| | | form.gdmc = JSON.parse(res).mmodel.name + '-' + JSON.parse(res).pgmodel.name |
| | | form.gdid = JSON.parse(res).id |
| | | data.info = JSON.parse(res) |
| | | localStorage.removeItem('workOder') |
| | | } |
| | | }) |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .inspection { |
| | | width: 100%; |
| | | height: 100%; |
| | | position: absolute; |
| | | background: #F7F7F7; |
| | | .x { |
| | | height: 20px; |
| | | } |
| | | .inspection_list { |
| | | padding: 0 30px; |
| | | background: white; |
| | | .inspection_list_item { |
| | | height: 98px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | border-bottom: 1PX solid #E5E5E5; |
| | | &:last-child { |
| | | border: none; |
| | | } |
| | | span { |
| | | font-size: 30px; |
| | | font-weight: 400; |
| | | color: #222222; |
| | | } |
| | | .right1 { |
| | | display: flex; |
| | | align-items: center; |
| | | span { |
| | | font-size: 28px; |
| | | font-weight: 400; |
| | | color: #999999; |
| | | margin-right: 10px; |
| | | } |
| | | input { |
| | | width: 180px; |
| | | height: 60px; |
| | | border-radius: 8px; |
| | | border: 1PX solid #CCCCCC; |
| | | margin-right: 10px; |
| | | padding: 0 30px; |
| | | box-sizing: border-box; |
| | | font-size: 28px; |
| | | } |
| | | input::-webkit-input-placeholder { |
| | | font-size: 28px; |
| | | font-weight: 400; |
| | | color: #999999; |
| | | } |
| | | .dw { |
| | | font-size: 28px; |
| | | font-weight: 400; |
| | | color: #666666; |
| | | } |
| | | } |
| | | .right { |
| | | display: flex; |
| | | align-items: center; |
| | | .active { |
| | | background: $nav-color !important; |
| | | color: #ffffff !important; |
| | | } |
| | | .right_item { |
| | | padding: 18px 32px; |
| | | background: #F2F2F2; |
| | | border-radius: 8px; |
| | | font-size: 26px; |
| | | font-weight: 400; |
| | | color: #333333; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | margin-left: 20px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .inspection_footer { |
| | | position: fixed; |
| | | bottom: 0; |
| | | left: 0; |
| | | width: calc(100% - 60px); |
| | | padding: 30px 30px 68px 30px; |
| | | background: #F7F7F7; |
| | | .inspection_footer_sub { |
| | | width: 100%; |
| | | height: 88px; |
| | | background: #4275FC; |
| | | box-shadow: 0 0 12px 0 rgba(0,0,0,0.0800); |
| | | border-radius: 8px; |
| | | font-size: 30px; |
| | | font-weight: 500; |
| | | color: #FFFFFF; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | border: none; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <div class="wx_login_list"> |
| | | <div class="wx_login_list_item"> |
| | | <img src="@/assets/icon/login_ic_code@2x.png" alt="" /> |
| | | <input type="text" placeholder="ä¼ä¸ä»£ç " /> |
| | | <input type="text" v-model="from.companyId" placeholder="ä¼ä¸ä»£ç " /> |
| | | </div> |
| | | <div class="wx_login_list_item"> |
| | | <img src="@/assets/icon/login_ic_phone@2x.png" alt="" /> |
| | | <input type="text" placeholder="ææºå·" /> |
| | | <input type="text" maxlength="11" v-model="from.username" placeholder="ææºå·" /> |
| | | </div> |
| | | <div class="wx_login_list_item"> |
| | | <img src="@/assets/icon/login_ic_password@2x.png" alt="" /> |
| | | <input type="text" placeholder="å¯ç " /> |
| | | <input type="password" v-model="from.password" placeholder="å¯ç " /> |
| | | </div> |
| | | </div> |
| | | <div class="wx_login_footer"> |
| | | <div class="wx_login_footer_btn">ç«å³ç»å½</div> |
| | | <div class="wx_login_footer_btn" @click="login">ç«å³ç»å½</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { onMounted, reactive } from 'vue'; |
| | | import { useRoute, useRouter } from 'vue-router'; |
| | | import { useStore } from 'vuex'; |
| | | import { wxLogin, wxAccountLogin, getUserInfo } from '@/apis/index'; |
| | | import { Toast } from 'vant'; |
| | | |
| | | const route = useRoute() |
| | | const router = useRouter() |
| | | const store = useStore() |
| | | |
| | | let from: any = reactive({ |
| | | openid: '', |
| | | unionid: '', |
| | | companyId: '', |
| | | username: '', |
| | | password: '' |
| | | }) |
| | | |
| | | const login = async () => { |
| | | if (!from.openid) return Toast('openidä¸è½ä¸ºç©º') |
| | | if (!from.unionid) return Toast('unionidä¸è½ä¸ºç©º') |
| | | if (!from.companyId) return Toast('ä¼ä¸ä»£ç ä¸è½ä¸ºç©º') |
| | | if (!from.username) return Toast('ææºå·ä¸è½ä¸ºç©º') |
| | | if (!from.password) return Toast('å¯ç ä¸è½ä¸ºç©º') |
| | | Toast.loading({ |
| | | message: 'ç»å½ä¸...', |
| | | forbidClick: true |
| | | }); |
| | | let res = await wxAccountLogin(from) |
| | | if (res.code === 200) { |
| | | let info = await getUserInfo() |
| | | if (info.code === 200) { |
| | | await store.commit('setEntrance', 'DD') |
| | | await store.commit('setUserInfo', info.data) |
| | | await store.dispatch('getMenuList', 2) |
| | | await router.replace('/workbench') |
| | | } |
| | | } |
| | | Toast.clear(); |
| | | } |
| | | |
| | | onMounted(() => { |
| | | wxLogin({ code: route.query.code }) |
| | | .then(async (res) => { |
| | | if (res.code === 200) { |
| | | // å
ç»å½ï¼ç´æ¥è·³é¦é¡µ |
| | | if (res.data.loginStatus == 0) { |
| | | let info = await getUserInfo() |
| | | if (info.code === 200) { |
| | | await store.commit('setEntrance', 'DD') |
| | | await store.commit('setUserInfo', info.data) |
| | | await store.dispatch('getMenuList', 2) |
| | | await router.replace('/workbench') |
| | | } |
| | | } else { |
| | | from.openid = res.data.openid |
| | | from.unionid = res.data.unionid |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |