| | |
| | | </u-form-item> |
| | | |
| | | <u-form-item label-position='top' label="指令相关图片" class='imgissue-upload'> |
| | | <!-- <u-upload :action="action" :file-list="fileList" max-count='1'></u-upload> --> |
| | | <seeImgs :imgs="imgs" :videos="[]" @del="delImg" :type="'imgs'"></seeImgs> |
| | | <image style="width: 4rem; height: 4rem; display: block;" @tap="takePhoto" src="../../static/images/upload.png" mode=""></image> |
| | | <image style="width: 4rem; height: 4rem; display: block;" @tap="takePhoto" |
| | | src="../../static/images/upload.png" mode=""></image> |
| | | </u-form-item> |
| | | |
| | | <u-form-item label-position='top' prop="recipientText" label="指令接收人" :required="true"> |
| | | |
| | | <u-input v-model="form.recipientText" type="select" placeholder="请选择接收人" :border="false" |
| | | @click="recipientClick" /> |
| | | <u-select v-model="recipientShow" mode="mutil-column-auto" :list="recipientList" |
| | | @confirm="recipientConfirm"> |
| | | </u-select> |
| | | |
| | | </u-form-item> |
| | | |
| | | </u-form> |
| | | <view> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | action: 'http://192.168.0.108:81/blade-resource/oss/endpoint/put-file', |
| | | fileList: [{ |
| | | url: 'http://pics.sc.chinaz.com/files/pic/pic9/201912/hpic1886.jpg', |
| | | }], |
| | | recipientShow: false, |
| | | recipientList: [], |
| | | |
| | | form: { |
| | | content: '', |
| | | |
| | | recipient: '', |
| | | recipientText: '' |
| | | }, |
| | | rules: { |
| | | |
| | |
| | | required: true, |
| | | message: '指令内容不能少于5个字', |
| | | trigger: ['change', 'blur'], |
| | | }] |
| | | }], |
| | | recipientText: [{ |
| | | required: true, |
| | | message: '请选择接收人', |
| | | trigger: ['change', 'blur'], |
| | | }], |
| | | }, |
| | | imgs: [], |
| | | }; |
| | | }, |
| | | onLoad() { |
| | | console.log(this.$store.state) |
| | | }, |
| | | onReachBottom() { |
| | | |
| | |
| | | this.$refs.uForm.setRules(this.rules); |
| | | }, |
| | | methods: { |
| | | recipientClick() { |
| | | uni.request({ |
| | | url: this.$store.state.piAPI + "/blade-system/dept/lazy-tree-user-app?userId=" + this.$store |
| | | .state |
| | | .UserData.user_id, |
| | | method: "get", |
| | | data: { |
| | | |
| | | }, |
| | | success: (res) => { |
| | | this.recipientList = [] |
| | | res.data.forEach(item => { |
| | | if (item.hasChildren) { |
| | | this.recipientList.push(item) |
| | | } |
| | | }) |
| | | this.recipientShow = true; |
| | | } |
| | | }); |
| | | |
| | | }, |
| | | recipientConfirm(e) { |
| | | if (e.length > 1) { |
| | | this.form.recipient = e[1].value |
| | | this.form.recipientText = e[1].label |
| | | } else { |
| | | this.form.recipient = e[0].value |
| | | this.form.recipientText = e[0].label |
| | | } |
| | | |
| | | }, |
| | | initiateClick() { |
| | | var imgurl = ''; |
| | | this.imgs.forEach((item, index) => { |
| | | if (index == this.imgs.length - 1) { |
| | | imgurl += item.src |
| | | } else { |
| | | imgurl += item.src + ',' |
| | | } |
| | | }) |
| | | this.$refs.uForm.validate(valid => { |
| | | if (valid) { |
| | | uni.request({ |
| | |
| | | method: "post", |
| | | data: { |
| | | // 接收 |
| | | receiveDirectiveIds: this.$store.state |
| | | .UserData.user_id, |
| | | receiveDirectiveIds: this.form.recipient, |
| | | // 发送 |
| | | sendDirectiveId: this.$store.state |
| | | .UserData.user_id, |
| | | content: this.form.content, |
| | | sendTime: "2021-07-22 12:00:00", |
| | | url: imgurl |
| | | |
| | | }, |
| | | success: (res) => { |
| | | if (res.data.msg == "操作成功") { |
| | | // this.$refs.uToast.show({ |
| | | // title: '发送成功', |
| | | // type: 'success', |
| | | // url: '/pages/report/report' |
| | | // }) |
| | | this.$refs.uToast.show({ |
| | | title: '指令下发成功', |
| | | type: 'success', |
| | | url: '/pages/dispatch/dispatch' |
| | | }) |
| | | } |
| | | } |
| | | }); |
| | |
| | | for (var i = 0; i < tempFilePath.length; i++) { |
| | | uni.uploadFile({ |
| | | // url: 'https://web.byisf.com/api/blade-jfpts/depl/put-depl', //仅为示例,非真实的接口地址 |
| | | url: 'http://192.168.0.108:81/blade-resource/oss/endpoint/put-file', |
| | | url: 'http://192.168.0.108:81/blade-resource/oss/endpoint/put-file-app', |
| | | filePath: tempFilePath[i], |
| | | name: 'file', |
| | | formData: { |
| | | 'user': 'test' // 上传附带参数 |
| | | }, |
| | | success: (data) => { |
| | | console.log(data, JSON.parse(data.data).data) |
| | | uni.showToast({ |
| | | title: '上传图片成功!', |
| | | duration: 1000 |
| | |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | |
| | | } |
| | | }; |
| | | </script> |