examineFile.vue 8.3 KB

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