| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601 |
- <template>
- <div class="bgcolor">
- <!-- 顶部条-->
- <div class="navBarTOP">
- <van-nav-bar class="navBar" title="流程审批" left-arrow @click-left="onClickLeft">
- <template #right>
- <!-- <span class="navRightBtn" @click="editorFn">批量审批</span>-->
- </template>
- </van-nav-bar>
- <div class="serchInput">
- <van-cell
- class="monthNow selectcell"
- :title="companyName"
- is-link
- arrow-direction="down"
- @click="RegionShow = true" />
- </div>
- <div class="searchDiv">
- <van-search
- v-model="param"
- left-icon="search"
- show-action
- placeholder="搜索名称/编号/业务员">
- <template #action>
- <div @click="onSearchm">搜索</div>
- </template>
- </van-search>
- </div>
- <van-row>
- <van-col span="18">
- <van-tabs v-model="isHandle" color="#0057ba" @change="tabChange">
- <van-tab
- title="待审批"
- name="0"
- :disabled="disabled"
- v-if="userDeptLevel != '4'"></van-tab>
- <van-tab
- title="已审批"
- name="1"
- :disabled="disabled"
- v-if="userDeptLevel != '4'"></van-tab>
- <van-tab title="我发起的" name="2" :disabled="disabled"></van-tab>
- </van-tabs>
- </van-col>
- <van-col span="6" style="text-align: center; margin-top: 10px" @click="sortFN">
- <van-icon name="ascending" v-if="orderByStr == 'asc'" color="#0057ba" size="24" />
- <van-icon name="descending" v-if="orderByStr == 'desc'" color="#0057ba" size="24" />
- </van-col>
- </van-row>
- </div>
- <div class="container">
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <div class="lineGrey"></div>
- <van-list
- v-model="loading"
- :finished="finished"
- finished-text="--已经到底了--"
- @load="onLoad">
- <van-checkbox-group v-model="radio">
- <div class="cellcontent brud weekList" v-for="(item, index) in list" :key="index">
- <van-cell is-link>
- <div class="cardContent" @click="approveFn(item)">
- <div class="title">
- <p class="textLeft">{{ item.storeName }}({{ item.storeCode }})</p>
- <p class="textRight" v-if="isHandle == 0">审批</p>
- </div>
- <div class="info">
- 类型:{{ selectDictLabel(storeTypeList, item.storeCategory) }}
- </div>
- <div class="info">地址:{{ item.addressLine }}</div>
- <div class="info">流程类型:{{ item.modelName }}</div>
- <div class="info">提交人:{{ item.applyUserName }}</div>
- <div class="info" v-if="item.isHandle == 0">
- 提交时间:{{ item.applyTime }}
- <van-tag
- plain
- type="primary"
- size="medium"
- v-if="item.status == 1"
- style="float: right"
- >待审批</van-tag
- >
- <van-tag
- plain
- type="success"
- size="medium"
- v-if="item.status == 2"
- style="float: right"
- >审批通过</van-tag
- >
- <van-tag
- plain
- type="danger"
- size="medium"
- v-if="item.status == 3"
- style="float: right"
- >审批拒绝</van-tag
- >
- </div>
- <div class="info" v-if="item.isHandle == 1">
- 审批时间:{{ item.todoTime }}
- <van-tag
- plain
- type="primary"
- size="medium"
- v-if="item.status == 1"
- style="float: right"
- >待审批</van-tag
- >
- <van-tag
- plain
- type="success"
- size="medium"
- v-if="item.status == 2"
- style="float: right"
- >审批通过</van-tag
- >
- <van-tag
- plain
- type="danger"
- size="medium"
- v-if="item.status == 3"
- style="float: right"
- >审批拒绝</van-tag
- >
- </div>
- <!-- <van-checkbox :name="item" v-if="isHandle=='0'" shape="square" style="float: right"></van-checkbox>-->
- </div>
- </van-cell>
- </div>
- </van-checkbox-group>
- <van-empty description="" v-if="list.length == 0" />
- </van-list>
- </div>
- <van-popup v-model="submitShow" position="bottom" closeable :style="{ height: '50%' }">
- <div>
- <p
- style="
- text-align: center;
- padding-bottom: 16px;
- border-bottom: 1px solid #f5f5f5;
- font-size: 16px;
- ">
- 审批意见
- </p>
- <van-field v-model="blackReason" rows="6" type="textarea" placeholder="请输入审批意见" />
- <br />
- <van-row gutter="20" style="padding: 10px">
- <van-col span="12">
- <van-button
- style="width: 100%"
- plain
- type="info"
- class="E-bgBlue BtnBorder"
- @click="outFn"
- >驳回</van-button
- >
- </van-col>
- <van-col span="12">
- <van-button style="width: 100%" plain type="info" class="E-bgBlue Btn" @click="submit"
- >同意</van-button
- >
- </van-col>
- </van-row>
- </div>
- </van-popup>
- <van-popup v-model="RegionShow" capture position="bottom">
- <van-picker
- show-toolbar
- :columns="moduleList"
- value-key="name"
- @confirm="onregionConfirm"
- @cancel="RegionShow = false" />
- </van-popup>
- </div>
- </template>
- <script>
- import {
- getCWStoreTypeList,
- getTodoItemList,
- completeAll,
- getStoreTypeList,
- getTodoItemMyList,
- } from '@/api/index';
- import { moduleList } from '@/api/inventory';
- export default {
- name: 'MyHistoricalWeekly',
- data() {
- return {
- isHandle: '0',
- disabled: false,
- pageNum: 1,
- pageSize: 10,
- loading: false,
- finished: false,
- RegionShow: false,
- storeTypeList: [],
- list: [],
- radio: [],
- blackReason: '',
- param: '',
- submitShow: false,
- orderByStr: 'desc',
- moduleList: [],
- module: '',
- companyName: '全部流程',
- userDeptLevel: '',
- };
- },
- created() {
- // userDeptLevel用户部门等级字段,0-总部,1-公司,2-大区,3-销售部,4-业务员
- this.userDeptLevel = localStorage.getItem('userDeptLevel');
- if (this.userDeptLevel == '4') {
- this.isHandle = '2';
- }
- this.radio = [];
- getStoreTypeList({}).then((res) => {
- this.storeTypeList = res.data;
- });
- moduleList({}).then((res) => {
- var moduleList = [{ key: '', name: '全部流程' }];
- this.moduleList = moduleList.concat(res.rows);
- });
- // this.approveList()
- },
- watch: {
- $route(to, from) {
- this.powerGrade = localStorage.getItem('powerGrade');
- this.pageNum = 1;
- this.radio = [];
- if (to.path == '/signApprovalList' && from.path == '/home') {
- window.scrollTo(0, 0);
- this.approveList();
- }
- if (to.path == '/signApprovalList' && from.path == '/signApproval') {
- this.pageNum = 1;
- this.tabChange();
- }
- },
- },
- methods: {
- onregionConfirm(val) {
- this.module = val.key;
- this.companyName = val.name;
- this.RegionShow = false;
- },
- sortFN() {
- if (this.orderByStr == 'asc') {
- this.orderByStr = 'desc';
- } else {
- this.orderByStr = 'asc';
- }
- this.tabChange();
- },
- editorFn() {
- if (this.radio.length == 0) {
- this.$toast('请选择审批项!');
- return;
- }
- this.blackReason = '';
- this.submitShow = true;
- },
- outFn() {
- if (this.blackReason.trim() == '') {
- this.$toast('请输入审批意见!');
- return;
- }
- var taskIds = [];
- var instanceIds = [];
- for (var i = 0; i < this.radio.length; i++) {
- taskIds.push(this.radio[i].taskId);
- instanceIds.push(this.radio[i].instanceId);
- }
- var dormData = {
- taskIds: taskIds.join(','),
- instanceIds: instanceIds.join(','),
- variables: JSON.stringify({
- comment: this.blackReason,
- pass: false,
- }),
- };
- this.$dialog
- .confirm({
- message: '确认提交审批?',
- })
- .then(() => {
- completeAll(dormData).then((res) => {
- if (res.code == 200) {
- this.submitShow = false;
- this.radio = [];
- this.$toast('驳回成功!');
- this.pageNum = 1;
- this.approveList();
- } else {
- this.$toast(res.msg);
- }
- });
- });
- },
- submit() {
- var taskIds = [];
- var instanceIds = [];
- for (var i = 0; i < this.radio.length; i++) {
- taskIds.push(this.radio[i].taskId);
- instanceIds.push(this.radio[i].instanceId);
- }
- var dormData = {
- taskIds: taskIds.join(','),
- instanceIds: instanceIds.join(','),
- variables: JSON.stringify({
- comment: this.blackReason,
- pass: true,
- }),
- };
- this.$dialog
- .confirm({
- message: '确认提交审批?',
- })
- .then(() => {
- completeAll(dormData).then((res) => {
- if (res.code == 200) {
- this.radio = [];
- this.$toast('提交成功!');
- this.submitShow = false;
- this.pageNum = 1;
- this.approveList();
- } else {
- this.$toast(res.msg);
- }
- });
- });
- },
- onLoad() {
- this.disabled = true;
- if (this.isHandle == 2) {
- this.approveMyList();
- } else {
- this.approveList();
- }
- },
- onSearchm() {
- this.tabChange();
- },
- approveFn(row) {
- this.list = [];
- this.$router.push({
- path: '/signApproval',
- query: {
- signId: row.signId,
- addressLine: row.addressLine,
- type: this.isHandle,
- itemType: row.itemType,
- taskId: row.taskId,
- instanceId: row.instanceId,
- visitsId: row.visitsId,
- },
- });
- },
- tabChange() {
- window.scrollTo(0, 0);
- this.disabled = true;
- this.list = [];
- this.pageNum = 1;
- if (this.isHandle == 2) {
- this.approveMyList();
- } else {
- this.approveList();
- }
- },
- approveMyList() {
- let loading1 = this.$toast.loading({
- duration: 0,
- message: '数据加载中...',
- forbidClick: true,
- });
- if (this.refreshing) {
- this.list = [];
- this.refreshing = false;
- }
- getTodoItemMyList({
- pageNum: this.pageNum,
- module: this.module,
- pageSize: this.pageSize,
- param: this.param,
- orderByStr: this.orderByStr,
- }).then((res) => {
- loading1.clear();
- this.disabled = false;
- this.loading = false;
- if (this.pageNum == 1) {
- this.list = [];
- this.refreshing = false;
- }
- this.list = this.list.concat(res.rows);
- if (this.list.length >= res.total) {
- this.finished = true;
- } else {
- this.finished = false;
- }
- this.pageNum = this.pageNum + 1;
- });
- },
- approveList() {
- let loading1 = this.$toast.loading({
- duration: 0,
- message: '数据加载中...',
- forbidClick: true,
- });
- if (this.refreshing) {
- this.list = [];
- this.refreshing = false;
- }
- getTodoItemList({
- isHandle: this.isHandle,
- module: this.module,
- pageNum: this.pageNum,
- pageSize: this.pageSize,
- param: this.param,
- orderByStr: this.orderByStr,
- }).then((res) => {
- loading1.clear();
- this.disabled = false;
- this.loading = false;
- if (this.pageNum == 1) {
- this.list = [];
- this.refreshing = false;
- }
- this.list = this.list.concat(res.rows);
- if (this.list.length >= res.total) {
- this.finished = true;
- } else {
- this.finished = false;
- }
- this.pageNum = this.pageNum + 1;
- });
- },
- onClickLeft() {
- this.$router.push('/home');
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .bgcolor {
- background-color: #f5f5f5;
- }
- .serchInput {
- padding: 0 14px;
- margin-top: 14px;
- }
- .monthNow {
- height: 34px;
- line-height: 34px;
- text-align: left;
- font-weight: bold;
- padding: 0 16px;
- box-sizing: border-box;
- background-color: #f1f1f1;
- border-radius: 20px;
- border: 1px solid #ccc;
- position: relative;
- color: #333;
- font-size: 14px;
- .van-cell__left-icon,
- .van-cell__right-icon {
- line-height: 34px;
- }
- .CalendarIcon {
- float: right;
- font-size: 24px;
- color: #1989fa;
- margin-top: 6px;
- position: absolute;
- right: 12px;
- img {
- height: 0.8em;
- }
- }
- }
- .monthNowpro {
- color: #ccc;
- }
- .cardContent {
- box-sizing: border-box;
- }
- .cardContent .title {
- font-size: 14px;
- font-weight: bold;
- color: #333;
- line-height: 14px;
- }
- .cardContent .info {
- font-size: 14px;
- color: #999;
- line-height: 26px;
- }
- .cardContent .title p {
- padding: 0;
- margin: 0;
- }
- .cardContent .title .textLeft {
- display: inline-block;
- padding-bottom: 10px;
- }
- .cardContent .title .textRight {
- float: right;
- color: #0057ba;
- }
- .van-tab--active {
- color: #0057ba;
- }
- .brud {
- margin: 16px;
- border-radius: 8px;
- overflow: hidden;
- }
- .weekList {
- border-radius: 0;
- }
- .Btn {
- margin: 0 auto 10px;
- display: block;
- width: 90%;
- border-radius: 5px;
- color: #fff !important;
- background-color: #0057ba;
- border: 1px solid #0057ba;
- height: 36px;
- }
- .BtnBorder {
- margin: 0 auto 10px;
- display: block;
- width: 90%;
- border-radius: 5px;
- border: 1px solid #0057ba;
- color: #0057ba;
- height: 36px;
- }
- .weekList .van-cell {
- border-radius: 6px;
- overflow: hidden;
- }
- .weekList .cardContent .title {
- line-height: 32px;
- }
- .weekList .van-cell__right-icon {
- top: 4px;
- }
- .searchDiv {
- .van-search {
- background: #fff;
- }
- .van-search__action {
- font-size: 14px;
- color: #0057ba;
- font-weight: bold;
- background: #f1f1f1;
- border-bottom-right-radius: 60px;
- border-top-right-radius: 60px;
- border: 1px solid #ccc;
- padding: 0 20px;
- }
- .van-search--show-action {
- padding-right: 12px;
- }
- .van-search__content {
- border: 1px solid #ccc;
- border-bottom-left-radius: 60px;
- border-top-left-radius: 60px;
- background: #f1f1f1;
- border-right: 0;
- }
- }
- </style>
|