index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  1. <script>
  2. import useColumns from "./columns";
  3. import { EXIST } from "@/api/business/purchase/catalogue";
  4. import { ITEM, SAVE, PRICE, BATCHPRICE } from "@/api/business/purchase/apply";
  5. import { tax, unit, currency } from "@/components/popover-select-v2/fetch";
  6. // 用于回显参照框数据
  7. import { getRefer } from "@/api/purchase/basic.js";
  8. const fetchExist = async (prop) => {
  9. try {
  10. // try
  11. const { code, data } = await EXIST(prop);
  12. if (code === 200) return data;
  13. } catch (err) {
  14. // catch
  15. console.error(err);
  16. } finally {
  17. // finally
  18. }
  19. };
  20. export default {
  21. name: "CopyDrawer",
  22. props: {
  23. dict: {
  24. type: Object,
  25. },
  26. selectData: {
  27. type: [Array],
  28. require: true,
  29. },
  30. },
  31. components: {
  32. ElSuperForm: () => import("@/components/super-form/index.vue"),
  33. ElSuperTable: () => import("@/components/super-table/index.vue"),
  34. ElSuperUxTable: () => import("@/components/super-ux-table/index.vue"),
  35. ElPopoverSelectV2: () => import("@/components/popover-select-v2/index.vue"),
  36. },
  37. data() {
  38. const {
  39. TabColumns,
  40. TableColumns,
  41. TabColumns: [
  42. {
  43. item: { key: tabName },
  44. },
  45. ],
  46. } = useColumns();
  47. const rules = this.$init.rules([...TabColumns, ...TableColumns]);
  48. const params = this.$init.params([...TabColumns, ...TableColumns]);
  49. return {
  50. title: "复 制",
  51. width: "100%",
  52. visible: false,
  53. loading: false,
  54. rules: rules,
  55. params: params,
  56. tabName: tabName,
  57. TabColumns: TabColumns,
  58. TableColumns: TableColumns,
  59. delDemandItemList: [],
  60. };
  61. },
  62. computed: {
  63. disabled: {
  64. get() {
  65. const {
  66. selectData: { length },
  67. } = this.$props;
  68. if (length !== 1) {
  69. return true;
  70. }
  71. },
  72. set() {},
  73. },
  74. },
  75. watch: {},
  76. methods: {
  77. //
  78. async changeMaterialName(prop) {
  79. const { selectData } = prop;
  80. const {
  81. puOrg,
  82. customer,
  83. supplier,
  84. currency,
  85. currencyCode,
  86. currencyName,
  87. } = this.params;
  88. const { nickName: createByName } = this.$store.state.user;
  89. if (selectData.length) {
  90. this.params[this.tabName].splice(-1);
  91. }
  92. for (const item of selectData) {
  93. this.loading = true;
  94. const { tax: taxName, unitName, code: materialCode } = item;
  95. // task 1
  96. const { ntaxrate } = await tax(taxName);
  97. // task 2
  98. const {
  99. id: puUnit,
  100. code: puUnitCode,
  101. name: puUnitName,
  102. } = await unit(unitName);
  103. // task 3
  104. const {
  105. recentlyPrice = "0",
  106. isApprovalFirst = "N",
  107. purchasequantity,
  108. recentlyPriceDate,
  109. } = await fetchExist({
  110. puOrg,
  111. customer,
  112. supplier,
  113. materialCode,
  114. priceType: prop.row.priceType,
  115. });
  116. this.loading = false;
  117. await this.onRowAdd(this.tabName, {
  118. ...item,
  119. currency: currency,
  120. currencyCode: currencyCode,
  121. currencyName: currencyName,
  122. unit: puUnit,
  123. unitCode: puUnitCode,
  124. unitName: puUnitName,
  125. puUnit: puUnit,
  126. puUnitCode: puUnitCode,
  127. puUnitName: puUnitName,
  128. recentlyPrice,
  129. recentlyPriceDate: recentlyPriceDate,
  130. isApprovalFirst,
  131. yPurchaseQuantity: purchasequantity,
  132. tax: Number(ntaxrate === "0E-8" ? 0 : ntaxrate),
  133. createByName: createByName,
  134. updateByName: createByName,
  135. id: null,
  136. });
  137. }
  138. },
  139. //
  140. async changeCustomerName(prop) {
  141. console.log("prop", prop);
  142. const { puOrg, supplier, currency, currencyCode, currencyName } =
  143. this.params;
  144. const {
  145. recentlyPrice,
  146. isApprovalFirst,
  147. purchasequantity,
  148. recentlyPriceDate,
  149. } = await fetchExist({
  150. puOrg,
  151. supplier,
  152. materialCode: prop.row.materialCode,
  153. customer: prop.row.customerName ? prop.row.customer : "",
  154. customerName: prop.row.customerName,
  155. priceType: prop.row.priceType,
  156. });
  157. prop.row.yPurchaseQuantity = purchasequantity;
  158. prop.row.recentlyPrice = recentlyPrice;
  159. prop.row.isApprovalFirst = isApprovalFirst;
  160. prop.row.recentlyPriceDate = recentlyPriceDate;
  161. },
  162. //
  163. async fetchItem(prop) {
  164. try {
  165. // try
  166. this.loading = true;
  167. const { tabName, TabColumns } = this;
  168. const { TableColumns } = TabColumns.find(
  169. ({ item: { key } }) => key === tabName
  170. );
  171. console.log("看看prop", prop);
  172. const { code, data } = await ITEM(prop, true);
  173. if (code === 200) {
  174. this.params = data;
  175. this.params.priceApplyItems = data.priceApplyItems.map((item) => ({
  176. ...this.$init.params(TableColumns),
  177. ...item,
  178. id: null,
  179. }));
  180. this.params.id = null;
  181. } else {
  182. this.visible = false;
  183. }
  184. } catch (err) {
  185. // catch
  186. console.error(err);
  187. this.visible = false;
  188. } finally {
  189. // finally
  190. this.loading = false;
  191. }
  192. },
  193. //
  194. async onOpen() {
  195. this.visible = true;
  196. const {
  197. selectData: [{ id }],
  198. } = this.$props;
  199. this.params.id = null;
  200. this.params.createBy = null;
  201. this.params.priceCode = null;
  202. this.params.createByName = null;
  203. this.params.effectiveDate = null;
  204. this.params.priceApplyOrgs = [];
  205. this.params.priceApplyItems = this.params.priceApplyItems.map((item) => ({
  206. ...item,
  207. id: null,
  208. applyId: null,
  209. createByName: null,
  210. updateByName: null,
  211. delFlag: 0,
  212. }));
  213. await this.fetchItem(id);
  214. },
  215. //
  216. async onHide() {
  217. const { TabColumns, TableColumns } = useColumns();
  218. this.visible = false;
  219. this.params = this.$init.params([...TabColumns, ...TableColumns]);
  220. this.$emit("success");
  221. this.delDemandItemList = [];
  222. },
  223. //
  224. async onRowAdd(prop, pushParams = {}) {
  225. this.$refs.superForm.validate(async (valid) => {
  226. if (valid) {
  227. const { TabColumns } = this;
  228. const { TableColumns } = TabColumns.find(
  229. ({ item: { key } }) => key === prop
  230. );
  231. this.params[prop].push({
  232. delFlag: "0",
  233. ...this.$init.params(TableColumns),
  234. ...pushParams,
  235. });
  236. }
  237. });
  238. },
  239. //
  240. async onRowRemove(prop, scope) {
  241. // const {$index} = scope;
  242. // this.params[prop].splice($index, 1);
  243. scope.row.delFlag = "2";
  244. let delList = [];
  245. delList = this.params[prop].filter((item) => {
  246. return item.delFlag == "2";
  247. });
  248. this.params[prop] = this.params[prop].filter((item) => {
  249. return item.delFlag == "0";
  250. });
  251. this.delDemandItemList.push(...delList);
  252. },
  253. //
  254. async useSubmit(prop) {
  255. this.$refs[prop].validate(async (valid) => {
  256. console.log(this.params);
  257. if (valid) {
  258. try {
  259. this.loading = true;
  260. let list = [];
  261. list.push(
  262. ...this.params.priceApplyItems,
  263. ...this.delDemandItemList
  264. );
  265. this.params.priceApplyItems = this.params.priceApplyItems.filter(
  266. (item) => item.materialName
  267. );
  268. // 深拷贝一下参数对象
  269. let param = JSON.parse(JSON.stringify(this.params));
  270. // console.log('深拷贝对象',param);
  271. param.priceApplyItems = list;
  272. param.priceApplyItems.forEach((item, index) => {
  273. item.$index = index;
  274. });
  275. let tishi = param.priceApplyItems.filter((item) => {
  276. return (
  277. item.priceDiffer &&
  278. item.delFlag == "0" &&
  279. item.priceDiffer !== 0
  280. );
  281. });
  282. console.log("筛选", tishi);
  283. let tishiMsg = tishi.map((item) => {
  284. return `第${item.$index + 1}行为价格调整`;
  285. });
  286. console.log(tishiMsg);
  287. if (tishiMsg.length !== 0) {
  288. this.$modal
  289. .confirm(tishiMsg + "请核对后再次提交")
  290. .then(async () => {
  291. const { msg, code } = await SAVE(param);
  292. if (code === 200) {
  293. this.onHide();
  294. this.$emit("success");
  295. this.$notify.success(msg);
  296. this.delDemandItemList = [];
  297. }
  298. })
  299. .catch(() => {});
  300. } else {
  301. const { msg, code } = await SAVE(param);
  302. if (code === 200) {
  303. this.onHide();
  304. this.$emit("success");
  305. this.$notify.success(msg);
  306. this.delDemandItemList = [];
  307. }
  308. }
  309. } catch (err) {
  310. // catch
  311. console.error(err);
  312. } finally {
  313. // finally
  314. this.loading = false;
  315. }
  316. } else {
  317. return false;
  318. }
  319. });
  320. },
  321. // 粘贴
  322. async pasteMe(e, scope, index, prop) {
  323. this.$modal.loading("正在处理数据...");
  324. e.preventDefault(); //阻止默认粘贴事件
  325. let source = e.clipboardData.getData("Text");
  326. console.log("scope", scope.column.property);
  327. console.log("index", index);
  328. // 首先对源头进行解析
  329. let rows = source.split("\r\n"); // 拆成一个数组
  330. // 数组去除空字符串
  331. rows = rows.filter((item) => {
  332. return item && item.trim();
  333. });
  334. if (rows.length < 100) {
  335. if (scope.column.property == "materialCode") {
  336. let rowList = [];
  337. let newLine = [];
  338. await getRefer({ type: "MATERIAL_PARAM", materialCodeList: rows })
  339. .then((res) => {
  340. if (res.code === 200) {
  341. rowList = res.rows;
  342. }
  343. })
  344. .catch((err) => {
  345. this.$modal.closeLoading();
  346. });
  347. const {
  348. puOrg,
  349. customer,
  350. customerName,
  351. supplier,
  352. currency,
  353. currencyCode,
  354. currencyName,
  355. } = this.params;
  356. const { TabColumns } = this;
  357. const { TableColumns } = TabColumns.find(
  358. ({ item: { key } }) => key === prop
  359. );
  360. // console.log('kk', TableColumns)
  361. // console.log('this.$init.params(TableColumns)', this.$init.params(TableColumns))
  362. for (let i = 0; i < rowList.length; i++) {
  363. let line = { ...this.$init.params(TableColumns) };
  364. console.log("line", line);
  365. const { nickName: createByName } = this.$store.state.user;
  366. const { ntaxrate } = await tax(rowList[i].materialRateName);
  367. // task 2
  368. const {
  369. id: puUnit,
  370. code: puUnitCode,
  371. name: puUnitName,
  372. } = await unit(rowList[i].unitIdName);
  373. // task 3
  374. const {
  375. recentlyPrice = "0",
  376. isApprovalFirst = "N",
  377. purchasequantity,
  378. recentlyPriceDate,
  379. } = await fetchExist({
  380. puOrg,
  381. customer,
  382. supplier,
  383. materialCode: rowList[i].code,
  384. customerName: "",
  385. priceType: line.priceType,
  386. });
  387. line.delFlag = "0";
  388. line.materialCode = rowList[i].code;
  389. line.material = rowList[i].id;
  390. line.materialName = rowList[i].name;
  391. line.specification = rowList[i].specification;
  392. line.model = rowList[i].model;
  393. line.manufacturerName = rowList[i].manufacturerIdName;
  394. (line.unit = puUnit),
  395. (line.unitCode = puUnitCode),
  396. (line.unitName = puUnitName),
  397. (line.puUnit = puUnit),
  398. (line.puUnitCode = puUnitCode),
  399. (line.puUnitName = puUnitName),
  400. (line.recentlyPrice = recentlyPrice);
  401. line.isApprovalFirst = isApprovalFirst;
  402. (line.recentlyPriceDate = recentlyPriceDate),
  403. (line.yPurchaseQuantity = purchasequantity),
  404. (line.tax = Number(ntaxrate === "0E-8" ? 0 : ntaxrate)),
  405. (line.createByName = createByName),
  406. (line.updateByName = createByName),
  407. (line.currency = currency);
  408. line.currencyCode = currencyCode;
  409. line.currencyName = currencyName;
  410. newLine.push(line);
  411. console.log("临时数组", newLine);
  412. }
  413. // 删除指定下标
  414. this.params[prop].splice(
  415. index,
  416. this.params[prop].length - index,
  417. ...newLine
  418. );
  419. this.$modal.closeLoading();
  420. this.$modal.notifySuccess("共粘贴" + rowList.length + "条数据");
  421. } else if (scope.column.property == "taxPrice") {
  422. console.log("复制内容:", rows);
  423. // let newLine = []
  424. // const {TabColumns} = this;
  425. // const {TableColumns} = TabColumns.find(
  426. // ({item: {key}}) => key === prop
  427. // );
  428. if (this.params[prop].length <= 1) {
  429. this.params[prop][index].taxPrice = rows[0];
  430. // for (let i = 0; i<rows.length; i++) {
  431. // let line = {...this.$init.params(TableColumns)}
  432. // line.taxPrice = rows[i]
  433. // newLine.push(line)
  434. // }
  435. // // 删除指定下标
  436. // this.params[prop].splice(index,this.params[prop].length - index,...newLine)
  437. // this.$modal.notifySuccess("共粘贴" + rows.length + '条数据');
  438. this.$modal.closeLoading();
  439. } else {
  440. for (let i = index, j = 0; i < this.params[prop].length; i++, j++) {
  441. this.params[prop][i].taxPrice = rows[j];
  442. }
  443. // this.$refs.table.doLayout()
  444. // console.log(this.params[prop])
  445. this.$modal.closeLoading();
  446. }
  447. await this.batchPrice(this.params.priceApplyItems);
  448. } else if (scope.column.property == "supplierName") {
  449. if (this.params[prop].length <= 1) {
  450. this.params[prop][index].supplierName = rows[0];
  451. this.$modal.closeLoading();
  452. } else {
  453. for (let i = index, j = 0; i < this.params[prop].length; i++, j++) {
  454. this.params[prop][i].supplierName = rows[j];
  455. }
  456. this.$modal.closeLoading();
  457. }
  458. } else if (scope.column.property == "bidPrice") {
  459. if (this.params[prop].length <= 1) {
  460. this.params[prop][index].bidPrice = rows[0];
  461. this.$modal.closeLoading();
  462. } else {
  463. for (let i = index, j = 0; i < this.params[prop].length; i++, j++) {
  464. this.params[prop][i].bidPrice = rows[j];
  465. }
  466. this.$modal.closeLoading();
  467. }
  468. } else if (scope.column.property == "unitPrice") {
  469. if (this.params[prop].length <= 1) {
  470. this.params[prop][index].unitPrice = rows[0];
  471. this.$modal.closeLoading();
  472. } else {
  473. for (let i = index, j = 0; i < this.params[prop].length; i++, j++) {
  474. this.params[prop][i].unitPrice = rows[j];
  475. }
  476. this.$modal.closeLoading();
  477. }
  478. } else if (scope.column.property == "supplierName1") {
  479. if (this.params[prop].length <= 1) {
  480. this.params[prop][index].supplierName1 = rows[0];
  481. this.$modal.closeLoading();
  482. } else {
  483. for (let i = index, j = 0; i < this.params[prop].length; i++, j++) {
  484. this.params[prop][i].supplierName1 = rows[j];
  485. }
  486. this.$modal.closeLoading();
  487. }
  488. } else if (scope.column.property == "bidPrice1") {
  489. if (this.params[prop].length <= 1) {
  490. this.params[prop][index].bidPrice1 = rows[0];
  491. this.$modal.closeLoading();
  492. } else {
  493. for (let i = index, j = 0; i < this.params[prop].length; i++, j++) {
  494. this.params[prop][i].bidPrice1 = rows[j];
  495. }
  496. this.$modal.closeLoading();
  497. }
  498. } else if (scope.column.property == "unitPrice1") {
  499. if (this.params[prop].length <= 1) {
  500. this.params[prop][index].unitPrice1 = rows[0];
  501. this.$modal.closeLoading();
  502. } else {
  503. for (let i = index, j = 0; i < this.params[prop].length; i++, j++) {
  504. this.params[prop][i].unitPrice1 = rows[j];
  505. }
  506. this.$modal.closeLoading();
  507. }
  508. } else if (scope.column.property == "supplierName2") {
  509. if (this.params[prop].length <= 1) {
  510. this.params[prop][index].supplierName2 = rows[0];
  511. this.$modal.closeLoading();
  512. } else {
  513. for (let i = index, j = 0; i < this.params[prop].length; i++, j++) {
  514. this.params[prop][i].supplierName2 = rows[j];
  515. }
  516. this.$modal.closeLoading();
  517. }
  518. } else if (scope.column.property == "bidPrice2") {
  519. if (this.params[prop].length <= 1) {
  520. this.params[prop][index].bidPrice2 = rows[0];
  521. this.$modal.closeLoading();
  522. } else {
  523. for (let i = index, j = 0; i < this.params[prop].length; i++, j++) {
  524. this.params[prop][i].bidPrice2 = rows[j];
  525. }
  526. this.$modal.closeLoading();
  527. }
  528. } else if (scope.column.property == "unitPrice2") {
  529. if (this.params[prop].length <= 1) {
  530. this.params[prop][index].unitPrice2 = rows[0];
  531. this.$modal.closeLoading();
  532. } else {
  533. for (let i = index, j = 0; i < this.params[prop].length; i++, j++) {
  534. this.params[prop][i].unitPrice2 = rows[j];
  535. }
  536. this.$modal.closeLoading();
  537. }
  538. }
  539. } else {
  540. this.$modal.notifyWarning("复制长度不能超过100!");
  541. this.$modal.closeLoading();
  542. }
  543. },
  544. // 复制含税单价,查询价格
  545. async batchPrice(prop) {
  546. try {
  547. this.loading = true;
  548. let { code, data } = await BATCHPRICE(prop);
  549. if (code === 200) {
  550. this.params.priceApplyItems = data;
  551. }
  552. } catch (error) {
  553. } finally {
  554. this.loading = false;
  555. }
  556. },
  557. // 含税单价
  558. async changeTaxPrice(val, prop) {
  559. try {
  560. this.loading = true;
  561. let { taxPrice, tax, recentlyPrice, yPurchaseQuantity } = prop;
  562. let { code, data } = await PRICE({
  563. taxPrice,
  564. tax,
  565. recentlyPrice,
  566. yPurchaseQuantity,
  567. });
  568. if (code === 200) {
  569. prop.price = data.price;
  570. prop.isPriceAdjustment = data.isPriceAdjustment;
  571. prop.increase = data.increase;
  572. prop.priceDiffer = data.priceDiffer;
  573. prop.yAffectedAmount = data.yAffectedAmount;
  574. prop.yPurchaseVolume = data.yPurchaseVolume;
  575. }
  576. } catch (error) {
  577. } finally {
  578. this.loading = false;
  579. }
  580. },
  581. },
  582. created() {},
  583. mounted() {},
  584. destroyed() {},
  585. };
  586. </script>
  587. <template>
  588. <el-button
  589. v-bind="$attrs"
  590. v-on="$listeners"
  591. :disabled="disabled"
  592. @click="onOpen"
  593. >
  594. {{ title }}
  595. <el-drawer
  596. :show-close="false"
  597. :size="width"
  598. :title="title"
  599. :visible.sync="visible"
  600. append-to-body
  601. destroy-on-close
  602. @close="onHide"
  603. >
  604. <template slot="title">
  605. <span>{{ title }}</span>
  606. <el-button
  607. type="primary"
  608. :size="$attrs.size"
  609. :loading="loading"
  610. @click="useSubmit('superForm')"
  611. >
  612. 确 认
  613. </el-button>
  614. <el-button :size="$attrs.size" :loading="loading" @click="onHide">
  615. 取 消
  616. </el-button>
  617. </template>
  618. <el-super-form
  619. v-model="params"
  620. :dict="dict"
  621. :rules="rules"
  622. :size="$attrs.size"
  623. :columns="TableColumns"
  624. ref="superForm"
  625. label-width="auto"
  626. label-position="right"
  627. style="padding: 18px"
  628. >
  629. </el-super-form>
  630. <el-tabs v-model="tabName" style="padding: 0 18px 18px">
  631. <el-tab-pane
  632. v-for="({ item, TableColumns: columns }, index) in TabColumns"
  633. :key="index"
  634. :label="item.title"
  635. :name="item.key"
  636. lazy
  637. >
  638. <div v-loading="loading" style="height: 250px; display: flex">
  639. <el-super-ux-table
  640. index
  641. v-model="params[item.key]"
  642. :dict="dict"
  643. :ref="tabName"
  644. height="250"
  645. :columns="columns"
  646. :size="$attrs.size"
  647. >
  648. <template slot="materialName" slot-scope="scope">
  649. <component
  650. v-bind="scope.attr"
  651. v-model="scope.row[scope.item.key]"
  652. :size="$attrs.size"
  653. :source.sync="scope.row"
  654. @change="changeMaterialName({ ...scope, selectData: $event })"
  655. >
  656. </component>
  657. </template>
  658. <template slot="materialCode" slot-scope="scope">
  659. <component
  660. v-bind="scope.attr"
  661. v-model="scope.row[scope.item.key]"
  662. :size="$attrs.size"
  663. :source.sync="scope.row"
  664. @paste.native="
  665. pasteMe($event, scope, scope.rowIndex, tabName)
  666. "
  667. >
  668. </component>
  669. </template>
  670. <template slot="taxPrice" slot-scope="scope">
  671. <component
  672. v-bind="scope.attr"
  673. v-model="scope.row[scope.item.key]"
  674. :size="$attrs.size"
  675. :source.sync="scope.row"
  676. @change="(val) => changeTaxPrice(val, scope.row)"
  677. @paste.native="
  678. pasteMe($event, scope, scope.rowIndex, tabName)
  679. "
  680. >
  681. </component>
  682. </template>
  683. <template slot="supplierName" slot-scope="scope">
  684. <component
  685. v-bind="scope.attr"
  686. v-model="scope.row[scope.item.key]"
  687. :size="$attrs.size"
  688. :source.sync="scope.row"
  689. @paste.native="
  690. pasteMe($event, scope, scope.rowIndex, tabName)
  691. "
  692. >
  693. </component>
  694. </template>
  695. <template slot="bidPrice" slot-scope="scope">
  696. <component
  697. v-bind="scope.attr"
  698. v-model="scope.row[scope.item.key]"
  699. :size="$attrs.size"
  700. :source.sync="scope.row"
  701. @paste.native="
  702. pasteMe($event, scope, scope.rowIndex, tabName)
  703. "
  704. >
  705. </component>
  706. </template>
  707. <template slot="unitPrice" slot-scope="scope">
  708. <component
  709. v-bind="scope.attr"
  710. v-model="scope.row[scope.item.key]"
  711. :size="$attrs.size"
  712. :source.sync="scope.row"
  713. @paste.native="
  714. pasteMe($event, scope, scope.rowIndex, tabName)
  715. "
  716. >
  717. </component>
  718. </template>
  719. <template slot="supplierName1" slot-scope="scope">
  720. <component
  721. v-bind="scope.attr"
  722. v-model="scope.row[scope.item.key]"
  723. :size="$attrs.size"
  724. :source.sync="scope.row"
  725. @paste.native="
  726. pasteMe($event, scope, scope.rowIndex, tabName)
  727. "
  728. >
  729. </component>
  730. </template>
  731. <template slot="bidPrice1" slot-scope="scope">
  732. <component
  733. v-bind="scope.attr"
  734. v-model="scope.row[scope.item.key]"
  735. :size="$attrs.size"
  736. :source.sync="scope.row"
  737. @paste.native="
  738. pasteMe($event, scope, scope.rowIndex, tabName)
  739. "
  740. >
  741. </component>
  742. </template>
  743. <template slot="unitPrice1" slot-scope="scope">
  744. <component
  745. v-bind="scope.attr"
  746. v-model="scope.row[scope.item.key]"
  747. :size="$attrs.size"
  748. :source.sync="scope.row"
  749. @paste.native="
  750. pasteMe($event, scope, scope.rowIndex, tabName)
  751. "
  752. >
  753. </component>
  754. </template>
  755. <template slot="supplierName2" slot-scope="scope">
  756. <component
  757. v-bind="scope.attr"
  758. v-model="scope.row[scope.item.key]"
  759. :size="$attrs.size"
  760. :source.sync="scope.row"
  761. @paste.native="
  762. pasteMe($event, scope, scope.rowIndex, tabName)
  763. "
  764. >
  765. </component>
  766. </template>
  767. <template slot="bidPrice2" slot-scope="scope">
  768. <component
  769. v-bind="scope.attr"
  770. v-model="scope.row[scope.item.key]"
  771. :size="$attrs.size"
  772. :source.sync="scope.row"
  773. @paste.native="
  774. pasteMe($event, scope, scope.rowIndex, tabName)
  775. "
  776. >
  777. </component>
  778. </template>
  779. <template slot="unitPrice2" slot-scope="scope">
  780. <component
  781. v-bind="scope.attr"
  782. v-model="scope.row[scope.item.key]"
  783. :size="$attrs.size"
  784. :source.sync="scope.row"
  785. @paste.native="
  786. pasteMe($event, scope, scope.rowIndex, tabName)
  787. "
  788. >
  789. </component>
  790. </template>
  791. <template slot="customerName" slot-scope="scope">
  792. <component
  793. v-bind="scope.attr"
  794. v-model="scope.row[scope.item.key]"
  795. :size="$attrs.size"
  796. :source.sync="scope.row"
  797. @input="changeCustomerName({ ...scope, selectData: $event })"
  798. >
  799. </component>
  800. </template>
  801. <ux-table-column fixed="right" label="操作" width="100">
  802. <template slot="header" slot-scope="scope">
  803. <el-button :size="$attrs.size" @click="onRowAdd(tabName)">
  804. 新增
  805. </el-button>
  806. </template>
  807. <template slot-scope="scope">
  808. <el-button
  809. :size="$attrs.size"
  810. @click.native.prevent="onRowRemove(tabName, scope)"
  811. >
  812. 删除
  813. </el-button>
  814. </template>
  815. </ux-table-column>
  816. </el-super-ux-table>
  817. </div>
  818. </el-tab-pane>
  819. </el-tabs>
  820. </el-drawer>
  821. </el-button>
  822. </template>
  823. <style scoped></style>