index.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <div class="ele-border-lighter form-content" v-loading="loading">
  5. <search-quotation @search="reload"> </search-quotation>
  6. <!-- 数据表格 -->
  7. <ele-pro-table
  8. ref="table"
  9. :columns="columns"
  10. :datasource="datasource"
  11. height="calc(100vh - 375px)"
  12. full-height="calc(100vh - 116px)"
  13. tool-class="ele-toolbar-form"
  14. :selection.sync="selection"
  15. cache-key="eomContactPageTable"
  16. >
  17. <!-- 表头工具栏 -->
  18. <template v-slot:toolbar>
  19. <el-button
  20. size="small"
  21. type="primary"
  22. icon="el-icon-plus"
  23. class="ele-btn-icon"
  24. @click="openEdit('add', {})"
  25. >
  26. 新建
  27. </el-button>
  28. <el-button
  29. size="small"
  30. type="danger"
  31. el-icon-delete
  32. class="ele-btn-icon"
  33. @click="allDelBtn"
  34. :disabled="selection?.length === 0"
  35. >
  36. 批量删除
  37. </el-button>
  38. </template>
  39. <!-- 查看详情列 -->
  40. <template v-slot:planCode="{ row }">
  41. <el-link type="primary" :underline="false" @click="openDetail(row)">
  42. {{ row.planCode }}</el-link
  43. >
  44. </template>
  45. <!-- 查看详情列 -->
  46. <template v-slot:requirementName="{ row }">
  47. <el-link
  48. type="primary"
  49. :underline="false"
  50. @click="openNeedDetail(row)"
  51. >
  52. {{ row.requirementName }}</el-link
  53. >
  54. </template>
  55. <!-- 状态 -->
  56. <template v-slot:status="{ row }">
  57. {{ getStatus(row.status) }}
  58. </template>
  59. <!-- 操作列 -->
  60. <template v-slot:action="{ row }">
  61. <el-link
  62. type="primary"
  63. :underline="false"
  64. icon="el-icon-edit"
  65. v-if="[0, 3].includes(row.status)"
  66. @click="openEdit('edit', row)"
  67. >
  68. 修改
  69. </el-link>
  70. <el-link
  71. type="primary"
  72. :underline="false"
  73. v-if="[2].includes(row.status)"
  74. icon="el-icon-plus"
  75. @click="addInquiry('add', row)"
  76. >
  77. 生成核价单
  78. </el-link>
  79. <el-popconfirm
  80. class="ele-action"
  81. title="确定要删除此信息吗?"
  82. v-if="[0, 3].includes(row.status)"
  83. @confirm="remove([row.id])"
  84. >
  85. <template v-slot:reference>
  86. <el-link type="danger" :underline="false" icon="el-icon-delete">
  87. 删除
  88. </el-link>
  89. </template>
  90. </el-popconfirm>
  91. </template>
  92. </ele-pro-table>
  93. </div>
  94. </el-card>
  95. <add-dialog ref="addDialogRef" @done="reload"></add-dialog>
  96. <detail-dialog ref="contactDetailDialogRef"></detail-dialog>
  97. <!-- 多选删除弹窗 -->
  98. <pop-modal
  99. :visible.sync="delVisible"
  100. content="是否确定删除?"
  101. @done="commitBtn"
  102. />
  103. <detailNeedDialog ref="DetailNeedDialogRef"></detailNeedDialog>
  104. <addInquiryDialog ref="addInquiryDialogRef"></addInquiryDialog>
  105. </div>
  106. </template>
  107. <script>
  108. import searchQuotation from './components/searchQuotation.vue';
  109. import addDialog from './components/addDialog.vue';
  110. import addInquiryDialog from '../../purchasingManage/inquiryManage/components/addDialog.vue';
  111. import detailNeedDialog from '../../purchasingManage/purchaseNeedManage/components/detailDialog.vue';
  112. import detailDialog from './components/detailDialog.vue';
  113. import popModal from '@/components/pop-modal';
  114. import dictMixins from '@/mixins/dictMixins';
  115. import {
  116. getTableList,
  117. deleteInformation, isHasGeneratedInquiryAPI
  118. } from '@/api/purchasingManage/purchasePlanManage';
  119. import {isHasGeneratedQuoteAPI} from "@/api/saleManage/businessOpportunity";
  120. export default {
  121. mixins: [dictMixins],
  122. components: {
  123. searchQuotation,
  124. popModal,
  125. addDialog,
  126. detailDialog,
  127. detailNeedDialog,
  128. addInquiryDialog
  129. },
  130. data() {
  131. return {
  132. selection: [], //单选中集合
  133. delVisible: false, //批量删除弹框状态
  134. loading: false, // 加载状态
  135. columns: [
  136. {
  137. width: 45,
  138. type: 'selection',
  139. columnKey: 'selection',
  140. align: 'center'
  141. },
  142. {
  143. columnKey: 'index',
  144. label: '序号',
  145. type: 'index',
  146. width: 55,
  147. align: 'center',
  148. showOverflowTooltip: true,
  149. fixed: 'left'
  150. },
  151. {
  152. prop: 'planCode',
  153. slot: 'planCode',
  154. label: '采购计划单编码',
  155. align: 'center',
  156. showOverflowTooltip: true,
  157. minWidth: 200
  158. },
  159. {
  160. prop: 'planName',
  161. label: '采购计划单名称',
  162. align: 'center',
  163. showOverflowTooltip: true,
  164. minWidth: 200
  165. },
  166. {
  167. prop: 'requirementName',
  168. slot: 'requirementName',
  169. label: '采购需求单名称',
  170. align: 'center',
  171. showOverflowTooltip: true,
  172. minWidth: 200
  173. },
  174. {
  175. prop: 'sourceTypeName',
  176. label: '需求类型',
  177. align: 'center',
  178. showOverflowTooltip: true,
  179. minWidth: 140
  180. },
  181. {
  182. prop: 'requireDeptName',
  183. label: '需求部门',
  184. align: 'center',
  185. slot: 'requireDeptName',
  186. showOverflowTooltip: true,
  187. minWidth: 200
  188. },
  189. {
  190. prop: 'requireUserName',
  191. label: '需求人',
  192. align: 'center',
  193. showOverflowTooltip: true,
  194. minWidth: 140
  195. },
  196. {
  197. prop: 'responsibleName',
  198. label: '负责人',
  199. align: 'center',
  200. showOverflowTooltip: true,
  201. minWidth: 120
  202. },
  203. {
  204. prop: 'detailCount',
  205. label: '明细条数',
  206. align: 'center',
  207. showOverflowTooltip: true,
  208. minWidth: 140
  209. },
  210. // {
  211. // prop: 'finishDate',
  212. // label: '完成日期',
  213. // align: 'center',
  214. // showOverflowTooltip: true,
  215. // minWidth: 140
  216. // },
  217. {
  218. prop: 'createTime',
  219. label: '创建时间',
  220. align: 'center',
  221. showOverflowTooltip: true,
  222. minWidth: 180
  223. },
  224. {
  225. prop: 'status',
  226. label: '状态',
  227. align: 'center',
  228. slot: 'status',
  229. showOverflowTooltip: true,
  230. minWidth: 120
  231. },
  232. // {
  233. // prop: 'remark',
  234. // label: '备注',
  235. // align: 'center',
  236. // showOverflowTooltip: true,
  237. // minWidth: 170
  238. // },
  239. {
  240. columnKey: 'action',
  241. label: '操作',
  242. width: 230,
  243. align: 'center',
  244. resizable: false,
  245. slot: 'action',
  246. showOverflowTooltip: true,
  247. fixed: 'right'
  248. }
  249. ]
  250. };
  251. },
  252. computed: {},
  253. created() {
  254. this.requestDict('客户状态');
  255. },
  256. methods: {
  257. /* 表格数据源 */
  258. datasource({ page, limit, where, order }) {
  259. return getTableList({
  260. pageNum: page,
  261. size: limit,
  262. ...where
  263. });
  264. },
  265. /* 刷新表格 */
  266. reload(where) {
  267. this.$refs.table.reload({ page: 1, where });
  268. },
  269. //新增编辑
  270. openEdit(type, row) {
  271. this.$refs.addDialogRef.open(type, row, row.id);
  272. this.$refs.addDialogRef.$refs.form &&
  273. this.$refs.addDialogRef.$refs.form.clearValidate();
  274. },
  275. //新增核价
  276. async addInquiry(type, row) {
  277. this.$refs.addInquiryDialogRef.open(type, row);
  278. this.$refs.addInquiryDialogRef.$refs.form &&
  279. this.$refs.addInquiryDialogRef.$refs.form.clearValidate();
  280. },
  281. //批量删除
  282. allDelBtn() {
  283. if (this.selection.length === 0) return;
  284. let flag = this.selection.some(item=>[1,2].includes(item.status))
  285. if(flag) return this.$message.warning('抱歉已审核、审核中的数据不能删除,请检查')
  286. this.delVisible = true;
  287. },
  288. //删除接口
  289. remove(delData) {
  290. deleteInformation(delData).then((res) => {
  291. this.$message.success('删除成功!');
  292. this.reload();
  293. });
  294. },
  295. //删除弹框确定
  296. commitBtn() {
  297. const dataId = this.selection.map((v) => v.id);
  298. this.remove(dataId);
  299. },
  300. //查看详情
  301. openDetail(row) {
  302. this.$refs.contactDetailDialogRef.open(row);
  303. },
  304. //查看详情
  305. openNeedDetail(row) {
  306. this.$refs.DetailNeedDialogRef.open(row);
  307. },
  308. //获取状态
  309. getStatus(status) {
  310. return status == 0
  311. ? '未提交'
  312. : status == 1
  313. ? '审核中'
  314. : status == 2
  315. ? '审核通过'
  316. : status == 3
  317. ? '审核不通过'
  318. : '';
  319. }
  320. }
  321. };
  322. </script>
  323. <style lang="scss" scoped>
  324. :deep(.el-link--inner) {
  325. margin-left: 0px !important;
  326. }
  327. .sys-organization-list {
  328. height: calc(100vh - 264px);
  329. box-sizing: border-box;
  330. border-width: 1px;
  331. border-style: solid;
  332. overflow: auto;
  333. }
  334. .sys-organization-list :deep(.el-tree-node__content) {
  335. height: 40px;
  336. & > .el-tree-node__expand-icon {
  337. margin-left: 10px;
  338. }
  339. }
  340. </style>