SurplusMaterials.vue 32 KB

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