SurplusMaterials.vue 30 KB

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