examineFile.vue 9.1 KB

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