index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888
  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. count:0,
  33. params: {
  34. ...initParams(NewColumns),
  35. puOrderItemList: [],
  36. puOrderExecuteList: [],
  37. },
  38. tabColumns: NewTabColumns,
  39. tabName: "puOrderItemList",
  40. isCopy:false,
  41. };
  42. },
  43. computed: {},
  44. watch: {
  45. "params.puOrderItemList": {
  46. handler(nVal, oVal) {
  47. this.visible &&
  48. this.handleSynchronousMaterial(
  49. "puOrderItemList",
  50. "puOrderExecuteList"
  51. );
  52. },
  53. deep: true,
  54. },
  55. "params.puOrderExecuteList": {
  56. handler(nVal, oVal) {
  57. this.visible &&
  58. this.handleSynchronousMaterial(
  59. "puOrderExecuteList",
  60. "puOrderItemList"
  61. );
  62. },
  63. deep: true,
  64. },
  65. "params.billType":{
  66. handler(nVal, oVal){
  67. if((nVal === '21-Cxx-02' || nVal === '21-Cxx-04' || nVal === '21-Cxx-10')){
  68. this.rules.warehouseName = [
  69. { required: true, message: "WMS入库仓库不能为空", trigger: "change" },
  70. ];
  71. this.rules.goodsAllocationName = [
  72. { required: true, message: "货位不能为空", trigger: "change" },
  73. ];
  74. }else{
  75. this.rules.warehouseName = null;
  76. this.rules.goodsAllocationName = null;
  77. }
  78. this.count++;
  79. }
  80. }
  81. },
  82. methods: {
  83. beforeOpen() {
  84. if(!this.isCopy){
  85. const { deptName, deptId, name, nickName, orgName, orgId } = this.$store.state.user;
  86. this.params.puOrg = orgId;
  87. this.params.puOrgName = orgName;
  88. this.params.buyer = name;
  89. this.params.buyerName = nickName;
  90. this.params.puDept = deptId;
  91. this.params.puDeptName = deptName;
  92. this.params.billDate = new Date().Format('yyyy-MM-dd');
  93. console.log(this.params,'this.params');
  94. // this.addTableRow();
  95. }
  96. },
  97. setVisible(prop,iscopy) {
  98. this.visible = prop;
  99. this.isCopy = iscopy;
  100. if(!this.visible){
  101. this.$refs['orderAddForm'].clearValidate();
  102. }
  103. },
  104. // 复制赋值
  105. async setCopyParams(id) {
  106. try {
  107. this.loading = true;
  108. const { code, msg, data } = await orderApi.details(id);
  109. if (code === 200) {
  110. this.params = {
  111. ...data,
  112. id: "",
  113. code: "",
  114. isEnd:'N',
  115. status: "0",
  116. source: "3",
  117. isClose:'N',
  118. billDate: new Date().Format('yyyy-MM-dd'),
  119. closeTime:'',
  120. oaDemandNo:'',
  121. isInvoice:'N',
  122. isSendWms:'N',
  123. rebateMoney:'',
  124. invoiceMoney:'',
  125. paymentMoney:'',
  126. applyPaymentMoney:'',
  127. erpOrderCode:'',
  128. };
  129. for (const key in this.params) {
  130. // if (Array.isArray(this.params[key])) {
  131. if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
  132. this.params[key].forEach((v) => {
  133. v.id = "";
  134. v.demandCode = "";
  135. v['isInvoice'] && (v['isInvoice'] = 'N');
  136. v['isStorage'] && (v['isStorage'] = 'N');
  137. v['isArrival'] && (v['isArrival'] = 'N');
  138. v['isPayment'] && (v['isPayment'] = 'N');
  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.$notify.error({
  230. title: '错误',
  231. message: '请填写订单行!'
  232. });
  233. return false;
  234. }
  235. // puOrderItemList
  236. let isPrice = this.params.puOrderItemList.filter(item => !item.whetherCompleteInquiry);
  237. if(isPrice.length){
  238. this.$notify.error({
  239. title: '错误',
  240. message: '询价失败!'
  241. });
  242. return false
  243. }
  244. console.log(isPrice,'isPrice');
  245. cb();
  246. } else {
  247. this.$notify.error({
  248. title: '错误',
  249. message: '存在必填项未填写'
  250. });
  251. console.log('error submit!!');
  252. return false;
  253. }
  254. });
  255. },
  256. // 保存
  257. handleSava() {
  258. console.log(this.params,'this.params---------');
  259. this.judgeSaveCondition(async()=>{
  260. try {
  261. this.loading = true;
  262. const { code, msg } = await orderApi.create(this.params);
  263. if (code === 200) {
  264. this.handleCancel();
  265. }
  266. } catch (err) {
  267. //
  268. } finally {
  269. this.loading = false;
  270. }
  271. })
  272. },
  273. // 主表参照改变之后
  274. async handleReferChange(val, type, source){
  275. // 供应商选择
  276. if( type === 'SUPPLIER_PARAM' ){
  277. let page = { pageNum: 1 , pageSize: 10 };
  278. let relevanceRefer = [
  279. {
  280. // 供应商联系人
  281. key:'supplierContacts',
  282. params:{
  283. type:'SUPPLIERCONTACTS_PARAM',
  284. supplierId:val.id,
  285. }
  286. },
  287. {
  288. // 供应商业务员
  289. key:'supplierPersonal',
  290. params:{
  291. type:'PSNLICENSE_PARAM',
  292. supplierId:val.id,
  293. pkOrg: source.puOrg,
  294. }
  295. }
  296. ]
  297. await relevanceRefer.forEach(async (refer) =>{
  298. try {
  299. const { code, rows} = await orderApi.REFER(
  300. {
  301. ...refer.params,
  302. search: "",
  303. isPage: true,
  304. }, page );
  305. if (code === 200) {
  306. source[refer.key] = rows[0]? rows[0].id :'';
  307. source[`${refer.key}Name`] = rows[0] ? rows[0].name :'';
  308. }
  309. } catch (error) {}
  310. })
  311. // 明细不为空的情况下进行询价
  312. let detailList = this.params['puOrderItemList'].filter(item => (
  313. item.material && item.material != ''
  314. ))
  315. if(detailList.length){
  316. this.params['puOrderItemList'] = this.params['puOrderItemList'].map(item => {
  317. item['whetherCompleteInquiry'] = false
  318. return item;
  319. });
  320. await this.handleGetPrice();
  321. }
  322. }
  323. // 组织
  324. if(type === 'ORG_PARAM'){
  325. for (const key in this.params) {
  326. // if (Array.isArray(this.params[key])) {
  327. if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
  328. this.params[key] = [];
  329. }
  330. else if(key === 'sysFileRecordList'){
  331. this.params[key] = [];
  332. }
  333. else if (
  334. key != "puOrg" &&
  335. key != "puOrgName" &&
  336. key != "buyer" &&
  337. key != "buyerName" &&
  338. key != "puDept" &&
  339. key != "puDeptName" &&
  340. key != "status" &&
  341. key != "billDate"
  342. ) {
  343. this.params[key] = "";
  344. } else {
  345. }
  346. }
  347. }
  348. },
  349. // 下拉框选择改变
  350. handleSelectChange(val,typeName){
  351. if(val === 'billType'){
  352. this.params['billTypeName'] = this.dict.type[typeName].find(item => item.value == this.params[val]).label;
  353. }
  354. },
  355. // 子表参照改变之后
  356. async handleTabReferChange(val, type, source) {
  357. // 触发物料参照询价
  358. if (type == "MATERIAL_PARAM" && source.qty && source.qty != "") {
  359. source['qty'] = 0;
  360. source['whetherCompleteInquiry'] = false;
  361. source['taxPrice'] = 0;
  362. source['money'] = 0;
  363. source['taxDeductMoneya'] = 0;
  364. source['price'] = 0;
  365. source['notaxMoney'] = 0;
  366. source['tax'] = 0;
  367. this.params['qty'] = 0;
  368. this.params['originalQty'] = 0;
  369. this.params['money'] = 0;
  370. this.params['originalMoney'] = 0;
  371. this.params['notaxMoney'] = 0;
  372. source.isDrug = val.materialMedcine.isDrug == '0' ? 'Y' : 'N';
  373. // await this.handleGetPrice();
  374. }
  375. },
  376. // 子表下拉框改变
  377. async handleTabSelectChange(type,row){
  378. if(type == 'priceType' && row.material && row.qty && row.qty != ""){
  379. row['whetherCompleteInquiry'] = false;
  380. await this.handleGetPrice();
  381. }
  382. },
  383. // 子表inputNumber
  384. handleInputChange(row, type) {
  385. // 物料数量变化----询价
  386. if (type == "qty" && row.material) {
  387. row['whetherCompleteInquiry'] = false;
  388. row.qty && this.handleGetPrice();
  389. }
  390. },
  391. // 子表多选框改变
  392. handleTabCheckbox(type,source){
  393. // 勾选赠品,价税合计更新为0,含税单价、无税单价更新为0
  394. if(type === 'isGift' && source.material && source.qty && source.qty != ""){
  395. source['whetherCompleteInquiry'] = false;
  396. this.handleGetPrice()
  397. }
  398. },
  399. // 询价 getPrice
  400. async handleGetPrice() {
  401. try {
  402. // action:insert(新增)、revise(修订)、update(编辑)
  403. let { code, data } = await orderApi.getPrice({ ...this.params,action: 'insert' });
  404. if (code == 200) {
  405. this.params = data;
  406. }
  407. } catch (error) {}
  408. },
  409. async handelImport(fileList){
  410. try {
  411. let formData = new FormData();
  412. formData.append('file',fileList[0].raw);
  413. this.$modal.loading("正在上传文件,请稍候...");
  414. let {code,data} = await orderApi.orderImport(formData);
  415. if(code == 200) {
  416. // puOrderExecuteList puOrderItemList
  417. for (const key in data) {
  418. // this.params[key] = data[key];
  419. this.params[key].push(...data[key]);
  420. }
  421. let {setVisible} = this.$refs.batchImport;
  422. setVisible(false);
  423. this.handleGetPrice();
  424. }
  425. } catch (error) {
  426. }finally{
  427. this.$modal.closeLoading();
  428. }
  429. },
  430. async handleTemDownload(){
  431. this.download('/pu/order/downloadFailData',{}, `物料信息模板${new Date().getTime()}.xlsx`);
  432. },
  433. },
  434. created() {
  435. console.log("ADD CREATED", this.params);
  436. },
  437. mounted() {},
  438. destroyed() {},
  439. };
  440. </script>
  441. <template>
  442. <el-drawer
  443. direction="btt"
  444. size="100%"
  445. :with-header="false"
  446. :visible.sync="visible"
  447. @open="beforeOpen"
  448. @close="$emit('close')"
  449. v-loading="loading"
  450. >
  451. <el-form
  452. size="mini"
  453. label-position="right"
  454. ref="orderAddForm"
  455. label-width="140px"
  456. :model="params"
  457. :rules="rules"
  458. :key="count"
  459. >
  460. <el-card
  461. :body-style="{
  462. padding: '20px',
  463. display: 'flex',
  464. 'flex-wrap': 'wrap',
  465. }"
  466. style="margin: 10px"
  467. >
  468. <div
  469. slot="header"
  470. style="
  471. display: flex;
  472. justify-content: space-between;
  473. align-items: center;
  474. "
  475. >
  476. <h3>新增</h3>
  477. <div style="text-align: right">
  478. <el-button
  479. size="mini"
  480. type="primary"
  481. @click="handleSava"
  482. >保存</el-button>
  483. <el-button size="mini" @click="handleCancel">取消</el-button>
  484. </div>
  485. </div>
  486. <el-row style="display: flex; flex-wrap: wrap">
  487. <el-col
  488. v-for="(column, index) in columns"
  489. :key="index"
  490. :span="column.span || 6"
  491. >
  492. <el-form-item
  493. :prop="column.key"
  494. :label="column.title"
  495. v-if="column.isShow"
  496. >
  497. <el-input
  498. v-if="column.inputType === 'Input'"
  499. v-model="params[column.key]"
  500. :placeholder="column.placeholder"
  501. :clearable="column.clearable"
  502. :disabled="column.disabled"
  503. style="width: 100%;"
  504. >
  505. </el-input>
  506. <dr-popover-select
  507. v-if="column.inputType === 'PopoverSelect'"
  508. v-model="params[column.key]"
  509. :value-key="column.valueKey"
  510. :source.sync="params"
  511. :title="column.title"
  512. :type="column.referName"
  513. :disabled="column.disabled"
  514. :multiple="column.multiple"
  515. :placeholder="column.placeholder"
  516. :data-mapping="column.dataMapping"
  517. :query-params="column.queryParams"
  518. @change="handleReferChange"
  519. ></dr-popover-select>
  520. <el-input
  521. v-if="column.inputType === 'Textarea'"
  522. v-model="params[column.key]"
  523. type="textarea"
  524. :placeholder="column.placeholder"
  525. :clearable="column.clearable"
  526. :disabled="column.disabled"
  527. style="width: 100%"
  528. ></el-input>
  529. <el-input-number
  530. v-if="column.inputType === 'InputNumber'"
  531. v-model="params[column.key]"
  532. :precision="column.precision"
  533. :controls-position="column.controlsPosition"
  534. :placeholder="column.placeholder"
  535. :clearable="column.clearable"
  536. :disabled="column.disabled"
  537. style="width: 100%"
  538. >
  539. </el-input-number>
  540. <el-select
  541. v-if="column.inputType === 'Select'"
  542. v-model="params[column.key]"
  543. :disabled="column.disabled"
  544. :clearable="column.clearable"
  545. :placeholder="column.placeholder"
  546. style="width: 100%"
  547. @change="handleSelectChange(column.key,column.referName)"
  548. >
  549. <el-option
  550. v-for="item in dict.type[column.referName]"
  551. :key="item.value"
  552. :label="item.label"
  553. :value="item.value"
  554. ></el-option>
  555. </el-select>
  556. <el-select
  557. v-if="column.inputType === 'TagSelect'"
  558. v-model="params[column.key]"
  559. multiple
  560. clearable
  561. collapse-tags
  562. :placeholder="column.placeholder"
  563. :clearable="column.clearable"
  564. :disabled="column.disabled"
  565. style="width: 100%"
  566. >
  567. <template #prefix>
  568. <el-icon
  569. class="el-icon-view"
  570. style="cursor: pointer"
  571. @click.stop="$message.info(234)"
  572. >
  573. </el-icon>
  574. </template>
  575. <el-option
  576. v-for="item in options"
  577. :key="item.value"
  578. :label="item.label"
  579. :value="item.value"
  580. ></el-option>
  581. </el-select>
  582. <el-date-picker
  583. v-if="column.inputType === 'DatePicker'"
  584. v-model="params[column.key]"
  585. :type="column.type"
  586. :placeholder="column.placeholder"
  587. :clearable="column.clearable"
  588. :disabled="column.disabled"
  589. :picker-options="column.pickerOptions"
  590. style="width: 100%"
  591. ></el-date-picker>
  592. <el-checkbox
  593. v-if="column.inputType === 'Checkbox'"
  594. v-model="params[column.key]"
  595. :disabled="column.disabled"
  596. true-label="Y"
  597. false-label="N"
  598. ></el-checkbox>
  599. <file-upload-center
  600. v-if="column.inputType === 'Upload'"
  601. v-model="params[column.key]"
  602. :file-type="column.fileType"
  603. ></file-upload-center>
  604. </el-form-item>
  605. </el-col>
  606. </el-row>
  607. </el-card>
  608. <el-card
  609. :body-style="{
  610. padding: '20px',
  611. display: 'flex',
  612. 'flex-wrap': 'wrap',
  613. position: 'relative',
  614. }"
  615. style="margin: 10px"
  616. >
  617. <el-tabs v-model="tabName" style="width: 100%">
  618. <el-tab-pane
  619. v-for="(column, index) in tabColumns"
  620. :key="index"
  621. :label="column.title"
  622. :name="column.key"
  623. >
  624. <el-table
  625. :data="params[column.key]"
  626. style="width: 100%"
  627. :height="params[column.key].length ? 300 : 100"
  628. border
  629. >
  630. <el-table-column
  631. v-for="(cColumn, cIndex) in column.tableColumns"
  632. :key="cIndex"
  633. :label="cColumn.title"
  634. :width="cColumn.width || 80"
  635. >
  636. <template slot="header" slot-scope="scope">
  637. <span v-if="cColumn.require" style="color: #ff4949">*</span>
  638. <span>
  639. {{ cColumn.title }}
  640. </span>
  641. </template>
  642. <template slot-scope="scope">
  643. <el-form-item
  644. label-width="0"
  645. :prop="`${column.key}.${scope.$index}.${[cColumn.key]}`"
  646. :rules="{ required: cColumn.require || false, message: `${cColumn.title}不能为空`, trigger: 'change' }"
  647. >
  648. <el-tag v-if="cColumn.key === 'index'" >
  649. {{ scope.$index + 1 }}
  650. </el-tag>
  651. <el-input
  652. v-if="cColumn.inputType === 'Input'"
  653. v-model="scope.row[cColumn.key]"
  654. :placeholder="cColumn.placeholder"
  655. :clearable="cColumn.clearable"
  656. :disabled="cColumn.disabled"
  657. size="mini"
  658. style="width: 100%"
  659. ></el-input>
  660. <!-- -->
  661. <dr-popover-select
  662. v-if="cColumn.inputType === 'PopoverSelect'"
  663. v-model="scope.row[cColumn.key]"
  664. :source.sync="scope.row"
  665. :title="cColumn.title"
  666. :value-key="cColumn.valueKey"
  667. :type="cColumn.referName"
  668. :disabled="cColumn.disabled"
  669. :multiple="cColumn.multiple"
  670. :placeholder="cColumn.placeholder"
  671. :data-mapping="cColumn.dataMapping"
  672. :query-params="cColumn.queryParams"
  673. @change="handleTabReferChange"
  674. size="mini"
  675. >
  676. </dr-popover-select>
  677. <el-input-number
  678. v-if="cColumn.inputType === 'InputNumber'"
  679. v-model="scope.row[cColumn.key]"
  680. :precision="cColumn.precision"
  681. :controls-position="cColumn.controlsPosition"
  682. :placeholder="cColumn.placeholder"
  683. @change="handleInputChange(scope.row, cColumn.key)"
  684. :clearable="cColumn.clearable"
  685. :disabled="cColumn.disabled"
  686. :min="cColumn.key === 'reservedQty' ? 0 : -Infinity"
  687. size="mini"
  688. style="width: 100%"
  689. ></el-input-number>
  690. <el-select
  691. v-if="cColumn.inputType === 'Select'"
  692. v-model="scope.row[cColumn.key]"
  693. size="mini"
  694. :disabled="cColumn.disabled"
  695. :clearable="cColumn.clearable"
  696. :placeholder="cColumn.placeholder"
  697. style="width: 100%"
  698. @change="handleTabSelectChange(cColumn.key,scope.row)"
  699. >
  700. <el-option
  701. v-for="item in dict.type[cColumn.referName]"
  702. :key="item.value"
  703. :label="item.label"
  704. :value="item.value"
  705. ></el-option>
  706. </el-select>
  707. <el-checkbox
  708. v-if="cColumn.inputType === 'Checkbox'"
  709. v-model="scope.row[cColumn.key]"
  710. :disabled="cColumn.disabled"
  711. true-label="Y"
  712. false-label="N"
  713. @change="handleTabCheckbox(cColumn.key,scope.row)"
  714. ></el-checkbox>
  715. </el-form-item>
  716. </template>
  717. </el-table-column>
  718. <el-table-column fixed="right" label="操作" width="80">
  719. <template slot-scope="scope">
  720. <el-button
  721. @click.native.prevent="
  722. delTableRow(params[tabName], scope.$index)
  723. "
  724. type="text"
  725. size="small"
  726. >
  727. 删行
  728. </el-button>
  729. </template>
  730. </el-table-column>
  731. </el-table>
  732. </el-tab-pane>
  733. </el-tabs>
  734. <el-row style="position: absolute; top: 20px; right: 20px">
  735. <el-button size="mini" @click="addTableRow(params[tabName])"
  736. >增行</el-button
  737. >
  738. <BatchImport
  739. ref="batchImport"
  740. @import="handelImport"
  741. @temDownload="handleTemDownload"
  742. ></BatchImport>
  743. </el-row>
  744. </el-card>
  745. </el-form>
  746. </el-drawer>
  747. </template>