material.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  1. <template>
  2. <div >
  3. <a-form-model ref="formRef">
  4. <a-table
  5. ref="table"
  6. size="middle"
  7. bordered
  8. id='sonList'
  9. :columns="columns"
  10. rowKey="rowNo"
  11. :dataSource="dataSource"
  12. :pagination="false"
  13. :scroll="{ x: 5500, y: 300 }"
  14. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  15. @change="handleTableChange"
  16. >
  17. <template slot="outsourcing" slot-scope="text, record, index">
  18. <a-form-model-item prop="outsourcing" class='sonItem'>
  19. <a-select v-model="record.outsourcing" style='width:100%' @change="changeOut" :disabled="allowEdit=='no'&&allowEditMaterial=='no'&&!record.newRow" >
  20. <a-select-option value='是'> 是</a-select-option>
  21. <a-select-option value='否'> 否</a-select-option>
  22. </a-select>
  23. </a-form-model-item>
  24. </template>
  25. <template slot="projectCode" slot-scope="text, record, index">
  26. <a-form-model-item prop="projectCode" class='sonItem'>
  27. <a-input placeholder="请输入" v-model="record.projectCode" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  28. </a-form-model-item>
  29. </template>
  30. <template slot="projectName" slot-scope="text, record, index">
  31. <a-form-model-item prop="projectName" class='sonItem'>
  32. <a-input placeholder="请输入" v-model="record.projectName" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  33. </a-form-model-item>
  34. </template>
  35. <template slot="batch" slot-scope="text, record, index">
  36. <a-form-model-item prop="batch" class='sonItem'>
  37. <a-input placeholder="请输入" v-model="record.batch" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  38. </a-form-model-item>
  39. </template>
  40. <template slot="inventoryCode" slot-scope="text, record, index">
  41. <a-form-model-item prop="inventoryCode" class='sonItem'>
  42. <a-input-search placeholder="请输入" v-model="record.inventoryCode" @search="onSearchInven(record)" readOnly ></a-input-search>
  43. </a-form-model-item>
  44. </template>
  45. <template slot="inventoryName" slot-scope="text, record, index">
  46. <a-form-model-item prop="inventoryName" class='sonItem'>
  47. <a-input placeholder="请输入" v-model="record.inventoryName" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  48. </a-form-model-item>
  49. </template>
  50. <template slot="unit" slot-scope="text, record, index">
  51. <a-form-model-item prop="unit" class='sonItem'>
  52. <a-input placeholder="请输入" v-model="record.unit" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  53. </a-form-model-item>
  54. </template>
  55. <template slot="quantity" slot-scope="text, record, index">
  56. <a-form-model-item prop="quantity" class='sonItem'>
  57. <a-input placeholder="请输入" v-model="record.quantity" :disabled="allowEdit=='no'&&!record.newRow&&!record.copied" @blur="changeQuantity(record)"></a-input>
  58. </a-form-model-item>
  59. </template>
  60. <template slot="auxiliaryUnit" slot-scope="text, record, index">
  61. <a-form-model-item prop="auxiliaryUnit" class='sonItem'>
  62. <a-input placeholder="请输入" v-model="record.auxiliaryUnit" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  63. </a-form-model-item>
  64. </template>
  65. <template slot="unQuantity" slot-scope="text, record, index">
  66. <a-form-model-item prop="unQuantity" class='sonItem'>
  67. <a-input placeholder="请输入" v-model="record.unQuantity" :disabled="allowEdit=='no'&&!record.newRow&&!record.copied" @blur="changeUQuantity(record)"></a-input>
  68. </a-form-model-item>
  69. </template>
  70. <!-- <template slot="unQuantityExecute" slot-scope="text, record, index">
  71. <a-form-model-item prop="unQuantityExecute" class='sonItem'>
  72. <a-input placeholder="请输入" v-model="record.unQuantityExecute"></a-input>
  73. </a-form-model-item>
  74. </template>
  75. <template slot="quantityExecute" slot-scope="text, record, index">
  76. <a-form-model-item prop="quantityExecute" class='sonItem'>
  77. <a-input placeholder="请输入" v-model="record.quantityExecute"></a-input>
  78. </a-form-model-item>
  79. </template> -->
  80. <template slot="specs" slot-scope="text, record, index">
  81. <a-form-model-item prop="specs" class='sonItem'>
  82. <a-input placeholder="请输入" v-model="record.specs" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  83. </a-form-model-item>
  84. </template>
  85. <template slot="model" slot-scope="text, record, index">
  86. <a-form-model-item prop="model" class='sonItem'>
  87. <a-input placeholder="请输入" v-model="record.model" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  88. </a-form-model-item>
  89. </template>
  90. <template slot="color" slot-scope="text, record, index">
  91. <a-form-model-item prop="color" class='sonItem'>
  92. <a-input placeholder="请输入" v-model="record.color" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  93. </a-form-model-item>
  94. </template>
  95. <template slot="colorStorage" slot-scope="text, record, index">
  96. <a-form-model-item prop="colorStorage" class='sonItem'>
  97. <a-input placeholder="请输入" v-model="record.colorStorage" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  98. </a-form-model-item>
  99. </template>
  100. <template slot="fixedLength" slot-scope="text, record, index">
  101. <a-form-model-item prop="fixedLength" class='sonItem'>
  102. <a-input placeholder="请输入" v-model="record.fixedLength" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  103. </a-form-model-item>
  104. </template>
  105. <template slot="alloy" slot-scope="text, record, index">
  106. <a-form-model-item prop="alloy" class='sonItem'>
  107. <a-input placeholder="请输入" v-model="record.alloy" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  108. </a-form-model-item>
  109. </template>
  110. <template slot="standard" slot-scope="text, record, index">
  111. <a-form-model-item prop="standard" class='sonItem'>
  112. <a-input placeholder="请输入" v-model="record.standard" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  113. </a-form-model-item>
  114. </template>
  115. <template slot="meterWeight" slot-scope="text, record, index">
  116. <a-form-model-item prop="meterWeight" class='sonItem'>
  117. <a-input placeholder="请输入" v-model="record.meterWeight" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  118. </a-form-model-item>
  119. </template>
  120. <template slot="decorationLength" slot-scope="text, record, index">
  121. <a-form-model-item prop="decorationLength" class='sonItem'>
  122. <a-input placeholder="请输入" v-model="record.decorationLength" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  123. </a-form-model-item>
  124. </template>
  125. <template slot="windowNo" slot-scope="text, record, index">
  126. <a-form-model-item prop="windowNo" class='sonItem'>
  127. <a-input placeholder="请输入" v-model="record.windowNo" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  128. </a-form-model-item>
  129. </template>
  130. <template slot="exclusiveZone" slot-scope="text, record, index">
  131. <a-form-model-item prop="exclusiveZone" class='sonItem'>
  132. <a-input placeholder="请输入" v-model="record.exclusiveZone" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  133. </a-form-model-item>
  134. </template>
  135. <template slot="width" slot-scope="text, record, index">
  136. <a-form-model-item prop="width" class='sonItem'>
  137. <a-input placeholder="请输入" v-model="record.width" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  138. </a-form-model-item>
  139. </template>
  140. <template slot="height" slot-scope="text, record, index">
  141. <a-form-model-item prop="height" class='sonItem'>
  142. <a-input placeholder="请输入" v-model="record.height" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  143. </a-form-model-item>
  144. </template>
  145. <template slot="buildingNumber" slot-scope="text, record, index">
  146. <a-form-model-item prop="buildingNumber" class='sonItem'>
  147. <a-input placeholder="请输入" v-model="record.buildingNumber" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  148. </a-form-model-item>
  149. </template>
  150. <template slot="framesTang" slot-scope="text, record, index">
  151. <a-form-model-item prop="framesTang" class='sonItem'>
  152. <a-input placeholder="请输入" v-model="record.framesTang" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  153. </a-form-model-item>
  154. </template>
  155. <template slot="framesCount" slot-scope="text, record, index">
  156. <a-form-model-item prop="framesCount" class='sonItem'>
  157. <a-input placeholder="请输入" v-model="record.framesCount" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  158. </a-form-model-item>
  159. </template>
  160. <template slot="leafCount" slot-scope="text, record, index">
  161. <a-form-model-item prop="leafCount" class='sonItem'>
  162. <a-input placeholder="请输入" v-model="record.leafCount" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  163. </a-form-model-item>
  164. </template>
  165. <template slot="semiClass" slot-scope="text, record, index">
  166. <a-form-model-item prop="semiClass" class='sonItem'>
  167. <a-input placeholder="请输入" v-model="record.semiClass" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  168. </a-form-model-item>
  169. </template>
  170. <template slot="area" slot-scope="text, record, index">
  171. <a-form-model-item prop="area" class='sonItem'>
  172. <a-input placeholder="请输入" v-model="record.area" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  173. </a-form-model-item>
  174. </template>
  175. <template slot="cuttingLength" slot-scope="text, record, index">
  176. <a-form-model-item prop="cuttingLength" class='sonItem'>
  177. <a-input placeholder="请输入" v-model="record.cuttingLength" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  178. </a-form-model-item>
  179. </template>
  180. <template slot="cuttingLeftDown" slot-scope="text, record, index">
  181. <a-form-model-item prop="cuttingLeftDown" class='sonItem'>
  182. <a-input placeholder="请输入" v-model="record.cuttingLeftDown" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  183. </a-form-model-item>
  184. </template>
  185. <template slot="cuttingRightTop" slot-scope="text, record, index">
  186. <a-form-model-item prop="cuttingRightTop" class='sonItem'>
  187. <a-input placeholder="请输入" v-model="record.cuttingRightTop" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  188. </a-form-model-item>
  189. </template>
  190. <template slot="remarks" slot-scope="text, record, index">
  191. <a-form-model-item prop="remarks" class='sonItem'>
  192. <a-input placeholder="请输入" v-model="record.remarks" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  193. </a-form-model-item>
  194. </template>
  195. <template slot="series" slot-scope="text, record, index">
  196. <a-form-model-item prop="series" class='sonItem'>
  197. <a-input placeholder="请输入" v-model="record.series" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  198. </a-form-model-item>
  199. </template>
  200. <template slot="glassNumber" slot-scope="text, record, index">
  201. <a-form-model-item prop="glassNumber" class='sonItem'>
  202. <a-input placeholder="请输入" v-model="record.glassNumber" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  203. </a-form-model-item>
  204. </template>
  205. <template slot="storageLocation" slot-scope="text, record, index">
  206. <a-form-model-item prop="storageLocation" class='sonItem'>
  207. <a-input placeholder="请输入" v-model="record.storageLocation" :disabled="allowEdit=='no'&&!record.newRow"></a-input>
  208. </a-form-model-item>
  209. </template>
  210. </a-table>
  211. </a-form-model>
  212. <inventoryPopup ref="inventoryPopup" @okData="okDataInvent"></inventoryPopup>
  213. </div>
  214. </template>
  215. <script>
  216. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  217. import JEllipsis from '@/components/jeecg/JEllipsis'
  218. import inventoryPopup from '../../Popup/inventoryPopup.vue'
  219. import moment from 'moment'
  220. export default {
  221. name: 'material', // Tabs 详情
  222. mixins: [JeecgListMixin],
  223. components: {
  224. JEllipsis,
  225. moment,
  226. inventoryPopup
  227. },
  228. data() {
  229. return {
  230. selectedRowKeys:[],
  231. selectedRows:[],
  232. dataSource:[],
  233. allowEdit:'yes',
  234. allowEditMaterial:'no',
  235. columns: [
  236. {
  237. title: '#',
  238. dataIndex: '',
  239. key: 'rowIndex',
  240. width: 60,
  241. align: "center",
  242. customRender:function (t, r, index) {
  243. return parseInt(index)+1;
  244. }
  245. },
  246. {
  247. title: '是否委外',
  248. align:"center",
  249. dataIndex: 'outsourcing',
  250. ellipsis: true,
  251. scopedSlots: { customRender: 'outsourcing' }
  252. },
  253. {
  254. title: '项目编码',
  255. align:"center",
  256. dataIndex: 'projectCode',
  257. ellipsis: true,
  258. // scopedSlots: { customRender: 'projectCode' }
  259. },
  260. {
  261. title: '项目名称',
  262. align:"center",
  263. dataIndex: 'projectName',
  264. ellipsis: true,
  265. // scopedSlots: { customRender: 'projectName' }
  266. },
  267. {
  268. title: '批次',
  269. align:"center",
  270. dataIndex: 'batch',
  271. ellipsis: true,
  272. scopedSlots: { customRender: 'batch' }
  273. },
  274. {
  275. title: '存货编码',
  276. align:"center",
  277. dataIndex: 'inventoryCode',
  278. ellipsis: true,
  279. scopedSlots: { customRender: 'inventoryCode' }
  280. },
  281. {
  282. title: '存货名称',
  283. align:"center",
  284. dataIndex: 'inventoryName',
  285. ellipsis: true,
  286. // scopedSlots: { customRender: 'inventoryName' }
  287. },
  288. {
  289. title: '计量单位',
  290. align:"center",
  291. dataIndex: 'unit',
  292. ellipsis: true,
  293. // scopedSlots: { customRender: 'unit' }
  294. },
  295. {
  296. title: '主数量',
  297. align:"center",
  298. dataIndex: 'quantity',
  299. ellipsis: true,
  300. scopedSlots: { customRender: 'quantity' }
  301. },
  302. {
  303. title: '辅计量单位',
  304. align:"center",
  305. dataIndex: 'auxiliaryUnit',
  306. ellipsis: true,
  307. // scopedSlots: { customRender: 'auxiliaryUnit' }
  308. },
  309. {
  310. title: '辅数量',
  311. align:"center",
  312. dataIndex: 'unQuantity',
  313. ellipsis: true,
  314. scopedSlots: { customRender: 'unQuantity' }
  315. },
  316. {
  317. title: '已执行辅数量',
  318. align:"center",
  319. dataIndex: 'unQuantityExecute',
  320. ellipsis: true,
  321. // scopedSlots: { customRender: 'unQuantityExecute' }
  322. },
  323. {
  324. title: '已执行主数量',
  325. align:"center",
  326. dataIndex: 'quantityExecute',
  327. ellipsis: true,
  328. // scopedSlots: { customRender: 'quantityExecute' }
  329. },
  330. {
  331. title: '规格',
  332. align:"center",
  333. dataIndex: 'specs',
  334. ellipsis: true,
  335. // scopedSlots: { customRender: 'specs' }
  336. },
  337. {
  338. title: '型号',
  339. align:"center",
  340. dataIndex: 'model',
  341. ellipsis: true,
  342. scopedSlots: { customRender: 'model' }
  343. },
  344. {
  345. title: '颜色',
  346. align:"center",
  347. dataIndex: 'color',
  348. ellipsis: true,
  349. scopedSlots: { customRender: 'color' }
  350. },
  351. {
  352. title: '入库颜色',
  353. align:"center",
  354. dataIndex: 'colorStorage',
  355. ellipsis: true,
  356. scopedSlots: { customRender: 'colorStorage' }
  357. },
  358. {
  359. title: '定尺',
  360. align:"center",
  361. dataIndex: 'fixedLength',
  362. ellipsis: true,
  363. scopedSlots: { customRender: 'fixedLength' }
  364. },
  365. {
  366. title: '合金',
  367. align:"center",
  368. dataIndex: 'alloy',
  369. ellipsis: true,
  370. scopedSlots: { customRender: 'alloy' }
  371. },
  372. {
  373. title: '标准',
  374. align:"center",
  375. dataIndex: 'standard',
  376. ellipsis: true,
  377. scopedSlots: { customRender: 'standard' }
  378. },
  379. {
  380. title: '米重',
  381. align:"center",
  382. dataIndex: 'meterWeight',
  383. ellipsis: true,
  384. scopedSlots: { customRender: 'meterWeight' }
  385. },
  386. {
  387. title: '装饰面周长',
  388. align:"center",
  389. dataIndex: 'decorationLength',
  390. ellipsis: true,
  391. scopedSlots: { customRender: 'decorationLength' }
  392. },
  393. {
  394. title: '窗号',
  395. align:"center",
  396. dataIndex: 'windowNo',
  397. ellipsis: true,
  398. scopedSlots: { customRender: 'windowNo' }
  399. },
  400. {
  401. title: '专用区',
  402. align:"center",
  403. dataIndex: 'exclusiveZone',
  404. ellipsis: true,
  405. scopedSlots: { customRender: 'exclusiveZone' }
  406. },
  407. {
  408. title: '宽度',
  409. align:"center",
  410. dataIndex: 'width',
  411. ellipsis: true,
  412. scopedSlots: { customRender: 'width' }
  413. },
  414. {
  415. title: '高度',
  416. align:"center",
  417. dataIndex: 'height',
  418. ellipsis: true,
  419. scopedSlots: { customRender: 'height' }
  420. },
  421. {
  422. title: '楼层楼号',
  423. align:"center",
  424. dataIndex: 'buildingNumber',
  425. ellipsis: true,
  426. scopedSlots: { customRender: 'buildingNumber' }
  427. },
  428. {
  429. title: '樘数(数量)',
  430. align:"center",
  431. dataIndex: 'framesTang',
  432. ellipsis: true,
  433. scopedSlots: { customRender: 'framesTang' }
  434. },
  435. {
  436. title: '框统计',
  437. align:"center",
  438. dataIndex: 'framesCount',
  439. ellipsis: true,
  440. scopedSlots: { customRender: 'framesCount' }
  441. },
  442. {
  443. title: '扇统计',
  444. align:"center",
  445. dataIndex: 'leafCount',
  446. ellipsis: true,
  447. scopedSlots: { customRender: 'leafCount' }
  448. },
  449. {
  450. title: '半成品分类',
  451. align:"center",
  452. dataIndex: 'semiClass',
  453. ellipsis: true,
  454. scopedSlots: { customRender: 'semiClass' }
  455. },
  456. {
  457. title: '面积',
  458. align:"center",
  459. dataIndex: 'area',
  460. ellipsis: true,
  461. scopedSlots: { customRender: 'area' }
  462. },
  463. {
  464. title: '切割长度',
  465. align:"center",
  466. dataIndex: 'cuttingLength',
  467. ellipsis: true,
  468. scopedSlots: { customRender: 'cuttingLength' }
  469. },
  470. {
  471. title: '切割角度左下',
  472. align:"center",
  473. dataIndex: 'cuttingLeftDown',
  474. ellipsis: true,
  475. scopedSlots: { customRender: 'cuttingLeftDown' }
  476. },
  477. {
  478. title: '切割角度右上',
  479. align:"center",
  480. dataIndex: 'cuttingRightTop',
  481. ellipsis: true,
  482. scopedSlots: { customRender: 'cuttingRightTop' }
  483. },
  484. {
  485. title: '备注',
  486. align:"center",
  487. dataIndex: 'remarks',
  488. ellipsis: true,
  489. scopedSlots: { customRender: 'remarks' }
  490. },
  491. {
  492. title: '系列',
  493. align:"center",
  494. dataIndex: 'series',
  495. ellipsis: true,
  496. scopedSlots: { customRender: 'series' }
  497. },
  498. {
  499. title: '玻璃编号',
  500. align:"center",
  501. dataIndex: 'glassNumber',
  502. ellipsis: true,
  503. scopedSlots: { customRender: 'glassNumber' }
  504. },
  505. {
  506. title: '换算率',
  507. align:"center",
  508. dataIndex: 'rate',
  509. ellipsis: true,
  510. },
  511. {
  512. title: '货位',
  513. align:"center",
  514. dataIndex: 'storageLocation',
  515. ellipsis: true,
  516. scopedSlots: { customRender: 'storageLocation' }
  517. },
  518. ],
  519. }
  520. },
  521. props: {
  522. },
  523. created() {},
  524. methods: {
  525. onSelectChange(selectedRowKeys, selectionRows) {
  526. this.selectedRowKeys = selectedRowKeys;
  527. this.selectedRows = selectionRows;
  528. },
  529. addList(projectCode,projectName){
  530. this.dataSource.unshift({rowNo: this.dataSource.length+1,projectCode:projectCode,projectName:projectName})
  531. },
  532. delectRow(){
  533. if( this.selectedRowKeys.length==0){
  534. this.$message.warning('请勾选子表数据!')
  535. }else{
  536. this.selectedRowKeys.map(event=>{
  537. this.dataSource = this.dataSource.filter( (x)=> {return x.rowNo !== event});
  538. })
  539. }
  540. },
  541. delecteCopyRow(){
  542. if( this.selectedRowKeys.length==0){
  543. this.$message.warning('请勾选子表数据!')
  544. }else{
  545. var delectAllow = 'yes'
  546. this.selectedRows.map(item=>{
  547. if(item.id){delectAllow = 'no'}
  548. })
  549. if(delectAllow=='no'){
  550. this.$emit('clearn')
  551. this.$message.warning('勾选数据中有不可删除数据!')
  552. }else{
  553. this.selectedRowKeys.map(event=>{
  554. this.dataSource = this.dataSource.filter( (x)=> {return x.rowNo !== event});
  555. })
  556. }
  557. }
  558. },
  559. copyRow(){
  560. if(this.selectedRowKeys.length!==1){
  561. this.$emit('clearn')
  562. this.$message.warning('请勾选一条数据!')
  563. }else{
  564. var obj ={},
  565. num = 0
  566. this.dataSource.map((item,index)=>{
  567. if(item.id== this.selectedRows[0].id){
  568. item.copied = '1'
  569. obj = {...item}
  570. obj.projectCode = '6'
  571. obj.newRow = '1'
  572. obj.id = ''
  573. num = index+1
  574. }
  575. })
  576. this.dataSource.splice(num, 0, obj);
  577. this.dataSource.map((item,index )=>{item.rowNo = index})
  578. this.selectedRows = []
  579. this.selectedRowKeys=[]
  580. }
  581. },
  582. changeOut(){
  583. if(this.allowEdit=='no'&&this.allowEditMaterial=='yes'){
  584. this.$emit('changeEdit')
  585. }
  586. },
  587. addMaterial(){
  588. this.dataSource.push({newRow:'1'})
  589. },
  590. changeQuantity(record){
  591. if(record.copied&&record.quantity&&record.quantityExecute&&(Number(record.quantity)<Number(record.quantityExecute))){
  592. record.quantity = ''
  593. this.$message.warning('主数量不可小于已执行主数量!')
  594. }
  595. },
  596. changeUQuantity(record){
  597. if(record.copied&&record.unQuantity&&record.unQuantityExecute&&(Number(record.unQuantity)<Number(record.unQuantityExecute))){
  598. record.unQuantity = ''
  599. this.$message.warning('辅数量不可小于已执行辅数量!')
  600. }
  601. },
  602. onSearchInven(record){
  603. if(this.allowEdit=='no'&&!record.newRow){
  604. this.$message.warning('不可编辑!')
  605. }else{
  606. this.$refs.inventoryPopup.visible = true
  607. this.$refs.inventoryPopup.getData()
  608. this.$refs.inventoryPopup.record=record
  609. }
  610. },
  611. okDataInvent(data,recoerd){
  612. this.$set(recoerd,'inventoryCode',data.Code)
  613. this.$set(recoerd,'inventoryName',data.Name)
  614. this.$set(recoerd,'specs',data.SPECS)
  615. this.$set(recoerd,'unit',data.unit)
  616. this.$set(recoerd,'auxiliaryUnit',data.auxiliaryUnit )
  617. },
  618. },
  619. computed: {
  620. // 合计数据
  621. // sumInfoSource() {}
  622. }
  623. }
  624. </script>
  625. <style lang="less" scoped>
  626. /* @import '~@assets/less/common.less' */
  627. /deep/.ant-input{
  628. height:29px;
  629. }
  630. /deep/.ant-select-selection--single {
  631. height: 29px;
  632. }
  633. /deep/.ant-select{
  634. font-size: 12px;
  635. }
  636. /deep/.ant-form label{
  637. font-size: 12px;
  638. }
  639. /deep/.table-page-search-wrapper .ant-form-inline .ant-form-item{
  640. margin-bottom:9px
  641. }
  642. /deep/.moddle>.ant-card-body{
  643. padding-bottom:0px;
  644. padding-top: 12px;
  645. }
  646. /deep/.top>.ant-card-body{
  647. padding-bottom:0px;
  648. padding-top: 12px;
  649. }
  650. /deep/.ant-btn{
  651. height:28px
  652. }
  653. /deep/.ant-modal-body{
  654. padding-bottom: 0px;
  655. padding-top: 0px;
  656. }
  657. // /deep/.ant-modal-body{
  658. // background: #f0f2f5;
  659. // }
  660. /deep/.ant-modal-content{
  661. background: #f0f2f5;
  662. }
  663. /deep/.ant-card-body .table-operator {
  664. margin-bottom: 0px;
  665. }
  666. /deep/.three>.ant-card-body{
  667. padding-bottom:12px;
  668. padding-top: 12px;
  669. }
  670. /deep/.bottom>.ant-card-body{
  671. padding-bottom:0px;
  672. padding-top: 12px;
  673. }
  674. /deep/.ant-calendar-picker{
  675. min-width: 0px !important;
  676. }
  677. /deep/.sonItem {
  678. margin-bottom:0px !important
  679. }
  680. /deep/#sonList>.ant-spin-nested-loading>.ant-spin-container>.ant-table>.ant-table-content>.ant-table-scroll>.ant-table-body>.ant-table-fixed>.ant-table-tbody > tr > td {
  681. padding: 0px 8px !important;
  682. }
  683. </style>