material.vue 31 KB

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