|
@@ -106,196 +106,219 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-let qrcode = require('@/common/code.js');
|
|
|
-export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- array1: ['类型1', '类型2', '类型3', '类型4'], //实验类型1
|
|
|
- bitem: {
|
|
|
- applicationId: '__gAPYBW4YxB3UePM3lqO',
|
|
|
- exparams: {},
|
|
|
- formId: '__0FLGNncOS1lz0T9jsFn',
|
|
|
- id: '__79Wtw03ya4dJUDGPyAN',
|
|
|
- isRelate: 'undefined',
|
|
|
- parentId: '',
|
|
|
- sign: '',
|
|
|
- subDocuments: [],
|
|
|
- templateForm: '',
|
|
|
- versions: '0'
|
|
|
- },
|
|
|
- geteq: {
|
|
|
- DEVID: '202209211603170016',
|
|
|
- allow: 'false',
|
|
|
- appId: '__gAPYBW4YxB3UePM3lqO',
|
|
|
- datetime: '1670485443880',
|
|
|
- detp: '',
|
|
|
- fieldid: '__iLwKGJTxD89ZKnFzo2Y',
|
|
|
- formId: '__w9J1gxcIWgXmNw6pE1F',
|
|
|
- isEdit: 'true',
|
|
|
- mutil: 'true',
|
|
|
- parentid: '__NYI0rVs0LXbiW21z6Nv',
|
|
|
- searchForm: 'false',
|
|
|
- selectOne: 'false',
|
|
|
- viewId: '__WLVxKX6e0Pq0cTwdNUQ'
|
|
|
- },
|
|
|
- item: {},
|
|
|
- op: '设备归还',
|
|
|
- current: 0,
|
|
|
- code: '',
|
|
|
- list: []
|
|
|
- };
|
|
|
- },
|
|
|
- onLoad(e) {
|
|
|
- this.op = e.op;
|
|
|
- this.empty();
|
|
|
- //选中审批人员监听函数,其它类型的参考这个
|
|
|
- uni.$on('select', res => {
|
|
|
- console.log('asd:' + JSON.stringify(res));
|
|
|
- });
|
|
|
- },
|
|
|
- onReady() {
|
|
|
- uni.setNavigationBarTitle({
|
|
|
- title: this.op
|
|
|
- });
|
|
|
- },
|
|
|
- methods: {
|
|
|
- qr() {
|
|
|
- // 调用uni提供的调用相机api
|
|
|
- uni.chooseImage({
|
|
|
- sizeType: ['original'],
|
|
|
- sourceType: ['camera'],
|
|
|
- count: 1,
|
|
|
- success: res => {
|
|
|
- const tempFilePaths = res.tempFilePaths[0]; // 获取到二维码图片的链接
|
|
|
- qrcode.decode(tempFilePaths); // 解析二维码图片
|
|
|
- qrcode.callback = r => {
|
|
|
- this.code = r;
|
|
|
- this.geteq.DEVID = this.code;
|
|
|
- this.getEq();
|
|
|
- console.log('asd:' + r);
|
|
|
- this.$forceUpdate();
|
|
|
- };
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- //选择结果形式
|
|
|
- change(e) {
|
|
|
- this.current = e;
|
|
|
- console.log('aa:' + this.radio[this.current].name);
|
|
|
- },
|
|
|
- //选择实验类型
|
|
|
- bindChange(e, type) {
|
|
|
- this.item[type] = this.array1[e.target.value];
|
|
|
- this.$forceUpdate();
|
|
|
+ let qrcode = require('@/common/code.js');
|
|
|
+ export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ array1: ['类型1', '类型2', '类型3', '类型4'], //实验类型1
|
|
|
+ bitem: {
|
|
|
+ applicationId: '__gAPYBW4YxB3UePM3lqO',
|
|
|
+ exparams: {},
|
|
|
+ formId: '__0FLGNncOS1lz0T9jsFn',
|
|
|
+ id: '__79Wtw03ya4dJUDGPyAN',
|
|
|
+ isRelate: 'undefined',
|
|
|
+ parentId: '',
|
|
|
+ sign: '',
|
|
|
+ subDocuments: [],
|
|
|
+ templateForm: '',
|
|
|
+ versions: '0'
|
|
|
+ },
|
|
|
+ geteq: {
|
|
|
+ DEVID: '202209211603170016',
|
|
|
+ allow: 'false',
|
|
|
+ appId: '__gAPYBW4YxB3UePM3lqO',
|
|
|
+ datetime: '1670485443880',
|
|
|
+ detp: '',
|
|
|
+ fieldid: '__iLwKGJTxD89ZKnFzo2Y',
|
|
|
+ formId: '__w9J1gxcIWgXmNw6pE1F',
|
|
|
+ isEdit: 'true',
|
|
|
+ mutil: 'true',
|
|
|
+ parentid: '__NYI0rVs0LXbiW21z6Nv',
|
|
|
+ searchForm: 'false',
|
|
|
+ selectOne: 'false',
|
|
|
+ viewId: '__WLVxKX6e0Pq0cTwdNUQ'
|
|
|
+ },
|
|
|
+ item: {},
|
|
|
+ op: '设备归还',
|
|
|
+ current: 0,
|
|
|
+ code: '',
|
|
|
+ list: []
|
|
|
+ };
|
|
|
},
|
|
|
- //选择审批人员
|
|
|
- select() {
|
|
|
- uni.navigateTo({
|
|
|
- url: '/pages/index/select'
|
|
|
+ onLoad(e) {
|
|
|
+ this.op = e.op;
|
|
|
+ this.empty();
|
|
|
+ //选中审批人员监听函数,其它类型的参考这个
|
|
|
+ uni.$on('select', res => {
|
|
|
+ console.log('asd:' + JSON.stringify(res));
|
|
|
});
|
|
|
},
|
|
|
- getEq() {
|
|
|
- this.http.request({
|
|
|
- url:
|
|
|
- this.http.urls.eq_list +
|
|
|
- 'parentId=' +
|
|
|
- this.geteq.parentid +
|
|
|
- '&sortCol=&sortStatus=&_currpage=1&lines=10&treedocid=&parentNodeId=&_docid=&_fieldid=false&isRelate=&startDate=&endDate=&parentParam=&isQueryButton=false&newTime=1670485908904&_=0.5036780865403778',
|
|
|
- data: this.geteq,
|
|
|
- method: 'POST',
|
|
|
- success: res => {
|
|
|
- console.log('res2:' + JSON.stringify(res));
|
|
|
- if (res.data.errcode == 0) {
|
|
|
- console.log('res2:' + JSON.stringify(res.data.data.data));
|
|
|
- res.data.data.data.forEach(item => {
|
|
|
- this.list.push(item);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
+ onReady() {
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title: this.op
|
|
|
});
|
|
|
},
|
|
|
- empty() {
|
|
|
- var url = '';
|
|
|
- if (this.op == '设备借用') {
|
|
|
- url = this.http.urls.borr_empty;
|
|
|
- } else {
|
|
|
- url = this.http.urls.return_empty;
|
|
|
- }
|
|
|
- this.http.request({
|
|
|
- url: url,
|
|
|
- data: this.item,
|
|
|
+ methods: {
|
|
|
+ qr() {
|
|
|
+ // 调用uni提供的调用相机api
|
|
|
+ uni.chooseImage({
|
|
|
+ sizeType: ['original'],
|
|
|
+ sourceType: ['camera'],
|
|
|
+ count: 1,
|
|
|
+ success: res => {
|
|
|
+ const tempFilePaths = res.tempFilePaths[0]; // 获取到二维码图片的链接
|
|
|
+ qrcode.decode(tempFilePaths); // 解析二维码图片
|
|
|
+ qrcode.callback = r => {
|
|
|
+ this.code = r;
|
|
|
+
|
|
|
+ this.geteq.DEVID = this.code;
|
|
|
+ if (this.list.length == 0) {
|
|
|
+ this.getEq();
|
|
|
+ } else {
|
|
|
+ this.list.forEach(item => {
|
|
|
+
|
|
|
+ if (item.items.__2sfNVgOh5Bzq6lXRVuM.value == this.geteq
|
|
|
+ .DEVID) {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '该设备已经选择过了',
|
|
|
+ showCancel: false,
|
|
|
+ success: res => {
|
|
|
+ if (res.confirm) {
|
|
|
+ // uni.navigateBack();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.getEq();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
- success: res => {
|
|
|
- this.item = res.data.data.items;
|
|
|
- this.bitem.id = res.data.data.id;
|
|
|
- this.bitem.formId = res.data.data.formid;
|
|
|
- this.bitem.versions = res.data.data.versions;
|
|
|
- this.geteq.parentid = res.data.data.id;
|
|
|
- //console.log('res2:' + JSON.stringify(res.data.data));
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- //移除借用设备信息
|
|
|
- del(item){
|
|
|
- this.list.splice(this.list.indexOf(item),1);
|
|
|
- },
|
|
|
- //提交
|
|
|
- validate() {
|
|
|
- this.bitem.items = this.item;
|
|
|
- this.bitem.items.ghz = '20221208测试app保存';
|
|
|
- this.http.request({
|
|
|
- url: this.http.urls.validate,
|
|
|
- data: this.bitem,
|
|
|
- method: 'POST',
|
|
|
- success: res => {
|
|
|
- //console.log('res:' + JSON.stringify(res));
|
|
|
+ console.log('asd:' + r);
|
|
|
+ this.$forceUpdate();
|
|
|
+ };
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //选择结果形式
|
|
|
+ change(e) {
|
|
|
+ this.current = e;
|
|
|
+ console.log('aa:' + this.radio[this.current].name);
|
|
|
+ },
|
|
|
+ //选择实验类型
|
|
|
+ bindChange(e, type) {
|
|
|
+ this.item[type] = this.array1[e.target.value];
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
+ //选择审批人员
|
|
|
+ select() {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/index/select'
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getEq() {
|
|
|
+ this.http.request({
|
|
|
+ url: this.http.urls.eq_list +
|
|
|
+ 'parentId=' +
|
|
|
+ this.geteq.parentid,
|
|
|
+ data: this.geteq,
|
|
|
+ method: 'POST',
|
|
|
+ success: res => {
|
|
|
+ console.log('res2:' + JSON.stringify(res));
|
|
|
+ if (res.data.errcode == 0) {
|
|
|
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: res.data.errmsg,
|
|
|
- showCancel: false,
|
|
|
- success: res => {
|
|
|
- if (res.confirm) {
|
|
|
- uni.navigateBack();
|
|
|
- }
|
|
|
+ res.data.data.data.forEach(item => {
|
|
|
+ this.list.push(item);
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ empty() {
|
|
|
+ var url = '';
|
|
|
+ if (this.op == '设备借用') {
|
|
|
+ url = this.http.urls.borr_empty;
|
|
|
+ } else {
|
|
|
+ url = this.http.urls.return_empty;
|
|
|
}
|
|
|
- });
|
|
|
- },
|
|
|
- //提交
|
|
|
- add() {
|
|
|
- this.http.request({
|
|
|
- url: this.http.urls.user_task_add,
|
|
|
- data: this.item,
|
|
|
- method: 'POST',
|
|
|
- success: res => {
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '提交成功',
|
|
|
- showCancel: false,
|
|
|
- success: res => {
|
|
|
- if (res.confirm) {
|
|
|
- uni.navigateBack();
|
|
|
+ this.http.request({
|
|
|
+ url: url,
|
|
|
+ data: this.item,
|
|
|
+
|
|
|
+ success: res => {
|
|
|
+ this.item = res.data.data.items;
|
|
|
+ this.bitem.id = res.data.data.id;
|
|
|
+ this.bitem.formId = res.data.data.formid;
|
|
|
+ this.bitem.versions = res.data.data.versions;
|
|
|
+ this.geteq.parentid = res.data.data.id;
|
|
|
+ //console.log('res2:' + JSON.stringify(res.data.data));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //移除借用设备信息
|
|
|
+ del(item) {
|
|
|
+ this.list.splice(this.list.indexOf(item), 1);
|
|
|
+ },
|
|
|
+ //提交
|
|
|
+ validate() {
|
|
|
+ this.bitem.items = this.item;
|
|
|
+ this.bitem.items.ghz = '20221208测试app保存';
|
|
|
+ this.http.request({
|
|
|
+ url: this.http.urls.validate,
|
|
|
+ data: this.bitem,
|
|
|
+ method: 'POST',
|
|
|
+ success: res => {
|
|
|
+ //console.log('res:' + JSON.stringify(res));
|
|
|
+
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: res.data.errmsg,
|
|
|
+ showCancel: false,
|
|
|
+ success: res => {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.navigateBack();
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //提交
|
|
|
+ add() {
|
|
|
+ this.http.request({
|
|
|
+ url: this.http.urls.user_task_add,
|
|
|
+ data: this.item,
|
|
|
+ method: 'POST',
|
|
|
+ success: res => {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '提交成功',
|
|
|
+ showCancel: false,
|
|
|
+ success: res => {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.navigateBack();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
-.page {
|
|
|
- padding-bottom: 80px;
|
|
|
-}
|
|
|
-.item {
|
|
|
- margin-bottom: 10px;
|
|
|
-}
|
|
|
-.del{
|
|
|
- width: 70%;
|
|
|
- background-color:#e64340;
|
|
|
-}
|
|
|
+ .page {
|
|
|
+ padding-bottom: 80px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .item {
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .del {
|
|
|
+ width: 70%;
|
|
|
+ background-color: #e64340;
|
|
|
+ }
|
|
|
</style>
|