index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <div class="switch">
  5. <div class="switch_left">
  6. <ul>
  7. <li
  8. v-for="item in tabOptions"
  9. :key="item.key"
  10. :class="{ active: activeComp == item.key }"
  11. @click="activeComp = item.key"
  12. >
  13. {{ item.name }}
  14. </li>
  15. </ul>
  16. </div>
  17. </div>
  18. <div class="main" style="padding: 0 10px">
  19. <div v-if="activeComp == 'saleorder'">
  20. <div class="ele-border-lighter form-content" v-loading="loading">
  21. <search-table @search="reload"></search-table>
  22. <!-- 数据表格 -->
  23. <ele-pro-table
  24. ref="table"
  25. :columns="columns"
  26. :datasource="datasource"
  27. height="calc(100vh - 410px)"
  28. style="margin-bottom: 10px"
  29. full-height="calc(100vh - 116px)"
  30. tool-class="ele-toolbar-form"
  31. :selection.sync="selection"
  32. cache-key="eomContactPageTable"
  33. >
  34. <!-- 表头工具栏 -->
  35. <template v-slot:toolbar>
  36. <el-button
  37. size="small"
  38. type="primary"
  39. icon="el-icon-plus"
  40. class="ele-btn-icon"
  41. @click="openEdit('add', {})"
  42. >
  43. 新建
  44. </el-button>
  45. <el-button
  46. size="small"
  47. type="danger"
  48. el-icon-delete
  49. class="ele-btn-icon"
  50. @click="allDelBtn"
  51. :disabled="selection?.length === 0"
  52. >
  53. 批量删除
  54. </el-button>
  55. </template>
  56. <!-- 查看详情列 -->
  57. <template v-slot:contractNo="{ row }">
  58. <el-link
  59. type="primary"
  60. :underline="false"
  61. @click="opencontractDetail(row)"
  62. >
  63. {{ row.contractNo }}
  64. </el-link
  65. >
  66. </template>
  67. <template v-slot:orderNo="{ row }">
  68. <el-link
  69. type="primary"
  70. :underline="false"
  71. @click="openorderDetail(row)"
  72. >
  73. {{ row.orderNo }}
  74. </el-link
  75. >
  76. </template>
  77. <!-- 操作列 -->
  78. <template v-slot:action="{ row }">
  79. <el-link
  80. type="primary"
  81. :underline="false"
  82. icon="el-icon-edit"
  83. @click="openEdit('edit', row)"
  84. v-if="[0, 3].includes(row.orderStatus)"
  85. >
  86. 修改
  87. </el-link>
  88. <el-link
  89. type="primary"
  90. :underline="false"
  91. icon="el-icon-plus"
  92. @click="saleOrderSubmit(row)"
  93. v-if="[0, 3].includes(row.orderStatus)"
  94. >
  95. 提交
  96. </el-link>
  97. <el-popconfirm
  98. class="ele-action"
  99. title="确定要删除此信息吗?"
  100. @confirm="remove([row.id])"
  101. v-if="[0, 3].includes(row.orderStatus)"
  102. >
  103. <template v-slot:reference>
  104. <el-link
  105. type="danger"
  106. :underline="false"
  107. icon="el-icon-delete"
  108. >
  109. 删除
  110. </el-link>
  111. </template>
  112. </el-popconfirm>
  113. <el-dropdown
  114. @command="(command) => handleCommand(command, row)"
  115. v-if="[2].includes(row.orderStatus)"
  116. >
  117. <span class="el-dropdown-link">
  118. 操作菜单<i class="el-icon-arrow-down el-icon--right"></i>
  119. </span>
  120. <el-dropdown-menu slot="dropdown">
  121. <el-dropdown-item command="invoice"
  122. >创建发货单
  123. </el-dropdown-item
  124. >
  125. <el-dropdown-item command="returnOrder"
  126. >创建退货单
  127. </el-dropdown-item
  128. >
  129. </el-dropdown-menu>
  130. </el-dropdown>
  131. </template>
  132. </ele-pro-table>
  133. </div>
  134. </div>
  135. <div v-if="activeComp == 'invoice'">
  136. <invoice></invoice>
  137. </div>
  138. <div v-if="activeComp == 'entrustedReceive'">
  139. <entrustedReceive></entrustedReceive>
  140. </div>
  141. <div v-if="activeComp == 'returnorder'" class="returnorder">
  142. <return-goods></return-goods>
  143. </div>
  144. <div v-if="activeComp == 'accountstatement'">
  145. <accountstatement></accountstatement>
  146. </div>
  147. <div v-if="activeComp == 'customerReturnOrder'">
  148. <customerReturnOrder></customerReturnOrder>
  149. </div>
  150. </div>
  151. </el-card>
  152. <add-dialog ref="addDialogRef" @done="reload"></add-dialog>
  153. <add-invoice-dialog
  154. ref="invoiceDialogRef"
  155. @done="reload"
  156. ></add-invoice-dialog>
  157. <add-return-goods-dialog
  158. ref="addReturnGoodsRef"
  159. @done="reload"
  160. ></add-return-goods-dialog>
  161. <contractr-detail ref="contractDetailRef"></contractr-detail>
  162. <detail-dialog ref="contactDetailDialogRef"></detail-dialog>
  163. <!-- 多选删除弹窗 -->
  164. <pop-modal
  165. :visible.sync="delVisible"
  166. content="是否确定删除?"
  167. @done="commitBtn"
  168. />
  169. </div>
  170. </template>
  171. <script>
  172. import searchTable from './components/searchTable.vue';
  173. import addDialog from './components/addDialog.vue';
  174. import invoice from './invoice/index.vue';
  175. import detailDialog from './components/detailDialog.vue';
  176. import contractrDetail from '@/views/contractManage/contractBook/components/detailDialog.vue';
  177. import addInvoiceDialog from '@/views/saleManage/saleOrder/invoice/components/addInvoiceDialog';
  178. import addReturnGoodsDialog from '@/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog';
  179. import popModal from '@/components/pop-modal';
  180. import accountstatement from './accountstatement/index.vue';
  181. import customerReturnOrder from './customerReturnOrder/index.vue';
  182. import returnGoods from './returnGoods/index.vue';
  183. import {getTableList, deleteInformation, submit} from '@/api/saleManage/saleorder';
  184. import dictMixins from '@/mixins/dictMixins';
  185. import {reviewStatus} from '@/enum/dict';
  186. import entrustedReceive from "@/views/saleManage/saleOrder/entrustedReceive/index.vue";
  187. export default {
  188. mixins: [dictMixins],
  189. components: {
  190. searchTable,
  191. returnGoods,
  192. accountstatement,
  193. popModal,
  194. contractrDetail,
  195. addReturnGoodsDialog,
  196. addInvoiceDialog,
  197. invoice,
  198. addDialog,
  199. detailDialog,
  200. customerReturnOrder,
  201. entrustedReceive
  202. },
  203. data() {
  204. return {
  205. activeComp: 'saleorder',
  206. tabOptions: [
  207. {key: 'saleorder', name: '销售订单'},
  208. {key: 'entrustedReceive', name: '受托收货单'},
  209. {key: 'invoice', name: '发货单'},
  210. {key: 'returnorder', name: '退货单'},
  211. {key: 'customerReturnOrder', name: '退货处理单'},
  212. {key: 'accountstatement', name: '对账单'}
  213. ],
  214. selection: [], //单选中集合
  215. delVisible: false, //批量删除弹框状态
  216. loading: false, // 加载状态
  217. columns: [
  218. {
  219. width: 45,
  220. type: 'selection',
  221. columnKey: 'selection',
  222. align: 'center'
  223. },
  224. {
  225. columnKey: 'index',
  226. label: '序号',
  227. type: 'index',
  228. width: 55,
  229. align: 'center',
  230. showOverflowTooltip: true,
  231. fixed: 'left'
  232. },
  233. {
  234. prop: 'orderNo',
  235. label: '订单编码',
  236. align: 'center',
  237. slot: 'orderNo',
  238. showOverflowTooltip: true,
  239. minWidth: 200
  240. },
  241. {
  242. prop: 'contractNo',
  243. label: '合同编码',
  244. align: 'center',
  245. slot: 'contractNo',
  246. showOverflowTooltip: true,
  247. minWidth: 200
  248. },
  249. {
  250. prop: 'contractNumber',
  251. label: '合同编号',
  252. align: 'center',
  253. showOverflowTooltip: true,
  254. minWidth: 200
  255. },
  256. // {
  257. // prop: 'deliveryDate',
  258. // label: '交货日期',
  259. // align: 'center',
  260. // showOverflowTooltip: true,
  261. // minWidth: 200
  262. // },
  263. {
  264. prop: 'saleTypeName',
  265. label: '销售类型',
  266. align: 'center',
  267. showOverflowTooltip: true,
  268. minWidth: 140
  269. },
  270. {
  271. prop: 'partaName',
  272. label: '客户名称',
  273. align: 'center',
  274. showOverflowTooltip: true,
  275. minWidth: 180
  276. },
  277. {
  278. prop: 'partaLinkName',
  279. label: '客户联系人',
  280. align: 'center',
  281. showOverflowTooltip: true,
  282. minWidth: 130
  283. },
  284. {
  285. prop: 'partaTel',
  286. label: '客户联系电话',
  287. align: 'center',
  288. showOverflowTooltip: true,
  289. minWidth: 130
  290. },
  291. {
  292. prop: 'partbName',
  293. label: '售出方名称',
  294. align: 'center',
  295. showOverflowTooltip: true,
  296. minWidth: 130
  297. },
  298. {
  299. prop: 'partbLinkName',
  300. label: '售出方联系人',
  301. align: 'center',
  302. showOverflowTooltip: true,
  303. minWidth: 130
  304. },
  305. {
  306. prop: 'partbTel',
  307. label: '售出方联系电话',
  308. align: 'center',
  309. showOverflowTooltip: true,
  310. minWidth: 130
  311. },
  312. {
  313. prop: 'payAmount',
  314. label: '金额(元)',
  315. align: 'center',
  316. showOverflowTooltip: true,
  317. minWidth: 170
  318. },
  319. {
  320. prop: 'orderStatus',
  321. label: '审核状态',
  322. align: 'center',
  323. showOverflowTooltip: true,
  324. minWidth: 100,
  325. formatter: (_row, _column, cellValue) => {
  326. return reviewStatus[_row.orderStatus];
  327. }
  328. },
  329. {
  330. prop: 'createTime',
  331. label: '创建时间',
  332. align: 'center',
  333. showOverflowTooltip: true,
  334. minWidth: 170
  335. },
  336. {
  337. columnKey: 'action',
  338. label: '操作',
  339. width: 230,
  340. align: 'center',
  341. resizable: false,
  342. slot: 'action',
  343. showOverflowTooltip: true,
  344. fixed: 'right'
  345. }
  346. ]
  347. };
  348. },
  349. computed: {},
  350. created() {
  351. this.requestDict('客户状态');
  352. },
  353. methods: {
  354. //更多菜单
  355. handleCommand(command, row) {
  356. if (command === 'invoice') {
  357. this.$refs.invoiceDialogRef.open('add', {}, row.id);
  358. }
  359. if (command === 'returnOrder') {
  360. this.$refs.addReturnGoodsRef.open('add', {});
  361. }
  362. },
  363. //点击左边分类
  364. handleNodeClick(data, node) {
  365. // this.curNodeData = data;
  366. this.reload({categoryId: data.id});
  367. },
  368. /* 表格数据源 */
  369. datasource({page, limit, where, order}) {
  370. return getTableList({
  371. pageNum: page,
  372. size: limit,
  373. ...where
  374. });
  375. },
  376. /* 刷新表格 */
  377. reload(where) {
  378. this.$refs.table.reload({page: 1, where});
  379. },
  380. //新增编辑
  381. openEdit(type, row) {
  382. this.$refs.addDialogRef.open(type, row, row.id);
  383. this.$refs.addDialogRef.$refs.form &&
  384. this.$refs.addDialogRef.$refs.form.clearValidate();
  385. },
  386. //批量删除
  387. allDelBtn() {
  388. if (this.selection.length === 0) return;
  389. let flag = this.selection.some(item => [1, 2].includes(item.orderStatus))
  390. if (flag) return this.$message.warning('抱歉已审核、审核中的数据不能删除,请检查')
  391. this.delVisible = true;
  392. },
  393. //删除接口
  394. remove(delData) {
  395. deleteInformation(delData).then((res) => {
  396. this.$message.success('删除成功!');
  397. this.reload();
  398. });
  399. },
  400. //删除弹框确定
  401. commitBtn() {
  402. const dataId = this.selection.map((v) => v.id);
  403. this.remove(dataId);
  404. },
  405. //查看详情
  406. openorderDetail(row) {
  407. this.$refs.contactDetailDialogRef.open(row);
  408. },
  409. saleOrderSubmit(res) {
  410. submit({
  411. businessId: res.id
  412. }).then((res) => {
  413. this.$message.success('提交成功');
  414. this.reload();
  415. });
  416. },
  417. //查看合同详情
  418. opencontractDetail(row) {
  419. let data = {
  420. id: row.contractId
  421. };
  422. this.$refs.contractDetailRef.open(data);
  423. }
  424. }
  425. };
  426. </script>
  427. <style lang="scss" scoped>
  428. :deep .el-card__body {
  429. padding: 0;
  430. }
  431. :deep(.el-link--inner) {
  432. margin-left: 0px !important;
  433. }
  434. .sys-organization-list {
  435. height: calc(100vh - 264px);
  436. box-sizing: border-box;
  437. border-width: 1px;
  438. border-style: solid;
  439. overflow: auto;
  440. }
  441. .sys-organization-list :deep(.el-tree-node__content) {
  442. height: 40px;
  443. & > .el-tree-node__expand-icon {
  444. margin-left: 10px;
  445. }
  446. }
  447. .el-dropdown-link {
  448. cursor: pointer;
  449. color: var(--color-primary-5);
  450. }
  451. .el-icon-arrow-down {
  452. font-size: 12px;
  453. }
  454. </style>