index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. <template>
  2. <div id="inimain">
  3. <div class="inicontainer" v-if="isShow">
  4. <div
  5. class="top"
  6. v-for="(item, index) in initiatedList"
  7. :key="index"
  8. @click="goDetails(item)"
  9. >
  10. <div class="header" style="font-weight: 500px">
  11. <i class="iconfont iconshu"></i>
  12. {{ item.workName }}
  13. </div>
  14. <div class="middle">
  15. <div class="middle_flex" v-if="item.houseId && item.workName.indexOf('药剂') == -1 && item.type !== 'code1'">
  16. <div>仓号:</div>
  17. <div>{{ hourseDic[item.houseId] }}</div>
  18. </div>
  19. <div class="middle_flex">
  20. <div>申请人:</div>
  21. <div>{{ item.applyName }}</div>
  22. </div>
  23. <div class="middle_flex">
  24. <div>申请部门:</div>
  25. <div>{{ item.departmentName }}</div>
  26. </div>
  27. <div class="middle_flex">
  28. <div>公司:</div>
  29. <div>{{ item.companyName }}</div>
  30. </div>
  31. </div>
  32. <div class="div_border"></div>
  33. <div class="bottom_flex">
  34. <div class="applyTime">{{ item.applyTime }}</div>
  35. <span @click="goDetails(item)" v-if="item.auditState == 0"
  36. >审批中</span
  37. >
  38. <!-- <el-button
  39. type="success"
  40. size="mini"
  41. plain
  42. @click="goDetails(item)"
  43. v-if="item.auditState == 0"
  44. >
  45. 待审批
  46. </el-button> -->
  47. <span
  48. @click="goDetails(item)"
  49. v-else-if="item.auditState == 1"
  50. >审批中</span
  51. >
  52. <!-- <el-button
  53. type="success"
  54. size="mini"
  55. plain
  56. @click="goDetails(item)" v-else-if="item.auditState == 1"
  57. >审批通过</el-button
  58. > -->
  59. <span
  60. style="color: red"
  61. @click="goDetails(item)"
  62. v-else-if="item.auditState == 2"
  63. >审批不通过</span
  64. >
  65. <!-- <el-button
  66. style="background:#ec1313;color:white"
  67. size="mini"
  68. @click="goDetails(item)" v-else-if="item.auditState == 2"
  69. >审批不通过</el-button
  70. > -->
  71. <span style="color:#037D41" @click="goDetails(item)" v-else-if="item.auditState == 3"
  72. >审批通过</span
  73. >
  74. <!-- <el-button
  75. type="success"
  76. size="mini"
  77. plain
  78. @click="goDetails(item)" v-else-if="item.auditState == 3"
  79. >审批完成进行中</el-button
  80. > -->
  81. <span style="color:#037D41" @click="goDetails(item)" v-else>审批通过</span>
  82. <!-- <el-button
  83. type="success"
  84. size="mini"
  85. plain
  86. @click="goDetails(item)" v-else>已完成</el-button> -->
  87. </div>
  88. </div>
  89. <el-pagination
  90. background
  91. @size-change="sizeChange"
  92. v-if="pagination.total != 0"
  93. @current-change="handleCurrentChange"
  94. :page-count="5"
  95. :page-sizes="[10, 20, 30, 40]"
  96. :page-size="pagination.pageSize"
  97. layout="total, sizes, prev, pager, next, jumper"
  98. :total="pagination.total"
  99. ></el-pagination>
  100. </div>
  101. <div>
  102. <router-view />
  103. </div>
  104. </div>
  105. </template>
  106. <script>
  107. import { initiated } from "@/api/daiBan/index"
  108. import { getUser } from "@/utils/auth"
  109. export default {
  110. name: "Initiated",
  111. data() {
  112. return {
  113. //列表数据的长度
  114. initLength: null,
  115. //人员字典数据
  116. perList: {},
  117. //库字典数据
  118. deportDic: {},
  119. //仓房字典数据
  120. hourseDic: {},
  121. //部门字典数据
  122. departDic: {},
  123. //审批流程id
  124. processId: "",
  125. isShow: true,
  126. //存储用户信息
  127. userInfo: {},
  128. //已发起列表
  129. initiatedList: [],
  130. //分页
  131. pagination: {
  132. //当前页数
  133. curPage: 1,
  134. //每页显示的条数
  135. pageSize: 10,
  136. //总条数
  137. total: 0,
  138. },
  139. }
  140. },
  141. mounted() {
  142. console.log(this.$route)
  143. if (this.$route.name == "IniDetails" || this.$route.name == "IniXunzengDetails") {
  144. this.isShow = false
  145. } else {
  146. this.isShow = true
  147. }
  148. this.userInfo = JSON.parse(getUser())
  149. console.log(this.userInfo, "this.userInfo.....?????")
  150. this.getInitiated()
  151. //人员
  152. this.perList = JSON.parse(localStorage.getItem("perList"))
  153. console.log(this.perList, " this.perList...")
  154. //库字典数据
  155. this.deportDic = JSON.parse(localStorage.getItem("deportDic"))
  156. console.log(this.deportDic, " this.deportDic...")
  157. //仓房字典数据
  158. this.hourseDic = JSON.parse(localStorage.getItem("hourseDic"))
  159. console.log(this.hourseDic, " this.hourseDic...")
  160. //部门字典数据
  161. this.departDic = JSON.parse(localStorage.getItem("departDic"))
  162. console.log(this.departDic, " this.departDic...")
  163. },
  164. methods: {
  165. goDetails(item) {
  166. // let userInfo = JSON.parse(getUser())
  167. // console.log(userInfo,"/////")
  168. // let homeType = userInfo.homeType
  169. var homeType = this.userInfo.homeType
  170. if(item.type == 'xzjh' || item.type == 'xzsq' || item.type == 'sswxjh' || item.type == 'sswxys' || item.type == 'sbcg'|| item.type == 'sbwx'||item.type == 'sbbf'||item.type == 'sbly'||item.type == 'sbgh'){
  171. if (homeType == 1) {
  172. this.$router.push({
  173. path: "/dashboard/daiban/initiated/inixunzengDetails",
  174. query: {
  175. processId: item.processId,
  176. houseName: item.houseName,
  177. applyName: item.applyName,
  178. departmentName: item.departmentName,
  179. companyName: item.companyName,
  180. workName: item.workName,
  181. ongoingStep: item.ongoingStep,
  182. type: item.type
  183. },
  184. })
  185. } else if (homeType == 2) {
  186. this.$router.push({
  187. path: "/dashboard/daiban/initiated/inixunzengDetails",
  188. query: {
  189. processId: item.processId,
  190. houseName: item.houseName,
  191. applyName: item.applyName,
  192. departmentName: item.departmentName,
  193. companyName: item.companyName,
  194. workName: item.workName,
  195. ongoingStep: item.ongoingStep,
  196. type: item.type
  197. },
  198. })
  199. } else if (homeType == 3) {
  200. this.$router.push({
  201. path: "/home/daiban/initiated/inixunzengDetails",
  202. query: {
  203. processId: item.processId,
  204. houseName: item.houseName,
  205. applyName: item.applyName,
  206. departmentName: item.departmentName,
  207. companyName: item.companyName,
  208. workName: item.workName,
  209. ongoingStep: item.ongoingStep,
  210. type: item.type
  211. },
  212. })
  213. }
  214. }else{
  215. if (homeType == 1) {
  216. this.$router.push({
  217. path: "/dashboard/daiban/initiated/iniDetails",
  218. query: {
  219. processId: item.processId,
  220. houseName: item.houseName,
  221. applyName: item.applyName,
  222. departmentName: item.departmentName,
  223. companyName: item.companyName,
  224. workName: item.workName,
  225. ongoingStep: item.ongoingStep
  226. },
  227. })
  228. } else if (homeType == 2) {
  229. this.$router.push({
  230. path: "/dashboard/daiban/initiated/iniDetails",
  231. query: {
  232. processId: item.processId,
  233. houseName: item.houseName,
  234. applyName: item.applyName,
  235. departmentName: item.departmentName,
  236. companyName: item.companyName,
  237. workName: item.workName,
  238. ongoingStep: item.ongoingStep
  239. },
  240. })
  241. } else if (homeType == 3) {
  242. this.$router.push({
  243. path: "/home/daiban/initiated/iniDetails",
  244. query: {
  245. processId: item.processId,
  246. houseName: item.houseName,
  247. applyName: item.applyName,
  248. departmentName: item.departmentName,
  249. companyName: item.companyName,
  250. workName: item.workName,
  251. ongoingStep: item.ongoingStep
  252. },
  253. })
  254. }
  255. }
  256. },
  257. //列表数据
  258. getInitiated() {
  259. var condition = {
  260. userId: this.userInfo.uid,
  261. }
  262. console.log(condition, "condition.....")
  263. condition = JSON.stringify(condition)
  264. var data = {
  265. pageIndex: this.pagination.curPage,
  266. pageSize: this.pagination.pageSize,
  267. condition: condition,
  268. }
  269. initiated(data).then((res) => {
  270. console.log(res, "res....")
  271. if (res.code == 200) {
  272. this.initiatedList = res.data.records
  273. this.initLength = this.initiatedList.length
  274. console.log(this.initLength, " this.initLength.....")
  275. this.pagination.total = res.data.total
  276. }
  277. })
  278. },
  279. //当前页发生变化时
  280. handleCurrentChange(val) {
  281. console.log(val, "val...")
  282. this.pagination.curPage = val
  283. this.getInitiated()
  284. },
  285. //页数大小发生变化时
  286. sizeChange(v) {
  287. this.pagination.pageSize = v;
  288. this.getInitiated();
  289. },
  290. },
  291. }
  292. </script>
  293. <style lang="scss" >
  294. #inimain {
  295. // height: 100%;
  296. .inicontainer {
  297. width: 100%;
  298. .top {
  299. height: 150px;
  300. background: #ffffff;
  301. border-radius: 6px;
  302. padding: 10px;
  303. margin-bottom: 10px;
  304. .header {
  305. font-weight: 500;
  306. font-size: 18px;
  307. color: #037d41;
  308. height: 20%;
  309. margin-bottom: 20px;
  310. }
  311. .middle {
  312. margin-bottom: 20px;
  313. width: 80%;
  314. display: flex;
  315. justify-content: space-between;
  316. margin-left:20px;
  317. .middle_flex {
  318. display: flex;
  319. }
  320. }
  321. .div_border {
  322. border-top: 1px solid #f3f3f3;
  323. margin-bottom: 20px;
  324. }
  325. .bottom_flex {
  326. margin-left:20px;
  327. display: flex;
  328. justify-content: space-between;
  329. .applyTime{
  330. color: #999;
  331. font-size:14px
  332. }
  333. }
  334. }
  335. .el-pagination {
  336. text-align: right;
  337. margin-top: 20px;
  338. }
  339. }
  340. }
  341. </style>