examineFile.vue 8.8 KB

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