index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. <template>
  2. <div class="processApproval">
  3. <div class="left-card">
  4. <div class="top">
  5. <div class="commons-title title">流程标题</div>
  6. <SendSubscribe
  7. ref="makeDom"
  8. v-if="queryData.data.isSubscribe == '10'"
  9. ></SendSubscribe>
  10. <SendPurchase
  11. ref="makeDom"
  12. v-else-if="queryData.data.isSubscribe == '20'"
  13. :queryData="queryData.data"
  14. ></SendPurchase>
  15. <SendFunds
  16. ref="makeDom"
  17. v-else-if="queryData.data.isSubscribe == '30'"
  18. :queryData="queryData.data"
  19. ></SendFunds>
  20. </div>
  21. <div class="bottom">
  22. <div class="commons-title title">处理意见</div>
  23. <el-form :model="flowForm" :rules="flowRules" ref="flowFormDom">
  24. <el-form-item prop="remark" label-width="0px" label="">
  25. <el-input
  26. type="textarea"
  27. placeholder="请输入"
  28. v-model="flowForm.remark"
  29. >
  30. </el-input>
  31. </el-form-item>
  32. <el-form-item>
  33. <el-button @click="handleSubmit"> ceshi </el-button>
  34. </el-form-item>
  35. </el-form>
  36. </div>
  37. </div>
  38. <div class="right-card">
  39. <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
  40. <el-tab-pane label="审批记录" name="first">
  41. <ul class="flow-chart">
  42. <li>
  43. <div class="left-icon">
  44. <i class="iconfont icon-iconm_daick"></i>
  45. <i class="iconfont icon-iconm_daohzj right-btm-status"></i>
  46. </div>
  47. <div class="right-conetnt">
  48. <div class="name">
  49. 发起人:张三
  50. <span>2022-11-11 00:00:00</span>
  51. </div>
  52. <div class="remark">
  53. <div class="label">发起审批</div>
  54. 1231231231231321231
  55. </div>
  56. </div>
  57. <div class="line"></div>
  58. </li>
  59. <li>
  60. <div class="left-icon">
  61. <i class="iconfont icon-iconm_daick"></i>
  62. <i class="iconfont icon-iconm_daohzj right-btm-status"></i>
  63. </div>
  64. <div class="right-conetnt">
  65. <div class="name">
  66. 发起人:张三
  67. <span>2022-11-11 00:00:00</span>
  68. </div>
  69. <div class="remark">
  70. <div class="label">发起审批</div>
  71. <div>
  72. 啊圣诞快乐家里快速打击啊老师的煎熬老师的煎熬上来看大家速度快垃圾上单绿卡数据的卡拉数据的卡拉设计的拉开时间
  73. </div>
  74. </div>
  75. </div>
  76. <div class="line"></div>
  77. </li>
  78. <li>
  79. <div class="left-icon">
  80. <i class="iconfont icon-iconm_daick"></i>
  81. <i class="iconfont icon-iconm_daohzj right-btm-status"></i>
  82. </div>
  83. <div class="right-conetnt">
  84. <div class="name">
  85. 发起人:张三
  86. <span>2022-11-11 00:00:00</span>
  87. </div>
  88. <div class="remark">
  89. <div class="label">发起审批</div>
  90. <div>
  91. 啊圣诞快乐家里快速打击啊老师的煎熬老师的煎熬上来看大家速度快垃圾上单绿卡数据的卡拉数据的卡拉设计的拉开时间
  92. </div>
  93. </div>
  94. </div>
  95. <div class="line"></div>
  96. </li>
  97. <li>
  98. <div class="left-icon">
  99. <i class="iconfont icon-iconm_daick"></i>
  100. <i class="iconfont icon-iconm_daohzj right-btm-status"></i>
  101. </div>
  102. <div class="right-conetnt">
  103. <div class="name">
  104. 发起人:张三
  105. <span>2022-11-11 00:00:00</span>
  106. </div>
  107. <div class="remark">
  108. <div class="label">发起审批</div>
  109. <div>
  110. 啊圣诞快乐家里快速打击啊老师的煎熬老师的煎熬上来看大家速度快垃圾上单绿卡数据的卡拉数据的卡拉设计的拉开时间
  111. </div>
  112. </div>
  113. </div>
  114. <div class="line"></div>
  115. </li>
  116. <li>
  117. <div class="left-icon">
  118. <i class="iconfont icon-iconm_daick"></i>
  119. <i class="iconfont icon-iconm_daohzj right-btm-status"></i>
  120. </div>
  121. <div class="right-conetnt">
  122. <div class="name">
  123. 发起人:张三
  124. <span>2022-11-11 00:00:00</span>
  125. </div>
  126. <div class="remark">
  127. <div class="label">发起审批</div>
  128. <div>
  129. 啊圣诞快乐家里快速打击啊老师的煎熬老师的煎熬上来看大家速度快垃圾上单绿卡数据的卡拉数据的卡拉设计的拉开时间
  130. </div>
  131. </div>
  132. </div>
  133. <div class="line"></div>
  134. </li>
  135. </ul>
  136. </el-tab-pane>
  137. <el-tab-pane label="决策辅助" name="second">决策辅助</el-tab-pane>
  138. </el-tabs>
  139. </div>
  140. </div>
  141. </template>
  142. <script setup>
  143. import { useRouter, useRoute } from "vue-router";
  144. const router = useRouter();
  145. const route = useRoute();
  146. //申购发起
  147. import SendSubscribe from "@/components/process/SendSubscribe";
  148. //采购发起
  149. import SendPurchase from "@/components/process/SendPurchase";
  150. //请款发起
  151. import SendFunds from "@/components/process/SendFunds";
  152. // 消息提示
  153. import { ElMessage, ElMessageBox } from "element-plus";
  154. // tab切换逻辑
  155. const activeName = ref("first");
  156. const handleClick = (tab, event) => {
  157. // console.log(tab, event);
  158. };
  159. // 意见表单
  160. const flowForm = reactive({
  161. flowKey: "",
  162. handleUserId: "",
  163. remark: "",
  164. data: {},
  165. });
  166. const flowRules = reactive({
  167. remark: [{ required: true, message: "请输入处理意见", trigger: "blur" }],
  168. });
  169. //组件实例
  170. const { proxy } = getCurrentInstance();
  171. const makeDom = ref(null);
  172. const flowFormDom = ref(null);
  173. // 提交逻辑
  174. const handleSubmit = async () => {
  175. try {
  176. // 调用发起组件的提交事件
  177. const flag = await makeDom.value.handleSubmit();
  178. if (flag) {
  179. flowFormDom.value.validate((vaild) => {
  180. if (vaild) {
  181. if (queryData.data.isSubscribe == "10") {
  182. const data = makeDom.value.submitData;
  183. data.subscribeDetailList = data.subscribeDetailList.map((x) => ({
  184. bussinessId: x.bussinessId,
  185. count: x.count,
  186. remark: x.remark,
  187. }));
  188. proxy.post("/subscribe/add", data).then((res) => {
  189. skipPage();
  190. });
  191. } else if (queryData.data.isSubscribe == "20") {
  192. const data = makeDom.value.submitData;
  193. data.purchaseDetailList = data.purchaseDetailList.map((x) => ({
  194. bussinessId: x.bussinessId,
  195. subscribeDetailId: x.id,
  196. count: x.count,
  197. price: x.price,
  198. amount: x.amount,
  199. }));
  200. proxy.post("/purchase/add", data).then((res) => {
  201. skipPage();
  202. });
  203. } else if (queryData.data.isSubscribe == "30") {
  204. const data = makeDom.value.submitData;
  205. data.purchaseDetailList = data.purchaseDetailList.map((x) => ({
  206. bussinessId: x.bussinessId,
  207. subscribeDetailId: x.id,
  208. count: x.count,
  209. price: x.price,
  210. amount: x.amount,
  211. }));
  212. proxy.post("/purchase/add", data).then((res) => {
  213. skipPage();
  214. });
  215. }
  216. }
  217. });
  218. }
  219. } catch (err) {
  220. console.log("数据未填完整!", err);
  221. }
  222. };
  223. // 页面跳转
  224. const skipPage = () => {
  225. ElMessage({
  226. message: "操作成功!",
  227. type: "success",
  228. });
  229. if (queryData.data.isSubscribe == "10") {
  230. router.replace({
  231. path: "/purchaseManage/purchaseManage/subscribe",
  232. });
  233. } else if (queryData.data.isSubscribe == "20") {
  234. router.replace({
  235. path: "/purchaseManage/purchaseManage/purchase",
  236. });
  237. } else if (queryData.data.isSubscribe == "30") {
  238. router.replace({
  239. path: "/finance/fundManage/funds",
  240. });
  241. }
  242. };
  243. let queryData = reactive({
  244. data: {},
  245. });
  246. onMounted(() => {
  247. queryData.data = { ...route.query };
  248. });
  249. </script>
  250. <style lang="scss" scoped>
  251. .processApproval {
  252. display: flex;
  253. justify-content: space-between;
  254. margin-top: 20px;
  255. padding: 0 20px;
  256. height: calc(100vh - 130px);
  257. .left-card {
  258. background: #fff;
  259. border-radius: 4px;
  260. padding: 20px;
  261. flex: 1;
  262. margin-right: 20px;
  263. display: flex;
  264. flex-direction: column;
  265. .top {
  266. flex: 1;
  267. overflow-y: auto;
  268. background: #fff;
  269. }
  270. .bottom {
  271. height: 155px;
  272. background: #fff;
  273. }
  274. }
  275. .right-card {
  276. background: #fff;
  277. border-radius: 4px;
  278. padding: 0 20px 20px;
  279. width: 400px;
  280. box-sizing: border-box;
  281. .flow-chart {
  282. overflow: auto;
  283. padding: 0;
  284. margin: 0;
  285. li {
  286. margin: 0;
  287. padding: 0 0 20px;
  288. list-style: none;
  289. display: flex;
  290. justify-content: space-between;
  291. position: relative;
  292. .right-conetnt {
  293. flex: 1;
  294. .name {
  295. font-size: 12px;
  296. color: #333;
  297. margin-bottom: 10px;
  298. span {
  299. color: #999;
  300. float: right;
  301. }
  302. }
  303. .remark {
  304. padding: 10px;
  305. color: #666666;
  306. font-size: 12px;
  307. background: #f1f1f1;
  308. border-radius: 2px;
  309. .label {
  310. color: #39c55a;
  311. margin-bottom: 10px;
  312. }
  313. }
  314. }
  315. .left-icon {
  316. width: 40px;
  317. height: 40px;
  318. text-align: center;
  319. line-height: 40px;
  320. background: #0084ff;
  321. border-radius: 10px;
  322. color: #fff;
  323. font-size: 20px;
  324. position: relative;
  325. margin-right: 27px;
  326. z-index: 2;
  327. .right-btm-status {
  328. position: absolute;
  329. bottom: 0px;
  330. right: -10px;
  331. height: 20px;
  332. width: 20px;
  333. line-height: 16px;
  334. border-radius: 10px;
  335. background: #39c55a;
  336. border: 2px solid #fff;
  337. font-size: 12px;
  338. box-sizing: border-box;
  339. }
  340. }
  341. }
  342. li::before {
  343. content: "";
  344. position: absolute;
  345. top: 0;
  346. left: 20px;
  347. width: 2px;
  348. height: 100%;
  349. background: #ddd;
  350. z-index: 1;
  351. }
  352. li:last-child::before {
  353. display: none;
  354. }
  355. }
  356. }
  357. }
  358. </style>