| | |
| | | <template> |
| | | <div class="info"> |
| | | <div class="info_portrait"> |
| | | <img :src="store.state.userInfo.avatar ? store.state.userInfo.avatar : avatar" alt="" /> |
| | | <!-- store.state.userInfo.avatar ? store.state.userInfo.avatar : --> |
| | | <img :src="avatar" alt="" /> |
| | | <span>{{store.state.userInfo.companyUser.name}}</span> |
| | | </div> |
| | | <div class="info_list"> |
| | |
| | | <template> |
| | | <div class="box"> |
| | | <div class="box_info"> |
| | | <img :src="store.state.userInfo.avatar ? store.state.userInfo.avatar : avatar" alt="" /> |
| | | <!-- store.state.userInfo.avatar ? store.state.userInfo.avatar : --> |
| | | <img :src="avatar" alt="" /> |
| | | <div class="box_info_box"> |
| | | <span>{{store.state.userInfo.companyUser ? store.state.userInfo.companyUser.name : ''}}</span> |
| | | <div class="box_info_box_x" @click="switchOrganization"> |
| | |
| | | decimal: /^0$|^[1-9]\d{0,15}$|^[1-9]\d{0,15}\.{1}\d{1,4}$|^0\.{1}\d{1,4}$/g,
|
| | | positiveIntegerDecimal: /^([1-9][0-9]*|0)(\.[0-9]?[1-9][1-9][1-9])?$/,
|
| | | number: /^\d+(?:\.\d{1,4})?$/,
|
| | | fileType: [
|
| | | { name: '.png', type: 2 },
|
| | | { name: '.PNG', type: 2 },
|
| | | { name: '.jpg', type: 2 },
|
| | | { name: '.JPG', type: 2 },
|
| | | { name: '.jpeg', type: 2 },
|
| | | { name: '.JPEG', type: 2 },
|
| | | { name: '.mp4', type: 1 }
|
| | | ],
|
| | | Attribute: {
|
| | | HH: 'APPLIANCE_MIX',
|
| | | HG: 'APPLIANCE_ONTEST',
|
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="preview"> |
| | | <div class="preview_close" @click="closes"> |
| | | <u-icon name="close" size="20"></u-icon> |
| | | </div> |
| | | <div class="preview_content"> |
| | | <u-swiper :list="list" :current="current"></u-swiper> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | props: { |
| | | list: { |
| | | type: Array, |
| | | default: [] |
| | | }, |
| | | current: { |
| | | type: Number, |
| | | default: 0 |
| | | } |
| | | }, |
| | | methods: { |
| | | closes() { |
| | | this.$emit('close') |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view> |
| | | <view class="mask_area" @click="handleMaskClick" v-if="show"> |
| | | <view class="content_area" @click.stop> |
| | | <view class="search_area"> |
| | | <input class="" inputmode="search" type="text" placeholder="请è¾å
¥å
³é®å" @confirm="handleSearch" /> |
| | | </view> |
| | | <scroll-view class="list_area" scroll-y="true"> |
| | | <view> |
| | | <view class="list_item" v-for="item,index in dataList" :key="index" @click="handleSelect(item)"> |
| | | {{item.name}} |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | props: { |
| | | show: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | dataList: { |
| | | type: Array, |
| | | default: function() { |
| | | return [] |
| | | } |
| | | } |
| | | }, |
| | | name: "yty-data-picker", |
| | | data() { |
| | | return { |
| | | |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleMaskClick() { |
| | | this.$emit('close') |
| | | }, |
| | | handleSelect(item) { |
| | | this.$emit('select', item) |
| | | }, |
| | | handleSearch(event) { |
| | | this.$emit('search', event.detail.value) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .mask_area { |
| | | position: fixed; |
| | | top: 0; |
| | | left: 0; |
| | | z-index: 999; |
| | | width: 100%; |
| | | height: 100vh; |
| | | background: rgba(0, 0, 0, 0.6); |
| | | } |
| | | |
| | | .content_area { |
| | | position: fixed; |
| | | bottom: 0; |
| | | left: 0; |
| | | z-index: 1000; |
| | | width: 100%; |
| | | height: 60vh; |
| | | background: #fff; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | animation: dialog-fade-in 0.3s; |
| | | } |
| | | |
| | | .search_area { |
| | | display: flex; |
| | | align-items: center; |
| | | width: 100%; |
| | | height: 80rpx; |
| | | background-color: #f9f9f9; |
| | | border-radius: 40rpx; |
| | | margin-top: 20rpx; |
| | | padding: 0 30rpx; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .search_icon { |
| | | width: 40rpx; |
| | | height: 40rpx; |
| | | margin: 0 15rpx 0 10rpx; |
| | | } |
| | | |
| | | .list_area { |
| | | width: 95%; |
| | | height: 80%; |
| | | margin-top: 20rpx; |
| | | } |
| | | |
| | | .list_item { |
| | | padding: 20rpx; |
| | | border-bottom: 1px solid #f5f5f5 |
| | | } |
| | | |
| | | @keyframes dialog-fade-in { |
| | | 0% { |
| | | transform: translate3d(0, 100%, 0); |
| | | } |
| | | |
| | | 100% { |
| | | transform: translate3d(0, 0, 0); |
| | | } |
| | | } |
| | | </style> |
| | |
| | | { |
| | | "dependencies": { |
| | | "vant": "^4.6.6" |
| | | "id": "yty-data-picker", |
| | | "name": "卿å è½½æ°æ®éæ©å¨(åéãæç´¢ãå è½½æ´å¤ãå页å è½½)", |
| | | "displayName": "卿å è½½æ°æ®éæ©å¨(åéãæç´¢ãå è½½æ´å¤ãå页å è½½)", |
| | | "version": "1.0.0", |
| | | "description": "卿å è½½æ°æ®éæ©å¨(æ¯æåéãæ¥å£æç´¢ãæ¥å£å页å è½½)", |
| | | "keywords": [ |
| | | "åéãçéã卿å è½½ãå¼¹åºæ¡ãå页å è½½" |
| | | ], |
| | | "dcloudext": { |
| | | "category": [ |
| | | "å端ç»ä»¶", |
| | | "éç¨ç»ä»¶" |
| | | ] |
| | | } |
| | | } |
| | |
| | | <view class="box1"> |
| | | <!-- 设å¤+æ¥æ --> |
| | | <view class="box_list"> |
| | | <view class="box_list_item" @click="open"> |
| | | <view class="box_list_item" @click="show = true"> |
| | | <view class="box_list_item_left"> |
| | | <text>æ£éªè®¾å¤</text><text>*</text> |
| | | </view> |
| | |
| | | <view class="box_footer"> |
| | | <button class="box_footer_submit" v-preventReClick @click="submit">æäº¤</button> |
| | | </view> |
| | | <!-- æ¥çå¤§å¾ --> |
| | | <Preview :list="form.files" :current="current" v-if="isOpen" /> |
| | | <!-- éæ©è®¾å¤ --> |
| | | <ytyDataPicker :show="show" :dataList="columns" @select="handleSelect" @search="handleSearch" @close="show = false" /> |
| | | <!-- éæ©æ¶é´ --> |
| | | <u-datetime-picker :show="showTime" v-model="currentDate" @cancel="showTime = false" @confirm="queding" mode="datetime"></u-datetime-picker> |
| | | </view> |
| | |
| | | import { getBarcodeContent } from '@/util/api/WorkOrderAPI' |
| | | import { saveBean, getDeviceByCondition, getsbInfo } from '@/util/api/QualityAPI' |
| | | import { queryListByCode, uploadFiles } from '@/util/api/index' |
| | | import { QRCodeType, baseUrl } from '@/common/config.js' |
| | | import { QRCodeType, baseUrl, fileType } from '@/common/config.js' |
| | | import { setTime, judgmentType } from '@/util/utils.js' |
| | | import { mapState } from 'vuex' |
| | | import ytyDataPicker from '@/components/yty-data-picker/yty-data-picker.vue' |
| | | import Preview from '@/components/Preview/Preview.vue' |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | list1: [ |
| | | 'https://cloudfactory.oss-cn-hangzhou.aliyuncs.com/deviceCheck/20230911/e228a809-0a6b-443c-9a2c-78d5c1b1b633.mp4', |
| | | 'https://cdn.uviewui.com/uview/swiper/swiper2.png', |
| | | 'https://cdn.uviewui.com/uview/swiper/swiper3.png', |
| | | ], |
| | | status: [{ |
| | | name: 'æ£å¸¸', |
| | | active: true, |
| | |
| | | ], |
| | | columns: [], |
| | | path: '', |
| | | show: false, |
| | | showTime: false, |
| | | currentDate: new Date(), |
| | | current: 0, |
| | | form: { |
| | | equipmentId: '', // 设å¤id |
| | | equipmentName: '', //设å¤åç§° |
| | |
| | | } |
| | | }; |
| | | }, |
| | | components:{ |
| | | ytyDataPicker, |
| | | Preview |
| | | }, |
| | | onLoad() { |
| | | this.form.time = setTime(new Date(), '-') |
| | | this.getqueryListByCode() |
| | | this.getSB('') |
| | | }, |
| | | computed: { |
| | | ...mapState(['session']) |
| | | }, |
| | | methods: { |
| | | // å 餿宿件 |
| | | dele(i) { |
| | | this.form.files.splice(i, 1) |
| | | }, |
| | | // éæ©è®¾å¤ |
| | | handleSelect(e) { |
| | | this.form.equipmentId = e.code |
| | | this.form.equipmentName = e.name |
| | | this.show = false |
| | | }, |
| | | // æç´¢è®¾å¤ |
| | | handleSearch(e) { |
| | | this.getSB(e) |
| | | }, |
| | | // ç¡®è®¤éæ©æ¥æ |
| | | queding(val) { |
| | | this.form.time = uni.$u.timeFormat(val.value, 'yyyy-mm-dd hh:MM:ss') |
| | |
| | | }, |
| | | // æ«ç |
| | | openCode() { |
| | | var that = this |
| | | uni.scanCode({ |
| | | onlyFromCamera: true, |
| | | success: function (result) { |
| | |
| | | getsbInfo(res.data.id) |
| | | .then(res1 => { |
| | | if (res1.code === 200) { |
| | | this.form.equipmentId = res1.data.id |
| | | this.form.equipmentName = res1.data.name |
| | | that.form.equipmentId = res1.data.id |
| | | that.form.equipmentName = res1.data.name |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | }) |
| | | }, |
| | | // è·åå½åç¨æ·ä¸ææè®¾å¤ |
| | | getSB() { |
| | | getDeviceByCondition({}) |
| | | getSB(name) { |
| | | getDeviceByCondition({ name }) |
| | | .then(res => { |
| | | if (res.code === 200 && res.data && res.data.length > 0) { |
| | | this.columns = [] |
| | | let arr = [] |
| | | res.data.forEach(item => { |
| | | this.columns.push({ text: item.name, id: item.id }) |
| | | arr.push({ name: item.name, code: item.id }) |
| | | }) |
| | | this.columns = arr |
| | | } else { |
| | | this.columns = [] |
| | | } |
| | | }) |
| | | }, |
| | | // è·åæä»¶ |
| | | async upFile(e) { |
| | | if (this.form.files.length + e.target.files.length > 9) { |
| | | uni.showToast({ |
| | | title: 'æå¤åªè½ä¸ä¼ 9个å¾ç/è§é¢', |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }); |
| | | return |
| | | } |
| | | for (let i = 0; i < e.target.files.length; i++) { |
| | | let type = e.target.files[i].type |
| | | let index = type.indexOf('/') |
| | | let data = type.substring(index + 1, type.length) |
| | | const format = new FormData() |
| | | format.append('file', e.target.files[i]) |
| | | format.append('folder', this.path) |
| | | let res = await uploadFiles(format) |
| | | if (res.code === 200) { |
| | | form.files.push({ |
| | | fileUrl: res.data.imgaddr, |
| | | filename: res.data.imgname, |
| | | filesize: e.target.files[i].size, |
| | | type: judgmentType(data.toLowerCase()) ? 0 : 1, |
| | | url: res.data.url |
| | | }) |
| | | } |
| | | } |
| | | // upload.value.value = '' |
| | | }, |
| | | // ç¹å»ä¸ä¼ |
| | | uploadFile() { |
| | | var that = this |
| | | uni.chooseImage({ |
| | | success: (chooseImageRes) => { |
| | | const tempFilePaths = chooseImageRes.tempFilePaths; |
| | |
| | | filePath: tempFilePaths[0], |
| | | name: 'file', |
| | | header: { |
| | | 'Cookie': 'eva-auth-token=' + this.session |
| | | 'Cookie': 'eva-auth-token=' + that.session |
| | | }, |
| | | formData: { |
| | | 'folder': this.path |
| | | 'folder': that.path |
| | | }, |
| | | success: (uploadFileRes) => { |
| | | console.log(JSON.parse(uploadFileRes.data)); |
| | | let res = JSON.parse(uploadFileRes.data) |
| | | this.form.files.push({ |
| | | let type = '' |
| | | for (let i = 0; i < fileType.length; i++) { |
| | | if (tempFilePaths[0].indexOf(fileType[i].name) !== -1) { |
| | | type = fileType[i].type |
| | | } |
| | | } |
| | | that.form.files.push({ |
| | | fileUrl: res.data.imgaddr, |
| | | filename: res.data.imgname, |
| | | // filesize: e.target.files[i].size, |
| | | type: judgmentType(tempFilePaths[0]) ? 0 : 1, |
| | | type, |
| | | url: res.data.url |
| | | }) |
| | | } |
| | |
| | | position: absolute; |
| | | background: #F7F7F7; |
| | | |
| | | .sb { |
| | | width: 100%; |
| | | height: 800rpx; |
| | | padding: 30rpx; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .box_list { |
| | | padding: 0 30rpx 0 30rpx; |
| | | background: white; |
| | |
| | | |
| | | // æ ¹æ®IDæ¥è¯¢è®¾å¤ |
| | | export function getsbInfo (id) { |
| | | return request.post(`/ext/deviceExt/${id}`) |
| | | return request.get(`/ext/deviceExt/${id}`) |
| | | } |
| | | // export function getsbInfo (id: any): Promise<any> { |
| | | // return httpRequest({ |