index.vue 25 KB

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