index.vue 25 KB

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