index.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  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 - 350px)"
  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:contactName="{ row }">
  41. <el-link type="primary" :underline="false" @click="openDetail(row)"> {{ row.contactName }}</el-link>
  42. </template>
  43. <!-- 操作列 -->
  44. <template v-slot:action="{ row }">
  45. <el-link
  46. type="primary"
  47. :underline="false"
  48. icon="el-icon-edit"
  49. v-if="[0,3].includes(row.status)"
  50. @click="openEdit('edit',row)"
  51. >
  52. 修改
  53. </el-link>
  54. <el-popconfirm
  55. class="ele-action"
  56. title="确定要删除此信息吗?"
  57. @confirm="remove([row.id])"
  58. >
  59. <template v-slot:reference>
  60. <el-link
  61. type="danger"
  62. :underline="false"
  63. icon="el-icon-delete"
  64. v-if="[0,3].includes(row.status)"
  65. >
  66. 删除
  67. </el-link>
  68. </template>
  69. </el-popconfirm>
  70. </template>
  71. </ele-pro-table>
  72. </div>
  73. </el-card>
  74. <add-dialog ref="addDialogRef" @done="reload"></add-dialog>
  75. <detail-dialog ref="contactDetailDialogRef"></detail-dialog>
  76. <!-- 多选删除弹窗 -->
  77. <pop-modal :visible.sync="delVisible" content="是否确定删除?" @done="commitBtn"/>
  78. </div>
  79. </template>
  80. <script>
  81. import searchQuotation from './components/searchQuotation.vue';
  82. import addDialog from './components/addDialog.vue';
  83. import detailDialog from './components/detailDialog.vue';
  84. import popModal from '@/components/pop-modal';
  85. import {reviewStatus} from '@/enum/dict';
  86. import {getTableList, getDetail, UpdateInformation, addInformation,deleteInformation,updateStatus} from '@/api/saleManage/quotation';
  87. import dictMixins from '@/mixins/dictMixins';
  88. export default {
  89. mixins: [dictMixins],
  90. components: {
  91. searchQuotation,
  92. popModal,
  93. addDialog,
  94. detailDialog,
  95. },
  96. data() {
  97. return {
  98. selection:[], //单选中集合
  99. delVisible:false, //批量删除弹框状态
  100. loading: false, // 加载状态
  101. columns: [
  102. {
  103. width: 45,
  104. type: 'selection',
  105. columnKey: 'selection',
  106. align: 'center'
  107. },
  108. {
  109. columnKey: 'index',
  110. label: '序号',
  111. type: 'index',
  112. width: 55,
  113. align: 'center',
  114. showOverflowTooltip: true,
  115. fixed: 'left'
  116. },
  117. {
  118. prop: 'contactName',
  119. label: '询价方名称',
  120. align: 'center',
  121. slot: 'contactName',
  122. showOverflowTooltip: true,
  123. minWidth: 200
  124. },
  125. {
  126. prop: 'contactLinkName',
  127. label: '询价方联系人',
  128. align: 'center',
  129. showOverflowTooltip: true,
  130. minWidth: 140
  131. },
  132. {
  133. prop: 'contactTel',
  134. label: '询价方联系电话',
  135. align: 'center',
  136. showOverflowTooltip: true,
  137. minWidth: 140
  138. },
  139. {
  140. prop: 'quoteName',
  141. label: '报价方名称',
  142. align: 'center',
  143. showOverflowTooltip: true,
  144. minWidth: 200
  145. },
  146. {
  147. prop: 'quoteLinkName',
  148. label: '报价方联系人',
  149. align: 'center',
  150. showOverflowTooltip: true,
  151. minWidth: 140
  152. },
  153. {
  154. prop: 'quoteTel',
  155. label: '报价方联系电话',
  156. align: 'center',
  157. showOverflowTooltip: true,
  158. minWidth: 140
  159. },
  160. {
  161. prop: 'deliveryDate',
  162. label: '交货日期',
  163. align: 'center',
  164. showOverflowTooltip: true,
  165. minWidth: 100
  166. },
  167. {
  168. prop: 'settlementModeName',
  169. label: '付款方式',
  170. align: 'center',
  171. showOverflowTooltip: true,
  172. minWidth: 100
  173. },
  174. {
  175. prop: 'taxRate',
  176. label: '税率',
  177. align: 'center',
  178. showOverflowTooltip: true,
  179. minWidth: 140,
  180. formatter: (_row, _column, cellValue) => {
  181. return _row.taxRate+'%'
  182. }
  183. },
  184. {
  185. prop: 'totalPrice',
  186. label: '总金额',
  187. align: 'center',
  188. showOverflowTooltip: true,
  189. minWidth: 100
  190. },
  191. {
  192. prop: 'status',
  193. label: '审核状态',
  194. align: 'center',
  195. showOverflowTooltip: true,
  196. minWidth: 100,
  197. formatter: (_row, _column, cellValue) => {
  198. return reviewStatus[_row.status];
  199. }
  200. },
  201. {
  202. prop: 'createTime',
  203. label: '创建时间',
  204. align: 'center',
  205. showOverflowTooltip: true,
  206. minWidth: 170,
  207. formatter: (_row, _column, cellValue) => {
  208. return this.$util.toDateString(cellValue);
  209. }
  210. },
  211. {
  212. columnKey: 'action',
  213. label: '操作',
  214. width: 230,
  215. align: 'center',
  216. resizable: false,
  217. slot: 'action',
  218. showOverflowTooltip: true,
  219. fixed: 'right',
  220. }
  221. ]
  222. };
  223. },
  224. computed: {},
  225. created() {
  226. this.requestDict('客户状态');
  227. },
  228. methods: {
  229. /* 表格数据源 */
  230. datasource({ page, limit, where, order }) {
  231. return getTableList({
  232. pageNum: page,
  233. size: limit,
  234. ...where
  235. });
  236. },
  237. /* 刷新表格 */
  238. reload(where) {
  239. this.$refs.table.reload({ page: 1, where });
  240. },
  241. //新增编辑
  242. openEdit(type,row) {
  243. this.$refs.addDialogRef.open( type,row, row.id);
  244. this.$refs.addDialogRef.$refs.form &&
  245. this.$refs.addDialogRef.$refs.form.clearValidate();
  246. },
  247. //批量删除
  248. allDelBtn(){
  249. if(this.selection.length===0) return
  250. this.delVisible=true
  251. },
  252. //删除接口
  253. remove(delData) {
  254. deleteInformation(delData).then((res) => {
  255. this.$message.success('删除成功!');
  256. this.reload();
  257. });
  258. },
  259. //删除弹框确定
  260. commitBtn(){
  261. const dataId=this.selection.map(v=>v.id)
  262. this.remove(dataId)
  263. },
  264. //查看详情
  265. openDetail(row){
  266. this.$refs.contactDetailDialogRef.open(row);
  267. },
  268. }
  269. };
  270. </script>
  271. <style lang="scss" scoped>
  272. :deep(.el-link--inner){
  273. margin-left: 0px !important;
  274. }
  275. .sys-organization-list {
  276. height: calc(100vh - 264px);
  277. box-sizing: border-box;
  278. border-width: 1px;
  279. border-style: solid;
  280. overflow: auto;
  281. }
  282. .sys-organization-list :deep(.el-tree-node__content) {
  283. height: 40px;
  284. & > .el-tree-node__expand-icon {
  285. margin-left: 10px;
  286. }
  287. }
  288. </style>