examineFile.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  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 == '办公室主任') {
  103. this.isoffice = true
  104. let gw1 = data.filter(item => {
  105. return item.which == 0
  106. })
  107. this.auditForm = gw1[0]
  108. console.log("gwForm",this.gwForm);
  109. }
  110. if (role == '局领导' && gw.length > 0) this.isleader = true
  111. if (role == '科室负责人' && gw.length > 0) this.isundertake = true
  112. })
  113. },
  114. components: {
  115. fileCard,
  116. signInput,
  117. officeUserSelect
  118. },
  119. mounted() {
  120. this.searchForm.officeDTO.id = "1770354910488272897"
  121. userService.list({
  122. current: this.tablePage.currentPage,
  123. size: this.tablePage.pageSize,
  124. orders: this.tablePage.orders,
  125. ...this.searchForm
  126. }).then(data => {
  127. this.leaderList = data.records
  128. })
  129. },
  130. data() {
  131. return {
  132. loading: false,
  133. isAll: false,
  134. show: false,
  135. one: true,
  136. action: this.BASE_URL + '/gwfile/upload?uploadPath=sign', //上传服务器的地址
  137. header: {"token": $auth.getUserToken()}, //图片上传携带头部信息
  138. auditForm: {
  139. id: '',
  140. gwId: '',
  141. content: '',
  142. signfj: '',
  143. createTruename: '',
  144. nextTruename: '',
  145. nextUser: '',
  146. which: '0',
  147. state: '0',
  148. next: '',
  149. nextLeadUser: '',
  150. nextDepUser: '',
  151. remark: '',
  152. },
  153. gwForm:{},
  154. gwId: "",
  155. isoffice: false,
  156. isleader: false,
  157. isundertake: false,
  158. leaderList: [],
  159. tablePage: {
  160. total: 0,
  161. currentPage: 1,
  162. pageSize: 1000,
  163. orders: [{
  164. column: "a.create_time",
  165. asc: false
  166. }],
  167. },
  168. searchForm: {
  169. loginName: "",
  170. name: "",
  171. companyDTO: {
  172. id: "",
  173. },
  174. officeDTO: {
  175. id: "",
  176. },
  177. },
  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. console.log("签字=====",e);
  197. this.auditForm.signfj = e.data
  198. if (e.error_code && e.error_code === '201') {
  199. uni.showToast({
  200. title: e.msg,
  201. icon: 'none'
  202. })
  203. return
  204. }
  205. },
  206. // 提交表单
  207. doSubmit() {
  208. let inputForm={};
  209. this.loading = true
  210. // if(this.one){
  211. if (this.auditForm.nextLeadUser != '' || this.auditForm.nextDepUser != '') this.auditForm.next = '1'
  212. this.auditForm.state = "0"
  213. this.auditForm.gwId = this.gwId
  214. inputForm = this.auditForm
  215. // }else {
  216. // this.gwForm.nextLeadUser = this.gwForm.nextLeadUser + "," +this.auditForm.nextLeadUser
  217. // this.gwForm.nextDepUser = this.auditForm.nextDepUser+ "," +this.auditForm.nextDepUser
  218. // inputForm = this.gwForm
  219. // }
  220. gwFlowService.save(inputForm).then(data => {
  221. let param = {
  222. type: 'success',
  223. message: data,
  224. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png',
  225. url:"/pages/fileTransmit/fileTransmitList?type=1"
  226. }
  227. this.showToast(param);
  228. }).catch(() => {
  229. let param = {
  230. type: 'error',
  231. message: data,
  232. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png',
  233. }
  234. this.showToast(param);
  235. })
  236. },
  237. // 归档
  238. formSubmit() {
  239. gwCirculationCard2Service.queryById(this.gwId).then(data => {
  240. data.state = '3'
  241. gwCirculationCard2Service.save(data).then(res => {
  242. let param = {
  243. type: 'success',
  244. message: data,
  245. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png',
  246. }
  247. this.showToast(param);
  248. setTimeout(() => {
  249. uni.navigateTo({
  250. url: 'pages/fileTransmit/fileTransmitList?type=3'
  251. });
  252. }, 500)
  253. }).catch(() => {
  254. let param = {
  255. type: 'error',
  256. message: data,
  257. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png',
  258. }
  259. this.showToast(param);
  260. })
  261. })
  262. }
  263. }
  264. }
  265. </script>
  266. <style>
  267. .office_main {
  268. width: 100%;
  269. margin: 5px 0;
  270. padding: 0 20px;
  271. background-color: #fefefe;
  272. }
  273. .office_main .office_title {
  274. width: 100%;
  275. border-bottom: 1px solid #eee;
  276. }
  277. .submit_btn {
  278. background-color: #fefefe;
  279. bottom: 10px;
  280. box-shadow: none;
  281. padding: 20px 0;
  282. }
  283. .submit_btn button {
  284. height: 40px;
  285. width: 40%;
  286. border-radius: 30px;
  287. }
  288. </style>