123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504 |
- <template>
- <view class="pages">
- <view class="vtitle">检测申请方填写</view>
- <view class="form_group">
- <view class="lable">委托单编号</view>
- <view class="tag">
- <text class="span">{{ item.wt_num }}</text>
- <text class="icon more"></text>
- </view>
- </view>
- <view class="form_group">
- <view class="lable">标题</view>
- <view class="tag">
- <text class="span">{{ item.title }}</text>
- <text class="icon more"></text>
- </view>
- </view>
- <view class="form_group">
- <view class="lable">申请单位/部门</view>
- <view class="tag">
- <text class="span">{{ item.dept }}</text>
- <text class="icon more"></text>
- </view>
- </view>
- <view class="form_group">
- <view class="lable">试验目的</view>
- <view class="tag">
- <text class="span">{{ item.purpose }}</text>
- <text class="icon more"></text>
- </view>
- </view>
- <view class="form_group">
- <view class="lable">申请人</view>
- <view class="tag">
- <text class="span">{{ item.applicant }}</text>
- <text class="icon more"></text>
- </view>
- </view>
- <view class="form_group">
- <view class="lable">电话</view>
- <view class="tag">
- <text class="span">{{ item.tel }}</text>
- <text class="icon more"></text>
- </view>
- </view>
- <view class="form_group">
- <view class="lable">试验部门</view>
- <view class="tag">
- <text class="span">{{ item.test_dept }}</text>
- <text class="icon more"></text>
- </view>
- </view>
- <view class="form_group">
- <view class="lable">所属项目</view>
- <view class="tag">
- <text class="span">{{ item.item }}</text>
- <text class="icon more"></text>
- </view>
- </view>
- <view class="form_group">
- <view class="lable">试验类型</view>
- <view class="tag">
- <text class="span">
- <text>{{ item.product }}</text>
- /
- <text>{{ item.experiment_type }}</text>
- </text>
- <text class="icon more"></text>
- </view>
- </view>
- <view class="form_group">
- <view class="lable">项目编号</view>
- <view class="tag">
- <text class="icon more"></text>
- <text class="span">{{ item.item_num }}</text>
- </view>
- </view>
- <view class="form_group">
- <view class="lable">结果形式</view>
- <view class="tag"><u-subsection :list="radio" :current="current" @change="change"></u-subsection></view>
- </view>
- <view class="form_group">
- <view class="lable">模板</view>
- <view class="tag">
- <text class="icon more"></text>
- <text class="span">{{ item.item_num }}</text>
- </view>
- </view>
- <view class="vtitle">设置审批人员</view>
- <view class="form_group" @click="select('1')">
- <view class="lable">需求审核-产品经理或主管人员</view>
- <view class="tag">
- <text class="span">{{ item.WTXQSH }}</text>
- <text class="icon more"></text>
- </view>
- </view>
- <view class="form_group" @click="select('2')">
- <view class="lable">试验审核-试验对接人</view>
- <view class="tag">
- <text class="span">{{ item.WTSYSH }}</text>
- <text class="icon more"></text>
- </view>
- </view>
- <view class="form_group" @click="select('3')">
- <view class="lable">需求批准-本部门领导</view>
- <view class="tag">
- <text class="span">{{ item.WTXQPZ }}</text>
- <text class="icon more"></text>
- </view>
- </view>
- <view class="form_group" @click="select('4')">
- <view class="lable">试验批准</view>
- <view class="tag">
- <text class="span">{{ item.WTSYPZ }}</text>
- <text class="icon more"></text>
- </view>
- </view>
- <view class="form_group" @click="select('5')">
- <view class="lable">任务分派-任务分派人</view>
- <view class="tag">
- <text class="span">{{ item.WTRWFP }}</text>
- <text class="icon more"></text>
- </view>
- </view>
- <view class="vtitle">样机</view>
- <view class="form_group">
- <view class="lable">GH560</view>
- <view class="tag">
- <text class="span">XH890656565556</text>
- <text class="icon more"></text>
- </view>
- </view>
- <view class="form_group">
- <view class="lable">GH560</view>
- <view class="tag">
- <text class="span">XH890656565556</text>
- <text class="icon more"></text>
- </view>
- </view>
- <view class="footer" v-if="btnshow">
- <view class="flex">
- <view class="f"><button class="btn br" @click="submission()">提交</button></view>
- <view class="f"><button class="btn br back" @click="back()" v-if="state == 1">回退</button></view>
- </view>
- </view>
- <u-popup :show="show" mode="bottom">
- <view class="content">
- <scroll-view scroll-y="true" style="height: 300rpx;">
- <view>
- <view>提交流程面板</view>
- <view v-for="(item, index) in nextNodes" :key="index" style="float: left;">{{ item.name }}:</view>
- <u-radio-group @change="radioGroupChange"><u-radio v-for="(item, index) in nextNodes" :key="index" :name="item.id"></u-radio></u-radio-group>
- </view>
- </scroll-view>
- <view class="confrim-btn"><u-button @click="submit()">确定</u-button></view>
- </view>
- </u-popup>
- <u-popup :show="bshow" mode="bottom">
- <view class="content">
- <scroll-view scroll-y="true" style="height: 300rpx;">
- <view>
- <view>回退流程面板</view>
- <view v-for="(item, index) in backNodes" :key="index" style="float: left;">{{ item.name }}:</view>
- <u-radio-group @change="radioGroupChange"><u-radio v-for="(item, index) in backNodes" :key="index" :name="item.id"></u-radio></u-radio-group>
- </view>
- </scroll-view>
- <view class="confrim-btn"><u-button @click="workflowsback()">确定</u-button></view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- let qrcode = require('@/common/code.js');
- export default {
- data() {
- return {
- p: {},
- item: {},
- current: 0,
- radio: [
- {
- name: '正式报告'
- },
- {
- name: '仅原始数据'
- },
- {
- name: '协助试验'
- }
- ],
- id: '',
- items: {
- document: {
- items: {}
- }
- },
- show: false,
- bshow: false,
- itemt: {},
- up: {},
- content: '标题',
- nextNodes: [],
- backNodes: [],
- touser: {
- nodeid: '1649917385058',
- isToPerson: true,
- userids: '__jFFZYvLIG6uFc7CdBMg'
- },
- btnshow: false,
- state: 0
- };
- },
- onLoad(e) {
- this.id = e.id;
- //传过来的id
- this.state = e.ste;
- if (e.ste == 1) {
- /* this.http.request({
- url: this.http.urls.xxxx + e.id,
- success: res => {
- this.item = res.data.data;
- }
- }); */
- this.getDocuments();
- } else if (e.ste == 2) {
- this.empty();
- }
- //选中审批人员监听函数,其它类型的参考这个
- uni.$on('select', res => {
- console.log('asd2:' + JSON.stringify(res));
- if (res.ste == 1) {
- this.item.WTXQSH = res.items.__L5a8n9ZH5gJC0CL1s6X.value;
- } else if (res.ste == 2) {
- this.item.WTSYSH = res.items.__0ils0bIBD7Vf90TjVb3.value;
- } else if (res.ste == 3) {
- this.item.WTXQPZ = res.items.__uiMgMPHg9jmqTXzwdzl.value;
- } else if (res.ste == 4) {
- this.item.WTSYPZ = res.items.__WSh3KXD8wfeyU3FbipN.value;
- } else if (res.ste == 5) {
- this.item.WTRWFP = res.items.__IzBqxyYJhOYJntHpmEv.value;
- }
- });
- },
- methods: {
- // 选中任一radio时,由radio-group触发
- radioGroupChange(e) {
- // console.log(e);
- this.itemt.nextNodeIds = [];
- this.itemt.nextNodeIds.push(e);
- }, //详情
- getDocuments() {
- this.http.request({
- url: this.http.urls.documents + this.id,
- data: this.item,
- loading: 'false',
- success: res => {
- this.item = res.data.data.items;
- this.p = res.data.data;
- if (this.p.lastFlowOperation == undefined || this.p.auditorList.includes(this.getUser().id)) {
- console.log('this.p1:' + JSON.stringify(this.p));
- this.btnshow = true;
- }
- //this.current=res.data.data.items.report_type;
- if (this.item.report_type == '正式报告') {
- this.current = 0;
- } else if (this.item.report_type == '仅原始数据') {
- this.current = 1;
- } else if (this.item.report_type == '协助试验') {
- this.current = 2;
- }
- this.iteml = res.data.data;
- this.items.applicationId = '__gAPYBW4YxB3UePM3lqO';
- this.items.docId = this.iteml.id;
- this.items.id = this.iteml.id;
- this.items.formId = this.iteml.formid;
- this.items.parentId = '';
- this.items.subSelects = [];
- this.items.templateForm = '';
- this.items.viewId = '';
- this.items.document.items = this.item;
- this.items.document.applicationId = '__gAPYBW4YxB3UePM3lqO';
- this.items.document.exparams = {};
- this.items.document.formId = this.iteml.formid;
- this.items.document.id = this.iteml.id;
- this.items.document.parentId = '';
- this.items.document.sign = '';
- this.items.document.stateId = this.iteml.stateid;
- this.items.document.subDocuments = [];
- this.items.document.templateForm = '';
- this.items.document.versions = '0';
- }
- });
- },
- empty() {
- this.btnshow = true;
- this.http.request({
- url: this.http.urls.empty,
- data: this.item,
- success: res => {
- console.log('res2:' + JSON.stringify(res));
- this.item = res.data.data.items;
- this.p = res.data.data;
- console.log('this.p1:' + JSON.stringify(this.p));
- //this.current=res.data.data.items.report_type;
- if (this.item.report_type == '正式报告') {
- this.current = 0;
- } else if (this.item.report_type == '仅原始数据') {
- this.current = 1;
- } else if (this.item.report_type == '协助试验') {
- this.current = 2;
- }
- this.iteml = res.data.data;
- this.items.applicationId = '__gAPYBW4YxB3UePM3lqO';
- this.items.docId = this.iteml.id;
- this.items.id = this.iteml.id;
- this.items.formId = this.iteml.formid;
- this.items.parentId = '';
- this.items.subSelects = [];
- this.items.templateForm = '';
- this.items.viewId = '';
- this.items.document.items = this.item;
- this.items.document.applicationId = '__gAPYBW4YxB3UePM3lqO';
- this.items.document.exparams = {};
- this.items.document.formId = this.iteml.formid;
- this.items.document.id = this.iteml.id;
- this.items.document.parentId = '';
- this.items.document.sign = '';
- this.items.document.stateId = this.iteml.stateid;
- this.items.document.subDocuments = [];
- this.items.document.templateForm = '';
- this.items.document.versions = '0';
- }
- });
- },
- //选择结果形式
- change(e) {
- this.current = e;
- console.log('aa:' + this.radio[this.current].name);
- this.item.report_type = this.radio[this.current].name;
- },
- //选择审批人员
- select(e) {
- uni.navigateTo({
- url: '/pages/index/select?ste=' + e
- });
- },
- //提交
- 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();
- }
- }
- });
- }
- });
- },
- //提交流程面板
- submission() {
- this.http.request({
- url: this.http.urls.documents + this.id + '/panels/submission',
- data: this.items,
- method: 'POST',
- success: res => {
- //this.item=res.data.data;
- console.log('zx22:' + JSON.stringify(res));
- this.show = true;
- this.title = res.data.data.name;
- this.nextNodes = res.data.data.nextNodes;
- this.itemt.flowId = res.data.data.flowId;
- this.itemt.flowType = '80';
- this.itemt.currentNodeId = res.data.data.currentNodeId;
- this.itemt.attitude = '';
- this.itemt.signature = '';
- this.itemt.submitTo = '';
- this.itemt.circulatorInfo = '';
- this.itemt.subFlowApproverInfo = '';
- this.itemt.subFlowApproverInfoAll = '';
- this.itemt.document = this.items.document;
- //this.content=res.data.data.formname;
- }
- });
- }, //提交流程
- submit() {
- //this.itemt.document.items.purpose="试验目的5656";
- //this.itemt.document.items.title="标题5656";
- this.itemt.applicationId = '__gAPYBW4YxB3UePM3lqO';
- this.itemt.docId = this.iteml.id;
- this.itemt.id = this.iteml.id;
- this.itemt.formId = this.iteml.formid;
- this.itemt.parentId = '';
- this.itemt.subFlowApprover = [];
- this.itemt.subSelects = [];
- this.itemt.submitTo = [];
- this.itemt.templateForm = '';
- this.itemt.viewId = '';
- this.http.request({
- url: this.http.urls.documents + this.id + '/workflows/submit',
- data: this.itemt,
- method: 'PUT',
- success: res => {
- //this.item=res.data.data;
- console.log('zx22:' + JSON.stringify(res));
- this.show = false;
- this.title = res.data.data.name;
- this.nextNodes = res.data.data.nextNodes;
- uni.$emit('index');
- uni.redirectTo({
- url: '/pages/index/index'
- });
- //this.content=res.data.data.formname;
- }
- });
- }, //刷新数据
- //回退流程面板
- back() {
- this.http.request({
- url: this.http.urls.documents + this.id + '/panels/back',
- data: this.items,
- method: 'POST',
- success: res => {
- //this.item=res.data.data;
- console.log('zx22:' + JSON.stringify(res.data.data));
- this.bshow = true;
- this.title = res.data.data.name;
- this.backNodes = res.data.data.backNodes;
- this.itemt.flowId = res.data.data.flowId;
- this.itemt.flowType = '81';
- this.itemt.currentNodeId = res.data.data.currentNodeId;
- this.itemt.attitude = '';
- this.itemt.signature = '';
- this.itemt.submitTo = '';
- this.itemt.circulatorInfo = '';
- this.itemt.subFlowApproverInfo = '';
- this.itemt.subFlowApproverInfoAll = '';
- this.itemt.document = this.items.document;
- //this.content=res.data.data.formname;
- }
- });
- }, //提交回退流程
- workflowsback() {
- //this.itemt.document.items.purpose="试验目的111";
- this.itemt.applicationId = '__gAPYBW4YxB3UePM3lqO';
- this.itemt.docId = this.iteml.id;
- this.itemt.id = this.iteml.id;
- this.itemt.formId = this.iteml.formid;
- this.itemt.parentId = '';
- this.itemt.subFlowApprover = [];
- this.itemt.subSelects = [];
- this.itemt.submitTo = [];
- this.itemt.templateForm = '';
- this.itemt.viewId = '';
- this.http.request({
- url: this.http.urls.documents + this.id + '/workflows/back',
- data: this.itemt,
- method: 'PUT',
- success: res => {
- //this.item=res.data.data;
- console.log('zx22:' + JSON.stringify(res));
- this.bshow = false;
- this.title = res.data.data.name;
- this.nextNodes = res.data.data.nextNodes;
- uni.$emit('index');
- uni.redirectTo({
- url: '/pages/index/index'
- });
- //this.content=res.data.data.formname;
- }
- });
- }
- }
- };
- </script>
- <style lang="scss">
- .pages{
- padding-bottom: 85px;
- }
- </style>
|