examineFile.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <view class="office_page">
  3. <fileCard :gwId="gwId"></fileCard>
  4. <view class="office_main">
  5. <view class="office_title">
  6. <uni-section v-if="isoffice" titleColor="#36a7f3" class="mb-10" title="办公室拟办" type="line"></uni-section>
  7. <uni-section v-if="isleader" titleColor="#36a7f3" class="mb-10" title="领导批示" type="line"></uni-section>
  8. <uni-section v-if="isundertake" titleColor="#36a7f3" class="mb-10" title="承办科室"
  9. type="line"></uni-section>
  10. </view>
  11. <view class="office_info">
  12. <u--form v-if="isoffice" :model="auditForm" labelWidth="130px" class="u-form default_title"
  13. labelPosition="left" ref="auditForm">
  14. <u-form-item v-if="one" label="办公室拟办" borderBottom prop="content">
  15. <u--textarea v-model="auditForm.content" placeholder=""></u--textarea>
  16. </u-form-item>
  17. <u-form-item label="转发领导" borderBottom prop="nextLeadUser">
  18. <jp-picker v-model="auditForm.nextLeadUser" placeholder="请选择转发领导" :range="leaderList"
  19. rangeKey="name" rangeValue="loginName"></jp-picker>
  20. </u-form-item>
  21. <u-form-item v-if="!one" label="科室承办" borderBottom prop="nextDepUser">
  22. <office-user-select v-model="auditForm.nextDepUser" placeholder="请选择科室承办"
  23. title="科室承办"></office-user-select>
  24. </u-form-item>
  25. <u-form-item v-if="one" label="备注" borderBottom prop="remark">
  26. <u--input v-model="auditForm.remark" placeholder="请输入备注" border="none"></u--input>
  27. </u-form-item>
  28. <!-- <u-form-item v-if="show" label="签字" borderBottom prop="signfj">
  29. <signInput ref="sign" canvasId="twoDrowCanvas" canvasIds="twoRotateCanvas" :header="header"
  30. :action="action" @signToUrl="signToUrl">
  31. </signInput>
  32. </u-form-item> -->
  33. <view class="submit_btn flex ">
  34. <u-button v-if="isAll" @click="formSubmit" type="success" text="归档"></u-button>
  35. <!-- <u-button v-if="!show && one" :disabled="!auditForm.nextLeadUser!=''" type="primary" text="确认签字"
  36. @click="show = true"></u-button> -->
  37. <u-button v-if="one && !loading" type="primary" :disabled="auditForm.nextLeadUser==''" text="确认签字" @click="doSubmit"></u-button>
  38. <u-button v-if="!one && !loading" type="primary" text="提交" @click="doSubmit"></u-button>
  39. <u-button v-if="loading" :loading="loading" type="primary" text="加载中"></u-button>
  40. </view>
  41. </u--form>
  42. <u--form v-if="isleader" :model="auditForm" labelWidth="130px" class="u-form default_title"
  43. labelPosition="left" ref="auditForm">
  44. <u-form-item label="领导批示" borderBottom prop="content">
  45. <u--textarea v-model="auditForm.content" placeholder=""></u--textarea>
  46. </u-form-item>
  47. <!-- <u-form-item v-if="show" label="签字" borderBottom prop="signfj">
  48. <signInput ref="sign" canvasId="twoDrowCanvas" canvasIds="twoRotateCanvas" :header="header"
  49. :action="action" @signToUrl="signToUrl">
  50. </signInput>
  51. </u-form-item> -->
  52. <view class="submit_btn flex ">
  53. <!-- <u-button v-if="!show" type="primary" text="确认签字" @click="show = true"></u-button> -->
  54. <u-button v-if="!loading" type="primary" text="确认签字" @click="doSubmit"></u-button>
  55. <u-button v-if="loading" :loading="loading" type="primary" text="加载中"></u-button>
  56. </view>
  57. </u--form>
  58. <u--form v-if="isundertake" :model="auditForm" labelWidth="130px" class="u-form default_title"
  59. labelPosition="left" ref="auditForm">
  60. <u-form-item label="承办科室" borderBottom prop="content">
  61. <u--textarea v-model="auditForm.content" placeholder=""></u--textarea>
  62. </u-form-item>
  63. <!-- <u-form-item v-if="show" label="签字" borderBottom prop="signfj">
  64. <signInput ref="sign" canvasId="twoDrowCanvas" canvasIds="twoRotateCanvas" :header="header"
  65. :action="action" @signToUrl="signToUrl">
  66. </signInput>
  67. </u-form-item> -->
  68. <view class="submit_btn flex ">
  69. <!-- <u-button v-if="!show" type="primary" text="确认签字" @click="show = true"></u-button> -->
  70. <u-button v-if="loading" :loading="loading" type="primary" text="加载中"></u-button>
  71. <u-button v-if="show && !loading" type="primary" text="确认签字" @click="doSubmit"></u-button>
  72. </view>
  73. </u--form>
  74. </view>
  75. </view>
  76. <u-toast ref="uToast"></u-toast>
  77. </view>
  78. </template>
  79. <script>
  80. import fileCard from "./fileCard.vue"
  81. import BASE_URL from '@/config.js'
  82. import moment from "moment"
  83. import signInput from "@/components/am-sign-input/am-sign-input.vue"
  84. import officeUserSelect from "@/components/office-user-select/office-user-select.vue"
  85. import userService from "@/api/sys/userService"
  86. import gwFlowService from '@/api/circulation/gwFlowService.js'
  87. import gwCirculationCard2Service from '@/api/circulation/gwCirculationCard2.js'
  88. import * as $auth from "@/common/auth.js"
  89. export default {
  90. onLoad(option) {
  91. this.gwId = option.id
  92. gwFlowService.queryByGwId(this.gwId).then(data => {
  93. if (data.length > 1) this.one = false
  94. if(this.one) {
  95. this.roleId = "1770353074553331713"
  96. }else {
  97. this.roleId = "1773547256256622594"
  98. }
  99. userService.leaderList(this.roleId).then(data => {
  100. this.leaderList = data
  101. if(this.one) this.auditForm.nextLeadUser =data[0].loginName
  102. })
  103. let user = $auth.getUserInfo()
  104. let role = $auth.getUserInfo().roleNames
  105. let gw = data.filter(item => {
  106. return item.nextUser == user.id && item.state == 1
  107. })
  108. let down = data.filter(item => item.state == 0)
  109. if (down.length == data.length) this.isAll = true
  110. if (gw.length > 0) {
  111. this.auditForm = gw[0]
  112. }
  113. if (role == '办公室主任') {
  114. this.isoffice = true
  115. let gw1 = data.filter(item => {
  116. return item.which == 0
  117. })
  118. this.auditForm = gw1[0]
  119. }
  120. if (role == '局领导' && gw.length > 0) this.isleader = true
  121. if (role == '科室负责人' && gw.length > 0) this.isundertake = true
  122. })
  123. },
  124. components: {
  125. fileCard,
  126. signInput,
  127. officeUserSelect
  128. },
  129. data() {
  130. return {
  131. loading: false,
  132. isAll: false,
  133. show: false,
  134. one: true,
  135. action: this.BASE_URL + '/gwfile/upload?uploadPath=sign', //上传服务器的地址
  136. header: {"token": $auth.getUserToken()}, //图片上传携带头部信息
  137. auditForm: {
  138. id: '',
  139. gwId: '',
  140. content: '',
  141. signfj: '',
  142. createTruename: '',
  143. nextTruename: '',
  144. nextUser: '',
  145. which: '0',
  146. state: '0',
  147. next: '',
  148. nextLeadUser: '',
  149. nextDepUser: '',
  150. remark: '',
  151. },
  152. gwForm:{},
  153. gwId: "",
  154. isoffice: false,
  155. isleader: false,
  156. isundertake: false,
  157. leaderList: [],
  158. tablePage: {
  159. total: 0,
  160. currentPage: 1,
  161. pageSize: 1000,
  162. orders: [{
  163. column: "a.create_time",
  164. asc: false
  165. }],
  166. },
  167. searchForm: {
  168. // loginName: "",
  169. // name: "",
  170. // companyDTO: {
  171. // id: "",
  172. // },
  173. // officeDTO: {
  174. // id: "",
  175. // },
  176. },
  177. roleId:""
  178. }
  179. },
  180. methods: {
  181. showToast(params) {
  182. this.$refs.uToast.show({
  183. ...params,
  184. complete() {
  185. params.url && uni.redirectTo({
  186. url: params.url
  187. })
  188. }
  189. })
  190. },
  191. /**
  192. * @param {Object} e
  193. * 签名完成回调
  194. */
  195. signToUrl(e) {
  196. this.auditForm.signfj = e.data
  197. if (e.error_code && e.error_code === '201') {
  198. uni.showToast({
  199. title: e.msg,
  200. icon: 'none'
  201. })
  202. return
  203. }
  204. },
  205. // 提交表单
  206. doSubmit() {
  207. let inputForm={};
  208. this.loading = true
  209. if (this.auditForm.nextLeadUser != '' || this.auditForm.nextDepUser != '') this.auditForm.next = '1'
  210. this.auditForm.state = "0"
  211. this.auditForm.gwId = this.gwId
  212. const date = moment().format('YYYY-MM-DD HH:mm:ss');
  213. this.auditForm.updateTime = date
  214. inputForm = this.auditForm
  215. gwFlowService.save(inputForm).then(data => {
  216. let param = {
  217. type: 'success',
  218. message: data,
  219. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png',
  220. url:"/pages/fileTransmit/fileTransmitList?type=1"
  221. }
  222. this.showToast(param);
  223. }).catch(() => {
  224. let param = {
  225. type: 'error',
  226. message: data,
  227. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png',
  228. }
  229. this.showToast(param);
  230. })
  231. },
  232. // 归档
  233. formSubmit() {
  234. gwCirculationCard2Service.queryById(this.gwId).then(data => {
  235. data.state = '3'
  236. gwCirculationCard2Service.save(data).then(res => {
  237. let param = {
  238. type: 'success',
  239. message: "已归档",
  240. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png',
  241. }
  242. this.showToast(param);
  243. setTimeout(() => {
  244. uni.navigateTo({
  245. url: 'pages/fileTransmit/fileTransmitList?type=3'
  246. });
  247. }, 500)
  248. }).catch(() => {
  249. let param = {
  250. type: 'error',
  251. message: data,
  252. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png',
  253. }
  254. this.showToast(param);
  255. })
  256. })
  257. }
  258. }
  259. }
  260. </script>
  261. <style>
  262. .office_main {
  263. width: 100%;
  264. margin: 5px 0;
  265. padding: 0 20px;
  266. background-color: #fefefe;
  267. }
  268. .office_main .office_title {
  269. width: 100%;
  270. border-bottom: 1px solid #eee;
  271. }
  272. .submit_btn {
  273. background-color: #fefefe;
  274. bottom: 10px;
  275. box-shadow: none;
  276. padding: 20px 0;
  277. }
  278. .submit_btn button {
  279. height: 40px;
  280. width: 40%;
  281. border-radius: 30px;
  282. }
  283. </style>