123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259 |
- <template>
- <view>
- <commonCard :gwId="gwId"></commonCard>
- <view class="office_main">
- <view class="office_title">
- <uni-section v-if="isoffice" titleColor="#36a7f3" class="mb-10" title="分管领导意见"
- type="line"></uni-section>
- <uni-section v-if="istransmit" titleColor="#36a7f3" class="mb-10" title="办公室意见"
- type="line"></uni-section>
- <uni-section v-if="isleader" titleColor="#36a7f3" class="mb-10" title="主要领导意见"
- type="line"></uni-section>
- <uni-section v-if="isundertake" titleColor="#36a7f3" class="mb-10" title="承办科(室)意见"
- type="line"></uni-section>
- </view>
- <view class="office_info">
- <u--form :model="auditForm" labelWidth="130px" class="u-form default_title" labelPosition="left"
- ref="auditForm">
- <u-form-item :label="istransmit?'办公室意见':isundertake?'承办科(室)意见':isoffice?'分管领导意见':'主要领导意见'"
- borderBottom prop="content">
- <u--textarea v-model="auditForm.content" placeholder=""></u--textarea>
- </u-form-item>
- <u-form-item v-if="!isleader" label="下一位审批人" borderBottom prop="neUser">
- <office-user-select v-model="auditForm.neUser" placeholder="请选择下一位审批人"
- title="审批人"></office-user-select>
- </u-form-item>
- <view class="submit_btn flex ">
- <u-button v-if="isAll" @click="formSubmit" type="success" text="归档"></u-button>
- <u-button v-if="!loading" type="primary" :disabled="auditForm.nextLeadUser==''" text="确认签字"
- @click="doSubmit"></u-button>
- <u-button v-if="loading" :loading="loading" type="primary" text="加载中"></u-button>
- </view>
- </u--form>
- </view>
- </view>
- <u-toast ref="uToast"></u-toast>
- <u-overlay :show="loading">
- <view class="warp">
- <view class="rect"><u-button plain loading loadingText="加载中"></u-button></view>
- </view>
- </u-overlay>
- </view>
- </template>
- <script>
- import commonCard from "./commonCard.vue"
- import BASE_URL from '@/config.js'
- import moment from "moment"
- import signInput from "@/components/am-sign-input/am-sign-input.vue"
- import officeUserSelect from "@/components/office-user-select/office-user-select.vue"
- import userService from "@/api/sys/userService"
- import yzFlowService from '@/api/commonseal/yzFlowService.js'
- import * as $auth from "@/common/auth.js"
- export default {
- onLoad(option) {
- this.gwId = option.id
- yzFlowService.queryByYzId(this.gwId).then(data => {
- let user = $auth.getUserInfo()
- let role = $auth.getUserInfo().roleNames
- let gw = data.filter(item => {
- return item.nextUser == user.id && item.state == 1
- })
- if (gw.length > 0) {
- this.auditForm = gw[0]
- if (gw[0].which == '4') this.isAll = true
- if (!this.auditForm.content) this.auditForm.content = '已阅'
- }
- if (role == '办公室管理员') {
- this.istransmit = true
- }
- if (role == '局领导' && gw.length > 0) this.isleader = true
- if (role == '办公室主任' && gw.length > 0) this.istransmit = true
- if (role == '分管领导' && gw.length > 0) this.isoffice = true
- if (role == '科室负责人' && gw.length > 0) this.isundertake = true
- })
- },
- components: {
- commonCard,
- signInput,
- officeUserSelect
- },
- data() {
- return {
- loading: false,
- isAll: false,
- show: false,
- one: true,
- action: this.BASE_URL + '/gwfile/upload?uploadPath=sign', //上传服务器的地址
- header: {
- "token": $auth.getUserToken()
- }, //图片上传携带头部信息
- auditForm: {
- id: '',
- yzId: '',
- content: '已阅',
- signfj: '',
- createTruename: '',
- nextTruename: '',
- nextUser: '',
- which: '0',
- state: '0',
- next: '',
- neUser: ''
- },
- gwForm: {},
- gwId: "",
- isoffice: false,
- isleader: false,
- isundertake: false,
- istransmit: false,
- leaderList: [],
- tablePage: {
- total: 0,
- currentPage: 1,
- pageSize: 1000,
- orders: [{
- column: "a.create_time",
- asc: false
- }],
- },
- searchForm: {
- // loginName: "",
- // name: "",
- // companyDTO: {
- // id: "",
- // },
- // officeDTO: {
- // id: "",
- // },
- },
- roleId: ""
- }
- },
- methods: {
- showToast(params) {
- this.loading = false
- this.$refs.uToast.show({
- ...params,
- complete() {
- params.url && uni.redirectTo({
- url: params.url
- })
- }
- })
- },
- /**
- * @param {Object} e
- * 签名完成回调
- */
- signToUrl(e) {
- this.auditForm.signfj = e.data
- if (e.error_code && e.error_code === '201') {
- uni.showToast({
- title: e.msg,
- icon: 'none'
- })
- return
- }
- },
- // 提交表单
- doSubmit() {
- let inputForm = this.auditForm;
- this.loading = true
- console.log("inputForm.neUser",inputForm.neUser);
- if (inputForm.neUser && inputForm.neUser != '') {
- inputForm.next = '1'
- }else {
- inputForm.next = ''
- }
- inputForm.state = "0"
- inputForm.gwId = this.gwId
- const date = moment().format('YYYY-MM-DD HH:mm:ss');
- inputForm.updateTime = date
- yzFlowService.save(inputForm).then(data => {
- let param = {
- type: 'success',
- message: data,
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png',
- }
- this.showToast(param);
- setTimeout(() => {
- // 重定向到上一页
- uni.redirectTo({
- url: `/pages/commonseal/commonInfo?id=${this.gwId}` // 注意此处可能需要加上参数保留
- });
- }, 500)
- }).catch(() => {
- let param = {
- type: 'error',
- message: data,
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png',
- }
- this.showToast(param);
- })
- },
- // 归档
- formSubmit() {
- this.loading = true
- let inputForm = Object.assign({}, this.auditForm);;
- inputForm.state = '0'
- inputForm.next = "0"
- yzFlowService.save(inputForm).then(data1 => {
- let param = {
- type: 'success',
- message: "已归档",
- iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png',
- }
- this.showToast(param);
- setTimeout(() => {
- // 重定向到上一页
- uni.redirectTo({
- url: `/pages/commonseal/commonInfo?id=${this.gwId}` // 注意此处可能需要加上参数保留
- });
- }, 500)
- })
- }
- }
- }
- </script>
- <style>
- .warp {
- display: flex;
- align-items: center;
- justify-content: center;
- height: 100%;
- }
- .office_main {
- width: 100%;
- margin: 5px 0;
- padding: 0 20px;
- background-color: #fefefe;
- }
- .office_main .office_title {
- width: 100%;
- border-bottom: 1px solid #eee;
- }
- .submit_btn {
- background-color: #fefefe;
- bottom: 10px;
- box-shadow: none;
- padding: 20px 0;
- }
- .submit_btn button {
- height: 40px;
- width: 40%;
- border-radius: 30px;
- }
- </style>
|