index.vue 26 KB

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