examineFile.vue 7.7 KB

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