feeRelatedInfoTable.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815
  1. <template>
  2. <div>
  3. <el-form ref="form" :model="form">
  4. <!-- 数据表格 -->
  5. <ele-pro-table
  6. ref="table"
  7. :columns="columns"
  8. :datasource="form.datasource"
  9. :needPage="false"
  10. :minHeight="100"
  11. tool-class="ele-toolbar-form"
  12. cache-key="eomContactPageTable"
  13. >
  14. <!-- 表头工具栏 -->
  15. <template v-slot:toolbar>
  16. <el-button
  17. v-if="dialogType !== 'view'"
  18. size="small"
  19. type="primary"
  20. icon="el-icon-plus"
  21. class="ele-btn-icon"
  22. @click="handleAddInfo"
  23. >
  24. 新增关联信息
  25. </el-button>
  26. </template>
  27. <template v-slot:action="{ row, $index }">
  28. <el-popconfirm
  29. class="ele-action"
  30. title="确定要删除此信息吗?"
  31. :disabled="form.datasource.length == 1"
  32. @confirm="handleDelInfo($index)"
  33. >
  34. <template v-slot:reference>
  35. <el-link
  36. :disabled="form.datasource.length == 1"
  37. type="danger"
  38. :underline="false"
  39. icon="el-icon-delete"
  40. >
  41. 删除
  42. </el-link>
  43. </template>
  44. </el-popconfirm>
  45. </template>
  46. <template
  47. v-slot:financeCostType="{ row, $index }"
  48. v-if="dialogType !== 'view'"
  49. >
  50. <el-form-item
  51. :prop="'datasource.' + $index + '.financeCostType'"
  52. :rules="{
  53. required: true,
  54. message: '请选择',
  55. trigger: ['blur', 'change']
  56. }"
  57. >
  58. <ele-tree-select
  59. clearable
  60. filterable
  61. :ref="'feeTypeTree' + $index"
  62. :data="feeTypeList"
  63. v-model="row.financeCostTypeName"
  64. valueKey="id"
  65. labelKey="name"
  66. placeholder="请选择"
  67. @change="(val) => changeFeeTypeInfo(val, row, $index)"
  68. default-expand-all
  69. />
  70. </el-form-item>
  71. </template>
  72. <template
  73. v-slot:linkType="{ row, $index }"
  74. v-if="dialogType !== 'view'"
  75. >
  76. <el-form-item :prop="'datasource.' + $index + '.linkType'">
  77. <el-select
  78. v-model="row.linkType"
  79. @change="(val) => handleChangeFinLink(val, row, $index)"
  80. clearable
  81. >
  82. <el-option
  83. v-for="item in getLinkTypeList"
  84. :key="item.value"
  85. :label="item.label"
  86. :value="item.value"
  87. ></el-option>
  88. </el-select>
  89. </el-form-item>
  90. </template>
  91. <template
  92. v-slot:linkName="{ row, $index }"
  93. >
  94. <el-form-item v-if="dialogType !== 'view'" :prop="'datasource.' + $index + '.linkName'">
  95. <div
  96. style="display: flex; align-items: center; gap: 8px; width: 100%"
  97. >
  98. <el-input
  99. v-model="row.linkName"
  100. @click.native="(val) => handleSelectData(val, row, $index)"
  101. clearable
  102. style="flex: 1"
  103. ></el-input>
  104. <el-button
  105. v-if="row.linkId"
  106. size="mini"
  107. type="text"
  108. icon="el-icon-view"
  109. @click="handleViewDetail(row)"
  110. style="padding: 0"
  111. >
  112. 详情
  113. </el-button>
  114. </div>
  115. </el-form-item>
  116. <div
  117. v-else
  118. style="display: flex; align-items: center; gap: 8px; width: 100%"
  119. >
  120. <div style="flex: 1">{{ row.linkName }}</div>
  121. <el-button
  122. v-if="row.linkId"
  123. size="mini"
  124. type="text"
  125. icon="el-icon-view"
  126. @click="handleViewDetail(row)"
  127. style="padding: 0"
  128. >
  129. 详情
  130. </el-button>
  131. </div>
  132. </template>
  133. <template v-slot:amount="{ row, $index }" v-if="dialogType !== 'view'">
  134. <el-form-item
  135. :prop="'datasource.' + $index + '.amount'"
  136. :rules="{
  137. required: true,
  138. message: '请选择',
  139. trigger: ['blur', 'change']
  140. }"
  141. >
  142. <el-input-number
  143. style="width: 100%"
  144. :controls="false"
  145. :min="0"
  146. v-model="row.amount"
  147. @change="handleChangeAmount"
  148. clearable
  149. ></el-input-number>
  150. </el-form-item>
  151. </template>
  152. <template v-slot:files="{ row, $index }">
  153. <el-form-item :prop="'datasource.' + $index + '.files'">
  154. <fileMain v-model="row.files" :type="dialogType"></fileMain>
  155. </el-form-item>
  156. </template>
  157. <template v-slot:remark="{ row, $index }" v-if="dialogType !== 'view'">
  158. <el-form-item>
  159. <el-input type="textarea" v-model="row.remark" clearable></el-input>
  160. </el-form-item>
  161. </template>
  162. <template v-slot:headerGLLXMC="{ column }">
  163. <span class="is-required">{{ column.label }}</span>
  164. </template>
  165. </ele-pro-table>
  166. </el-form>
  167. <!--选择客户/供应商-->
  168. <customer-list-dialog
  169. v-if="customerListDialogFlag"
  170. :customerListDialogFlag.sync="customerListDialogFlag"
  171. ref="customerListDialogRef"
  172. @changeParent="getCustomerData"
  173. ></customer-list-dialog>
  174. <!--选择合同-->
  175. <contract-list-dialog
  176. v-if="contractListDialogFlag"
  177. :contractListDialogFlag.sync="contractListDialogFlag"
  178. ref="contractListDialogRef"
  179. @changeParent="getContractData"
  180. :type="contractType"
  181. ></contract-list-dialog>
  182. <!--选择销售订单-->
  183. <sale-order-list-dialog
  184. ref="saleOrderListDialogRef"
  185. @changeParent="getOrderData"
  186. ></sale-order-list-dialog>
  187. <!--选择采购订单-->
  188. <purchase-order-list-dialog
  189. ref="purchaseOrderListDialogRef"
  190. @changeParent="getOrderData"
  191. ></purchase-order-list-dialog>
  192. <!-- 选择售后工单 -->
  193. <SHGDListDialog
  194. ref="SHGDListDialogRef"
  195. @changeParent="getSHGDData"
  196. ></SHGDListDialog>
  197. <!-- 选择运输工单 -->
  198. <YSGDListDialog
  199. ref="YSGDListDialogRef"
  200. @changeParent="getYSGDData"
  201. ></YSGDListDialog>
  202. <!--商机-->
  203. <opportunity-dialog
  204. ref="opportunityDialogRef"
  205. v-if="opportunityDialogFlag"
  206. :opportunityDialogFlag.sync="opportunityDialogFlag"
  207. @changeParent="getOpportunityData"
  208. >
  209. </opportunity-dialog>
  210. <!--对账单-->
  211. <account-statement-dialog
  212. ref="accountStatementDialogRef"
  213. v-if="accountStatementDialogFlag"
  214. :accountType="accountType"
  215. :accountstatement-dialog-flag.sync="accountStatementDialogFlag"
  216. @changeParent="getAccountData"
  217. >
  218. </account-statement-dialog>
  219. <!--采购计划 -->
  220. <plan-dialog
  221. v-if="planDialogFlag"
  222. :plan-dialog-flag.sync="planDialogFlag"
  223. ref="planDialogRef"
  224. @changeParent="getPlanData"
  225. :collectionId="collectionId"
  226. >
  227. </plan-dialog>
  228. <detail-dialog ref="contactDetailDialogRef"></detail-dialog>
  229. <SJdrawer ref="SJdrawerRef"></SJdrawer>
  230. <XSdrawer ref="XSdrawerRef"></XSdrawer>
  231. <XSDZDdetailDialog
  232. ref="XSDZDdetailDialogRef"
  233. :detailDialogFlag.sync="xsdDialogFlag"
  234. ></XSDZDdetailDialog>
  235. <ContactDetailDialog ref="GYScontactDetailDialogRef"></ContactDetailDialog>
  236. <CGJHdetailDialog ref="CGJHdetailDialogRef"></CGJHdetailDialog>
  237. <CGDDdetailDialog ref="CGDDdetailDialogRef"></CGDDdetailDialog>
  238. <declarationDialog ref="declarationDialogRef"></declarationDialog>
  239. <KHdrawer ref="KHdrawerRef"></KHdrawer>
  240. <feeInfoDialog
  241. ref="feeInfoDialogRef"
  242. v-if="feeInfoDialogFlag"
  243. :fee-info-dialog-flag.sync="feeInfoDialogFlag"
  244. ></feeInfoDialog>
  245. </div>
  246. </template>
  247. <script>
  248. import contractListDialog from '@/views/financialManage/components/contractListDialog.vue';
  249. import customerListDialog from '@/views/financialManage/components/customerListDialog.vue';
  250. import saleOrderListDialog from '@/views/saleManage/saleOrder/invoice/components/orderListDialog.vue';
  251. import purchaseOrderListDialog from '@/views/purchasingManage/purchaseOrder/invoice/components/orderListDialog.vue';
  252. import SHGDListDialog from '@/views/salesServiceManagement/workOrder/components/drawer.vue';
  253. import YSGDListDialog from '@/views/transportManager/shipManage/taskWorkManage/components/drawer.vue';
  254. import opportunityDialog from '@/views/financialManage/components/opportunityDialog.vue';
  255. import accountStatementDialog from '@/views/financialManage/components/accountstatementDialog.vue';
  256. import planDialog from '@/views/financialManage/components/planDialog.vue';
  257. import { getTreeByPid } from '@/api/classifyManage';
  258. import { mapGetters } from 'vuex';
  259. import { getByCode } from '@/api/system/dictionary-data';
  260. import fileUpload from '@/components/upload/fileUpload.vue';
  261. import { getFile } from '@/api/system/file';
  262. import detailDialog from '@/views/contractManage/contractBook/components/detailDialog';
  263. import SJdrawer from '@/views/saleManage/businessOpportunity/components/drawer.vue';
  264. import XSdrawer from '@/views/saleManage/saleOrder/components/drawer.vue';
  265. import KHdrawer from '@/views/saleManage/contact/components/drawer.vue';
  266. import XSDZDdetailDialog from '@/views/saleManage/saleOrder/accountstatement/components/detailDialog.vue';
  267. import ContactDetailDialog from '@/views/purchasingManage/producerManage/components/contactDetailDialog.vue';
  268. import CGJHdetailDialog from '@/views/purchasingManage/purchasePlanManage/components/detailDialog.vue';
  269. import CGDDdetailDialog from '@/views/purchasingManage/purchaseOrder/components/detailDialog.vue';
  270. import declarationDialog from '@/views/salesServiceManagement/workOrder/components/declarationDialog.vue';
  271. import feeInfoDialog from '@/views/transportManager/shipManage/taskWorkManage/components/feeInfoDialog.vue';
  272. // import fileMain from '@/components/addDoc/index.vue';
  273. export default {
  274. name: 'relatedInfoTable',
  275. components: {
  276. // fileMain,
  277. fileUpload,
  278. purchaseOrderListDialog,
  279. SHGDListDialog,
  280. YSGDListDialog,
  281. saleOrderListDialog,
  282. customerListDialog,
  283. contractListDialog,
  284. opportunityDialog,
  285. accountStatementDialog,
  286. planDialog,
  287. detailDialog,
  288. SJdrawer,
  289. XSdrawer,
  290. XSDZDdetailDialog,
  291. ContactDetailDialog,
  292. CGJHdetailDialog,
  293. CGDDdetailDialog,
  294. declarationDialog,
  295. KHdrawer,
  296. feeInfoDialog
  297. },
  298. props: {
  299. link: {
  300. type: Array,
  301. default: () => []
  302. },
  303. documentType: {
  304. type: [String, Number],
  305. default: ''
  306. },
  307. dialogType: {
  308. type: String,
  309. default: ''
  310. },
  311. collectionId: {
  312. type: String,
  313. default: ''
  314. }
  315. },
  316. data() {
  317. return {
  318. editIndex: undefined, //当前修改数据的下标
  319. contractType: undefined, //选择关联类型为合同时区分销售合同和采购合同
  320. contractListDialogFlag: false,
  321. customerListDialogFlag: false,
  322. opportunityDialogFlag: false,
  323. accountStatementDialogFlag: false,
  324. planDialogFlag: false,
  325. accountType: 1,
  326. feeTypeList: [],
  327. fin_link_type: [],
  328. CBToDT: {
  329. 1: [900, 120, 100, 1000],
  330. 2: [900, 120, 100, 230, 250, 260, 290],
  331. 3: [230, 250, 260, 290],
  332. 4: []
  333. },
  334. form: {
  335. datasource: []
  336. },
  337. rowList: [],
  338. xsdDialogFlag: false,
  339. feeInfoDialogFlag: false
  340. };
  341. },
  342. computed: {
  343. columns() {
  344. let list = [
  345. {
  346. columnKey: 'index',
  347. label: '序号',
  348. type: 'index',
  349. width: 55,
  350. align: 'center',
  351. showOverflowTooltip: true,
  352. fixed: 'left'
  353. },
  354. {
  355. prop: 'financeCostTypeName',
  356. label: '财务费用类型',
  357. align: 'center',
  358. showOverflowTooltip: true,
  359. minWidth: 180,
  360. slot: 'financeCostType',
  361. headerSlot: 'headerGLLXMC'
  362. },
  363. {
  364. prop: 'linkTypeName',
  365. label: '关联业务类型',
  366. align: 'center',
  367. showOverflowTooltip: true,
  368. minWidth: 120,
  369. slot: 'linkType'
  370. },
  371. {
  372. prop: 'linkName',
  373. label: '单据名称',
  374. align: 'center',
  375. showOverflowTooltip: true,
  376. minWidth: 200,
  377. slot: 'linkName'
  378. },
  379. {
  380. prop: 'amount',
  381. label: '金额',
  382. align: 'center',
  383. showOverflowTooltip: true,
  384. minWidth: 120,
  385. slot: 'amount',
  386. headerSlot: 'headerGLLXMC'
  387. },
  388. {
  389. prop: 'files',
  390. label: '附件凭证',
  391. align: 'center',
  392. showOverflowTooltip: true,
  393. minWidth: 120,
  394. slot: 'files'
  395. },
  396. {
  397. prop: 'remark',
  398. label: '备注',
  399. align: 'center',
  400. showOverflowTooltip: true,
  401. minWidth: 120,
  402. slot: 'remark'
  403. }
  404. ];
  405. let action = [
  406. {
  407. columnKey: 'action',
  408. slot: 'action',
  409. label: '操作',
  410. resizable: false,
  411. width: 80,
  412. align: 'center',
  413. showOverflowTooltip: true,
  414. fixed: 'right'
  415. }
  416. ];
  417. this.dialogType === 'view'
  418. ? (list = [...list])
  419. : (list = [...list, ...action]);
  420. return list;
  421. },
  422. getLinkTypeList() {
  423. if (
  424. this.documentType == 4 ||
  425. !this.documentType ||
  426. !this.CBToDT[this.documentType]
  427. )
  428. return this.fin_link_type;
  429. let data = [];
  430. this.CBToDT[this.documentType].forEach((item) => {
  431. let find = this.fin_link_type.find((i) => i.value == item) || {};
  432. find.value && data.push(find);
  433. });
  434. return data;
  435. }
  436. },
  437. async mounted() {
  438. this.form.datasource = this.link;
  439. await this.getClassifyList(25, 'feeTypeList');
  440. let { data } = await getByCode('fin_link_type');
  441. this.fin_link_type = data.map((item) => {
  442. let values = Object.keys(item);
  443. return {
  444. value: values[0],
  445. label: item[values[0]]
  446. };
  447. });
  448. },
  449. methods: {
  450. //获取分类管理中的数据
  451. async getClassifyList(id, listName) {
  452. let res = await getTreeByPid(id);
  453. this[listName] = res.data;
  454. },
  455. downloadFile(file) {
  456. getFile({ objectName: file.storePath }, file.name);
  457. },
  458. //新增关联信息数据
  459. handleAddInfo() {
  460. this.form.datasource.push({
  461. linkType: '',
  462. linkTypeName: '',
  463. financeCostTypeName: '',
  464. financeCostType: '',
  465. linkId: '',
  466. linkName: '',
  467. linkCode: ''
  468. });
  469. },
  470. //选择单据触发的方法
  471. handleSelectData(val, row, index) {
  472. this.editIndex = index;
  473. this.rowList = val;
  474. if (val.target.nodeName == 'I') {
  475. row.linkId = '';
  476. row.linkName = '';
  477. row.linkCode = '';
  478. return;
  479. }
  480. console.log(row.linkType);
  481. switch (row.linkType) {
  482. case '100': //客户
  483. this.handleSelectContact(row);
  484. break;
  485. case '120': //商机
  486. this.getOpportunityList(row);
  487. break;
  488. case '130': //销售合同
  489. this.contractType = 1;
  490. this.handleSelectContract(row);
  491. break;
  492. case '140': //销售订单
  493. this.handleSelectSaleOrder(row);
  494. break;
  495. case '190': //销售对账单
  496. this.accountType = 1;
  497. this.handleSelectAccount(row);
  498. break;
  499. case '210': //供应商
  500. this.handleSelectContact(row);
  501. break;
  502. case '230': //采购计划
  503. this.handleSelectPlan(row);
  504. break;
  505. case '250': //采购合同
  506. this.contractType = 2;
  507. this.handleSelectContract(row);
  508. break;
  509. case '260': //采购订单
  510. this.handleSelectPurchaseOrder(row);
  511. break;
  512. case '290': //采购对账单
  513. this.accountType = 2;
  514. this.handleSelectAccount(row);
  515. break;
  516. case '1010': //售后工单
  517. this.handleSelectSHGDListDialog(row);
  518. break;
  519. case '1020': //运输工单
  520. this.handleSelectYSGDListDialog(row);
  521. break;
  522. }
  523. },
  524. //获取费用类别选中数据
  525. changeFeeTypeInfo(val, row, index) {
  526. this.editIndex = index;
  527. if (!val) {
  528. this.$set(
  529. this.form.datasource[this.editIndex],
  530. 'financeCostTypeName',
  531. ''
  532. );
  533. this.$set(this.form.datasource[this.editIndex], 'financeCostType', '');
  534. }
  535. this.$nextTick(() => {
  536. let data =
  537. this.$refs['feeTypeTree' + index]?.$refs?.tree?.getCurrentNode() ||
  538. {};
  539. this.$set(
  540. this.form.datasource[this.editIndex],
  541. 'financeCostTypeName',
  542. data.name
  543. );
  544. this.$set(
  545. this.form.datasource[this.editIndex],
  546. 'financeCostType',
  547. data.code
  548. );
  549. });
  550. },
  551. setSelectData(val) {
  552. console.log(val, 'val');
  553. this.$set(this.form.datasource[this.editIndex], 'linkId', val.id);
  554. this.$set(this.form.datasource[this.editIndex], 'linkName', val.name);
  555. this.$set(this.form.datasource[this.editIndex], 'linkCode', val.code);
  556. this.$set(this.form.datasource[this.editIndex], 'amount', val.amount);
  557. this.handleChangeAmount();
  558. },
  559. clearData() {
  560. this.form.datasource = [];
  561. },
  562. handleChangeAmount(val, row) {
  563. let totalPrice = this.form.datasource.reduce((total, item) => {
  564. total += item.amount;
  565. return total;
  566. }, 0);
  567. this.$emit('setTotalPrice', totalPrice);
  568. },
  569. //删除关联信息数据
  570. handleDelInfo(index) {
  571. this.form.datasource.splice(index, 1);
  572. this.handleChangeAmount();
  573. },
  574. //修改关联类型
  575. handleChangeFinLink(val, row, index) {
  576. this.editIndex = index;
  577. this.setSelectData({
  578. id: '',
  579. name: '',
  580. code: '',
  581. amount: ''
  582. });
  583. this.$nextTick(() => {
  584. this.$refs.form.clearValidate('datasource.' + index + '.linkName');
  585. });
  586. if (!val) return (row.linkTypeName = '');
  587. row.linkTypeName = this.fin_link_type.find(
  588. (item) => item.value == val
  589. )?.label;
  590. },
  591. //选择客户或者供应商
  592. handleSelectContact(row) {
  593. this.customerListDialogFlag = true;
  594. let params = {
  595. id: row.contactId,
  596. assetTreeId: row.linkType == 210 ? '19' : '17',
  597. classType: row.linkType == 210 ? 2 : 1,
  598. titleName: row.linkType == 210 ? '选择供应商' : '选择客户'
  599. };
  600. this.$nextTick(() => {
  601. this.$refs.customerListDialogRef.init(params);
  602. });
  603. },
  604. //获取选择 供应商/客户 数据
  605. getCustomerData(params) {
  606. this.setSelectData(params);
  607. },
  608. //获取商机
  609. async getOpportunityList() {
  610. this.opportunityDialogFlag = true;
  611. },
  612. //获取选择的商机数据
  613. getOpportunityData(params) {
  614. console.log(params);
  615. let row = {
  616. id: params.id,
  617. name: params.name,
  618. code: params.code
  619. };
  620. this.setSelectData(row);
  621. },
  622. //对账单
  623. async handleSelectAccount() {
  624. this.accountStatementDialogFlag = true;
  625. },
  626. //获取选择的对账单数据
  627. getAccountData(params) {
  628. let row = {
  629. id: params.id,
  630. name: params.statementNo,
  631. code: params.statementNo
  632. };
  633. this.setSelectData(row);
  634. },
  635. //采购计划
  636. async handleSelectPlan() {
  637. this.planDialogFlag = true;
  638. },
  639. //获取选择的采购计划数据
  640. getPlanData(params) {
  641. let row = {
  642. id: params.id,
  643. name: params.planName,
  644. code: params.planCode
  645. };
  646. this.setSelectData(row);
  647. },
  648. //选择人员数据
  649. changeUserInfo(val, info) {
  650. this.form.applyUserName = info.name;
  651. },
  652. //选择合同
  653. handleSelectContract(val) {
  654. this.contractListDialogFlag = true;
  655. this.$nextTick(() => {
  656. this.$refs.contractListDialogRef.init();
  657. });
  658. },
  659. //获取合同数据
  660. getContractData(params) {
  661. let row = {
  662. id: params.id,
  663. name: params.contractName,
  664. code: params.contractNo,
  665. amount: params.discountTotalPrice
  666. };
  667. this.setSelectData(row);
  668. },
  669. //选择销售订单
  670. handleSelectSaleOrder(val) {
  671. this.$refs.saleOrderListDialogRef.open();
  672. },
  673. //选择采购订单
  674. handleSelectPurchaseOrder(val) {
  675. this.$refs.purchaseOrderListDialogRef.open();
  676. },
  677. //选择售后工单
  678. handleSelectSHGDListDialog(val) {
  679. this.$refs.SHGDListDialogRef.open();
  680. },
  681. //选择运输工单
  682. handleSelectYSGDListDialog(val) {
  683. this.$refs.YSGDListDialogRef.open();
  684. },
  685. //获取采购/销售订单数据
  686. getOrderData(params) {
  687. let row = {
  688. id: params.id,
  689. name: params.orderNo,
  690. code: params.orderNo,
  691. amount: params.payAmount
  692. };
  693. this.setSelectData(row);
  694. },
  695. //获取售后工单数据
  696. getSHGDData(params) {
  697. let row = {
  698. ...params,
  699. id: params.id,
  700. name: params.code,
  701. code: params.code,
  702. amount: params.payAmount
  703. };
  704. this.setSelectData(row);
  705. },
  706. //获取运输工单数据
  707. getYSGDData(params) {
  708. console.log(params);
  709. let row = {
  710. ...params,
  711. id: params.id,
  712. name: params.code,
  713. code: params.code,
  714. amount: params.payAmount
  715. };
  716. this.setSelectData(row);
  717. },
  718. handleViewDetail(row) {
  719. let rowL = {
  720. ...row,
  721. id: row.linkId,
  722. orderNo: row.linkCode
  723. };
  724. console.log('完整行数据参考:', rowL);
  725. console.log(rowL.linkType);
  726. switch (rowL.linkType) {
  727. case '100': //客户
  728. this.$refs.KHdrawerRef.open(rowL, 'myList');
  729. break;
  730. case '120': //商机
  731. this.$refs.SJdrawerRef.open(rowL);
  732. break;
  733. case '130': //销售合同
  734. this.$refs.contactDetailDialogRef.open(rowL);
  735. break;
  736. case '140': //销售订单
  737. this.$refs.XSdrawerRef.open(rowL);
  738. break;
  739. case '190': //销售对账单
  740. this.xsdDialogFlag = true;
  741. this.$refs.XSDZDdetailDialogRef.open('view', rowL, '1');
  742. break;
  743. case '210': //供应商
  744. this.$refs.GYScontactDetailDialogRef.open(rowL);
  745. break;
  746. case '230': //采购计划
  747. this.$refs.CGJHdetailDialogRef.open(rowL);
  748. break;
  749. case '250': //采购合同
  750. this.$refs.contactDetailDialogRef.open(rowL);
  751. break;
  752. case '260': //采购订单
  753. this.$refs.CGDDdetailDialogRef.open(rowL);
  754. break;
  755. case '290': //采购对账单
  756. this.xsdDialogFlag = true;
  757. this.$refs.XSDZDdetailDialogRef.open('view', rowL, '1');
  758. break;
  759. case '1010': //售后工单
  760. this.$refs.declarationDialogRef.open(rowL);
  761. break;
  762. case '1020': //运输工单
  763. this.feeInfoDialogFlag = true;
  764. this.$nextTick(() => {
  765. this.$refs.feeInfoDialogRef.init(rowL, 'view');
  766. });
  767. break;
  768. case '900': //项目
  769. //this.handleSelectPurchaseOrder(row);
  770. break;
  771. }
  772. },
  773. getTableValidate() {
  774. return new Promise((resolve, reject) => {
  775. if (this.form.datasource.length == 0)
  776. return this.$message.warning('请填写关联信息');
  777. this.$refs.form.validate((valid) => {
  778. if (!valid) return this.$message.warning('请填写完整信息');
  779. resolve(this.form.datasource);
  780. });
  781. });
  782. }
  783. }
  784. };
  785. </script>
  786. <style scoped lang="scss">
  787. :deep(.el-form-item) {
  788. margin-bottom: 0;
  789. }
  790. /* 调整详情按钮 hover 样式(可选) */
  791. :deep(.el-button--text.el-button--mini) {
  792. color: #409eff;
  793. &:hover {
  794. color: #66b1ff;
  795. background-color: rgba(64, 158, 255, 0.05);
  796. }
  797. }
  798. </style>