index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827
  1. <script>
  2. import orderApi from "@/api/business/purchase/purchase-order";
  3. import { initColumns, initDicts, initRules, initParams } from "@/utils/init";
  4. import { async } from "q";
  5. import { Columns, TabColumns } from "./column";
  6. const NewColumns = initColumns(Columns);
  7. const NewTabColumns = TabColumns.map((element) => ({
  8. ...element,
  9. tableColumns: initColumns(element.tableColumns),
  10. }));
  11. const SelectColumns = NewColumns.filter(
  12. (column) => column.inputType === "Select"
  13. );
  14. NewTabColumns.forEach((column) => {
  15. SelectColumns.push(
  16. ...column.tableColumns.filter((cColumn) => cColumn.inputType === "Select")
  17. );
  18. });
  19. export default {
  20. name: "AddPurchaseOrderDrawer",
  21. dicts: initDicts(SelectColumns),
  22. components: {
  23. FileUploadCenter: () => import("../components/FileUploadCenter/index.vue"),
  24. popDialog: () => import("@/components/PopDialog/index.vue"),
  25. },
  26. data() {
  27. return {
  28. visible: false,
  29. columns: NewColumns,
  30. rules: initRules(NewColumns),
  31. params: {
  32. ...initParams(NewColumns),
  33. puOrderItemList: [],
  34. puOrderExecuteList: [],
  35. },
  36. tabColumns: NewTabColumns,
  37. tabName: "puOrderItemList",
  38. isCopy:false,
  39. };
  40. },
  41. computed: {},
  42. watch: {
  43. "params.puOrderItemList": {
  44. handler(nVal, oVal) {
  45. this.visible &&
  46. this.handleSynchronousMaterial(
  47. "puOrderItemList",
  48. "puOrderExecuteList"
  49. );
  50. },
  51. deep: true,
  52. },
  53. "params.puOrderExecuteList": {
  54. handler(nVal, oVal) {
  55. this.visible &&
  56. this.handleSynchronousMaterial(
  57. "puOrderExecuteList",
  58. "puOrderItemList"
  59. );
  60. },
  61. deep: true,
  62. },
  63. // "params.puOrg": {
  64. // handler(nVal, oVal) {
  65. // console.log('nVal', nVal, 'oVal',oVal);
  66. // console.log(this.isCopy, 'this.isCopy');
  67. // // 组织变化
  68. // // if (this.visible && nVal.puOrg != oVal.puOrg) {
  69. // if (this.visible && oVal && nVal != oVal) {
  70. // for (const key in this.params) {
  71. // if (Array.isArray(this.params[key])) {
  72. // this.params[key] = [];
  73. // } else if (
  74. // key != "puOrg" &&
  75. // key != "puOrgName" &&
  76. // key != "buyer" &&
  77. // key != "buyerName" &&
  78. // key != "puDept" &&
  79. // key != "puDeptName" &&
  80. // key != "status"
  81. // ) {
  82. // this.params[key] = "";
  83. // } else {
  84. // }
  85. // }
  86. // }
  87. // },
  88. // deep: true,
  89. // },
  90. },
  91. methods: {
  92. beforeOpen() {
  93. if(!this.isCopy){
  94. const { deptName, deptId, name, nickName, orgName, orgId } = this.$store.state.user;
  95. this.params.puOrg = orgId;
  96. this.params.puOrgName = orgName;
  97. this.params.buyer = name;
  98. this.params.buyerName = nickName;
  99. this.params.puDept = deptId;
  100. this.params.puDeptName = deptName;
  101. this.params.billDate = new Date().Format('yyyy-MM-dd');
  102. console.log(this.params,'this.params');
  103. this.addTableRow();
  104. }
  105. },
  106. setVisible(prop,iscopy) {
  107. this.visible = prop;
  108. this.isCopy = iscopy;
  109. if(!this.visible){
  110. this.$refs['orderAddForm'].clearValidate();
  111. }
  112. },
  113. // 复制赋值
  114. async setCopyParams(id) {
  115. try {
  116. const { code, msg, data } = await orderApi.details(id);
  117. if (code === 200) {
  118. this.params = {
  119. ...data,
  120. id: "",
  121. code: "",
  122. isEnd:'N',
  123. status: "0",
  124. source: "3",
  125. isClose:'N',
  126. closeTime:'',
  127. isInvoice:'N',
  128. isSendWms:'N',
  129. rebateMoney:'',
  130. invoiceMoney:'',
  131. paymentMoney:'',
  132. applyPaymentMoney:'',
  133. };
  134. for (const key in this.params) {
  135. // if (Array.isArray(this.params[key])) {
  136. if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
  137. this.params[key].forEach((v) => {
  138. v.id = "";
  139. });
  140. }
  141. }
  142. // 清空 累计本币开票金额、
  143. // 累计付款金额、累计付款申请金额、累计开票主数量、最终关闭时间
  144. // 、最终关闭、已同步WMS 、订单抵扣余额金额、订单使用返利金额、 发票标识
  145. }
  146. } catch (err) {
  147. //
  148. } finally {
  149. // this.loading = false;
  150. }
  151. },
  152. // 增行
  153. addTableRow(prop) {
  154. for (const key in this.params) {
  155. // if (Array.isArray(this.params[key])) {
  156. if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
  157. const arr = this.tabColumns.find(
  158. (element) => element.key === key
  159. ).tableColumns;
  160. let rowData = initParams(arr, "key", "value");
  161. "rowno" in rowData &&
  162. (rowData["rowno"] = this.params[key].length + 1);
  163. // 物料
  164. if("rowNo" in rowData){
  165. rowData["rowNo"] = this.params[key].length + 1;
  166. // 扣税类别
  167. rowData["taxDeductClassify"] = '1';
  168. // 价格类型
  169. rowData["priceType"] = 'order';
  170. // 币种
  171. rowData["currency"] = '1002Z0100000000001K1';
  172. rowData["currencyName"] = '人民币';
  173. }
  174. // 是否完成询价,新增明细行需默认明细为false
  175. rowData["whetherCompleteInquiry"] = false;
  176. this.params[key].push(rowData);
  177. }
  178. }
  179. // const arr = this.tabColumns.find(
  180. // (element) => element.key === this.tabName
  181. // ).tableColumns;
  182. // prop.push(initParams(arr, "key", "value"));
  183. },
  184. // 删行
  185. async delTableRow(prop, index) {
  186. for (const key in this.params) {
  187. // if (Array.isArray(this.params[key])) {
  188. if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
  189. this.params[key].splice(index, 1);
  190. }
  191. }
  192. await this.handleGetPrice();
  193. // prop.splice(index, 1);
  194. },
  195. // 同步子表物料
  196. handleSynchronousMaterial(tableOne, tableTwo) {
  197. let _this = this;
  198. // this.params[tableOne]-- -> this.params[tableTwo]
  199. this.params[tableOne] &&
  200. this.params[tableOne].forEach((item, index) => {
  201. for (const key in item) {
  202. if(!_this.params[tableTwo][index]){
  203. const arr = _this.tabColumns.find(
  204. (element) => element.key === tableTwo
  205. ).tableColumns;
  206. _this.params[tableTwo].push(initParams(arr, "key", "value"));
  207. }
  208. if (key in _this.params[tableTwo][index]) {
  209. _this.params[tableTwo][index].material = item.material;
  210. key !== 'id' && ( _this.params[tableTwo][index][key] = item[key]);
  211. }
  212. }
  213. });
  214. },
  215. // 取消
  216. handleCancel() {
  217. this.params = {
  218. ...initParams(this.columns),
  219. puOrderItemList: [],
  220. puOrderExecuteList: [],
  221. };
  222. this.setVisible(false);
  223. },
  224. // 判断保存条件
  225. judgeSaveCondition(cb){
  226. this.$refs['orderAddForm'].validate(async (valid) => {
  227. if (valid) {
  228. if(!this.params['puOrderItemList'].length || !this.params['puOrderExecuteList'].length){
  229. this.$message.error('请填写订单行!');
  230. return false;
  231. }
  232. // puOrderItemList
  233. let isPrice = this.params.puOrderItemList.filter(item => !item.whetherCompleteInquiry);
  234. if(isPrice.length){
  235. this.$message.error('询价失败!');
  236. return false
  237. }
  238. console.log(isPrice,'isPrice');
  239. cb();
  240. } else {
  241. this.$message.error('存在必填项未填写');
  242. console.log('error submit!!');
  243. return false;
  244. }
  245. });
  246. },
  247. // 保存
  248. handleSava() {
  249. console.log(this.params,'this.params---------');
  250. this.judgeSaveCondition(async()=>{
  251. try {
  252. this.loading = true;
  253. const { code, msg } = await orderApi.create(this.params);
  254. if (code === 200) {
  255. this.handleCancel();
  256. }
  257. } catch (err) {
  258. //
  259. } finally {
  260. this.loading = false;
  261. }
  262. })
  263. },
  264. // 保存并新增
  265. async handleSubmit() {
  266. this.judgeSaveCondition(async()=>{
  267. try {
  268. const createById = this.params.buyer;
  269. const createByName = this.params.buyerName;
  270. const updateById = this.$store.state.user.id;
  271. const updateByName = this.$store.state.user.name;
  272. const { code, msg } = await orderApi.create({
  273. createById,
  274. createByName,
  275. updateById,
  276. updateByName,
  277. ...this.params,
  278. });
  279. if (code === 200) {
  280. this.setVisible(false);
  281. }
  282. } catch (err) {
  283. this.$notify.error({ title: "error", message: err });
  284. } finally {
  285. // this.setVisible(false);
  286. }
  287. })
  288. },
  289. // 主表参照改变之后
  290. async handleReferChange(val, type, source){
  291. // 供应商选择
  292. if( type === 'SUPPLIER_PARAM' ){
  293. let page = { pageNum: 1 , pageSize: 10 };
  294. let relevanceRefer = [
  295. {
  296. // 供应商联系人
  297. key:'supplierContacts',
  298. params:{
  299. type:'SUPPLIERCONTACTS_PARAM',
  300. supplierId:val.id,
  301. }
  302. },
  303. {
  304. // 供应商业务员
  305. key:'supplierPersonal',
  306. params:{
  307. type:'PSNLICENSE_PARAM',
  308. supplierId:val.id,
  309. pkOrg: source.puOrg,
  310. }
  311. }
  312. ]
  313. await relevanceRefer.forEach(async (refer) =>{
  314. try {
  315. const { code, rows} = await orderApi.REFER(
  316. {
  317. ...refer.params,
  318. search: "",
  319. isPage: true,
  320. }, page );
  321. if (code === 200) {
  322. source[refer.key] = rows[0]? rows[0].id :'';
  323. source[`${refer.key}Name`] = rows[0] ? rows[0].name :'';
  324. }
  325. } catch (error) {}
  326. })
  327. }
  328. // 组织
  329. if(type === 'ORG_PARAM'){
  330. for (const key in this.params) {
  331. // if (Array.isArray(this.params[key])) {
  332. if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
  333. this.params[key] = [];
  334. }
  335. else if(key === 'sysFileRecordList'){
  336. this.params[key] = [];
  337. }
  338. else if (
  339. key != "puOrg" &&
  340. key != "puOrgName" &&
  341. key != "buyer" &&
  342. key != "buyerName" &&
  343. key != "puDept" &&
  344. key != "puDeptName" &&
  345. key != "status"
  346. ) {
  347. this.params[key] = "";
  348. } else {
  349. }
  350. }
  351. }
  352. },
  353. // 下拉框选择改变
  354. handleSelectChange(val,typeName){
  355. if(val === 'billType'){
  356. this.params['billTypeName'] = this.dict.type[typeName].find(item => item.value == this.params[val]).label;
  357. }
  358. },
  359. // 子表参照改变之后
  360. async handleTabReferChange(val, type, source) {
  361. // 触发物料参照询价 && source.qty && source.qty != ""
  362. if (type == "MATERIAL_PARAM" && source.qty && source.qty != "") {
  363. source['qty'] = 0;
  364. source['whetherCompleteInquiry'] = false;
  365. source['taxPrice'] = 0;
  366. source['money'] = 0;
  367. source['taxDeductMoneya'] = 0;
  368. source['price'] = 0;
  369. source['notaxMoney'] = 0;
  370. source['tax'] = 0;
  371. this.params['qty'] = 0;
  372. this.params['originalQty'] = 0;
  373. this.params['money'] = 0;
  374. this.params['originalMoney'] = 0;
  375. this.params['notaxMoney'] = 0;
  376. source.isDrug = val.materialMedcine.isDrug == '0' ? 'Y' : 'N';
  377. // await this.handleGetPrice();
  378. }
  379. },
  380. // 子表下拉框改变
  381. async handleTabSelectChange(type,row){
  382. if(type == 'priceType' && row.material && row.qty && row.qty != ""){
  383. row['whetherCompleteInquiry'] = false;
  384. await this.handleGetPrice();
  385. }
  386. },
  387. // 子表inputNumber
  388. handleInputChange(row, type) {
  389. // 物料数量变化----询价
  390. if (type == "qty" && row.material) {
  391. row['whetherCompleteInquiry'] = false;
  392. row.qty && this.handleGetPrice();
  393. }
  394. },
  395. // 子表多选框改变
  396. handleTabCheckbox(type,source){
  397. // 勾选赠品,价税合计更新为0,含税单价、无税单价更新为0
  398. if(type === 'isGift' && source.material && source.qty && source.qty != ""){
  399. source['whetherCompleteInquiry'] = false;
  400. this.handleGetPrice()
  401. }
  402. },
  403. // 询价 getPrice
  404. async handleGetPrice() {
  405. try {
  406. // let { puOrg, priceType, customer, assignSupplier, material, } = data;
  407. let { code, data } = await orderApi.getPrice({ ...this.params });
  408. if (code == 200) {
  409. this.params = data;
  410. }
  411. } catch (error) {
  412. } finally {
  413. }
  414. },
  415. },
  416. created() {
  417. console.log("ADD CREATED", this.params);
  418. },
  419. mounted() {},
  420. destroyed() {},
  421. };
  422. </script>
  423. <template>
  424. <el-drawer
  425. direction="btt"
  426. size="100%"
  427. :with-header="false"
  428. :visible.sync="visible"
  429. @open="beforeOpen"
  430. @close="$emit('close')"
  431. >
  432. <el-form
  433. size="mini"
  434. label-position="right"
  435. ref="orderAddForm"
  436. label-width="140px"
  437. :model="params"
  438. :rules="rules"
  439. >
  440. <el-card
  441. :body-style="{
  442. padding: '20px',
  443. display: 'flex',
  444. 'flex-wrap': 'wrap',
  445. }"
  446. style="margin: 10px"
  447. >
  448. <div
  449. slot="header"
  450. style="
  451. display: flex;
  452. justify-content: space-between;
  453. align-items: center;
  454. "
  455. >
  456. <h3>新增</h3>
  457. <div style="text-align: right">
  458. <el-button size="mini" @click="handleCancel">取消</el-button>
  459. <el-button
  460. size="mini"
  461. type="danger"
  462. @click="handleSava"
  463. >保存</el-button>
  464. <!-- <el-button size="mini" type="info" @click="handleSubmit">
  465. 保存并新增
  466. </el-button> -->
  467. </div>
  468. </div>
  469. <el-row style="display: flex; flex-wrap: wrap">
  470. <el-col
  471. v-for="(column, index) in columns"
  472. :key="index"
  473. :span="column.span || 6"
  474. >
  475. <el-form-item
  476. :prop="column.key"
  477. :label="column.title"
  478. v-if="column.isShow"
  479. >
  480. <el-input
  481. v-if="column.inputType === 'Input'"
  482. v-model="params[column.key]"
  483. :placeholder="column.placeholder"
  484. :clearable="column.clearable"
  485. :disabled="column.disabled"
  486. style="width: 100%"
  487. >
  488. </el-input>
  489. <dr-popover-select
  490. v-if="column.inputType === 'PopoverSelect'"
  491. v-model="params[column.key]"
  492. :value-key="column.valueKey"
  493. :source.sync="params"
  494. :title="column.title"
  495. :type="column.referName"
  496. :disabled="column.disabled"
  497. :multiple="column.multiple"
  498. :placeholder="column.placeholder"
  499. :data-mapping="column.dataMapping"
  500. :query-params="column.queryParams"
  501. @change="handleReferChange"
  502. ></dr-popover-select>
  503. <el-input
  504. v-if="column.inputType === 'Textarea'"
  505. v-model="params[column.key]"
  506. type="textarea"
  507. :placeholder="column.placeholder"
  508. :clearable="column.clearable"
  509. :disabled="column.disabled"
  510. style="width: 100%"
  511. ></el-input>
  512. <el-input-number
  513. v-if="column.inputType === 'InputNumber'"
  514. v-model="params[column.key]"
  515. :controls-position="column.controlsPosition"
  516. :placeholder="column.placeholder"
  517. :clearable="column.clearable"
  518. :disabled="column.disabled"
  519. style="width: 100%"
  520. >
  521. </el-input-number>
  522. <el-select
  523. v-if="column.inputType === 'Select'"
  524. v-model="params[column.key]"
  525. :disabled="column.disabled"
  526. :clearable="column.clearable"
  527. :placeholder="column.placeholder"
  528. style="width: 100%"
  529. @change="handleSelectChange(column.key,column.referName)"
  530. >
  531. <el-option
  532. v-for="item in dict.type[column.referName]"
  533. :key="item.value"
  534. :label="item.label"
  535. :value="item.value"
  536. ></el-option>
  537. </el-select>
  538. <el-select
  539. v-if="column.inputType === 'TagSelect'"
  540. v-model="params[column.key]"
  541. multiple
  542. clearable
  543. collapse-tags
  544. :placeholder="column.placeholder"
  545. :clearable="column.clearable"
  546. :disabled="column.disabled"
  547. style="width: 100%"
  548. >
  549. <template #prefix>
  550. <el-icon
  551. class="el-icon-view"
  552. style="cursor: pointer"
  553. @click.stop="$message.info(234)"
  554. >
  555. </el-icon>
  556. </template>
  557. <el-option
  558. v-for="item in options"
  559. :key="item.value"
  560. :label="item.label"
  561. :value="item.value"
  562. ></el-option>
  563. </el-select>
  564. <el-date-picker
  565. v-if="column.inputType === 'DatePicker'"
  566. v-model="params[column.key]"
  567. :type="column.type"
  568. :placeholder="column.placeholder"
  569. :clearable="column.clearable"
  570. :disabled="column.disabled"
  571. :picker-options="column.pickerOptions"
  572. style="width: 100%"
  573. ></el-date-picker>
  574. <el-checkbox
  575. v-if="column.inputType === 'Checkbox'"
  576. v-model="params[column.key]"
  577. :disabled="column.disabled"
  578. true-label="Y"
  579. false-label="N"
  580. ></el-checkbox>
  581. <file-upload-center
  582. v-if="column.inputType === 'Upload'"
  583. v-model="params[column.key]"
  584. :file-type="column.fileType"
  585. ></file-upload-center>
  586. </el-form-item>
  587. </el-col>
  588. </el-row>
  589. </el-card>
  590. <el-card
  591. :body-style="{
  592. padding: '20px',
  593. display: 'flex',
  594. 'flex-wrap': 'wrap',
  595. position: 'relative',
  596. }"
  597. style="margin: 10px"
  598. >
  599. <el-tabs v-model="tabName" style="width: 100%">
  600. <el-tab-pane
  601. v-for="(column, index) in tabColumns"
  602. :key="index"
  603. :label="column.title"
  604. :name="column.key"
  605. >
  606. <el-table
  607. :data="params[column.key]"
  608. style="width: 100%"
  609. :height="params[column.key].length ? 300 : 100"
  610. >
  611. <el-table-column
  612. v-for="(cColumn, cIndex) in column.tableColumns"
  613. :key="cIndex"
  614. :label="cColumn.title"
  615. :width="cColumn.width || 80"
  616. >
  617. <template slot-scope="scope">
  618. <el-form-item
  619. label-width="0"
  620. :prop="`${column.key}.${scope.$index}.${[cColumn.key]}`"
  621. :rules="{ required: cColumn.require || false, message: `${cColumn.title}不能为空`, trigger: 'change' }"
  622. >
  623. <el-tag v-if="cColumn.key === 'index'" >
  624. {{ scope.$index + 1 }}
  625. </el-tag>
  626. <el-input
  627. v-if="cColumn.inputType === 'Input'"
  628. v-model="scope.row[cColumn.key]"
  629. :placeholder="cColumn.placeholder"
  630. :clearable="cColumn.clearable"
  631. :disabled="cColumn.disabled"
  632. size="mini"
  633. style="width: 100%"
  634. ></el-input>
  635. <!-- -->
  636. <dr-popover-select
  637. v-if="cColumn.inputType === 'PopoverSelect'"
  638. v-model="scope.row[cColumn.key]"
  639. :source.sync="scope.row"
  640. :title="cColumn.title"
  641. :value-key="cColumn.valueKey"
  642. :type="cColumn.referName"
  643. :disabled="cColumn.disabled"
  644. :multiple="cColumn.multiple"
  645. :placeholder="cColumn.placeholder"
  646. :data-mapping="cColumn.dataMapping"
  647. :query-params="cColumn.queryParams"
  648. @change="handleTabReferChange"
  649. size="mini"
  650. >
  651. </dr-popover-select>
  652. <el-input-number
  653. v-if="cColumn.inputType === 'InputNumber'"
  654. v-model="scope.row[cColumn.key]"
  655. :controls-position="cColumn.controlsPosition"
  656. :placeholder="cColumn.placeholder"
  657. @change="handleInputChange(scope.row, cColumn.key)"
  658. :clearable="cColumn.clearable"
  659. :disabled="cColumn.disabled"
  660. size="mini"
  661. style="width: 100%"
  662. ></el-input-number>
  663. <el-select
  664. v-if="cColumn.inputType === 'Select'"
  665. v-model="scope.row[cColumn.key]"
  666. size="mini"
  667. :disabled="cColumn.disabled"
  668. :clearable="cColumn.clearable"
  669. :placeholder="cColumn.placeholder"
  670. style="width: 100%"
  671. @change="handleTabSelectChange(cColumn.key,scope.row)"
  672. >
  673. <el-option
  674. v-for="item in dict.type[cColumn.referName]"
  675. :key="item.value"
  676. :label="item.label"
  677. :value="item.value"
  678. ></el-option>
  679. </el-select>
  680. <el-checkbox
  681. v-if="cColumn.inputType === 'Checkbox'"
  682. v-model="scope.row[cColumn.key]"
  683. :disabled="cColumn.disabled"
  684. true-label="Y"
  685. false-label="N"
  686. @change="handleTabCheckbox(cColumn.key,scope.row)"
  687. ></el-checkbox>
  688. </el-form-item>
  689. </template>
  690. </el-table-column>
  691. <el-table-column fixed="right" label="操作" width="80">
  692. <template slot-scope="scope">
  693. <el-button
  694. @click.native.prevent="
  695. delTableRow(params[tabName], scope.$index)
  696. "
  697. type="text"
  698. size="small"
  699. >
  700. 删行
  701. </el-button>
  702. </template>
  703. </el-table-column>
  704. </el-table>
  705. </el-tab-pane>
  706. </el-tabs>
  707. <el-row style="position: absolute; top: 20px; right: 20px">
  708. <el-button size="mini" @click="addTableRow(params[tabName])"
  709. >增行</el-button
  710. >
  711. </el-row>
  712. </el-card>
  713. </el-form>
  714. </el-drawer>
  715. </template>