output.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  1. <template>
  2. <!-- 原材料消耗盈亏 -->
  3. <div class="processAndRawMaterials">
  4. <div class="box">
  5. <div class="box-top">
  6. <el-form
  7. style="overflow: hidden;"
  8. :style="filterForm.show ? null : { height: '0px' }"
  9. size="mini"
  10. label-width="70px"
  11. >
  12. <el-row>
  13. <el-col :span="6">
  14. <el-form-item label="月份">
  15. <zj-timegran-date
  16. v-model="filterForm.data.clock"
  17. style="width: 100%;"
  18. :timegranId="'MONTH'"
  19. :oneFoo="getTableData"
  20. ></zj-timegran-date>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :span="4">
  24. <el-form-item label="产品名称">
  25. <el-select
  26. filterable
  27. collapse-tags
  28. v-model="filterForm.data.productid"
  29. placeholder=""
  30. style="width: 100%;"
  31. >
  32. <el-option
  33. v-for="item of nameObj.productid.arr"
  34. :key="item.id"
  35. :value="item.id"
  36. :label="item.name"
  37. ></el-option>
  38. </el-select>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :span="5">
  42. <el-form-item label="工序">
  43. <el-select
  44. filterable
  45. collapse-tags
  46. v-model="filterForm.data.workprocid"
  47. placeholder=""
  48. style="width: 100%;"
  49. >
  50. <el-option
  51. v-for="item of nameObj.workprocid.arr"
  52. :key="item.id"
  53. :value="item.id"
  54. :label="item.name"
  55. ></el-option>
  56. </el-select>
  57. </el-form-item>
  58. </el-col>
  59. </el-row>
  60. </el-form>
  61. <div class="box-top-gjl">
  62. <el-checkbox
  63. v-show="tableData.length > 0"
  64. v-model="filterForm.checked"
  65. @change="handleChecked"
  66. style="margin-left: 7px;"
  67. >盘盈亏操作</el-checkbox>
  68. <div style="float:right; text-align: right;">
  69. <!-- <span v-show="difference" style="margin-left: 5px; color: #f56c6c;" v-if="filterForm.checked">根据库存量推算:{{ difference < 0 ? '不需要均摊': '需要均摊'+ difference.toFixed(2)}}</span> -->
  70. <el-button
  71. class="button"
  72. type="primary"
  73. size="mini"
  74. icon="el-icon-search"
  75. v-privilege="activeMenu + 'QUERY'"
  76. @click="getTableData(1)"
  77. >查询</el-button>
  78. <el-button
  79. size="mini"
  80. :icon="filterForm.show ? 'el-icon-caret-top' : 'el-icon-caret-bottom'"
  81. :title="filterForm.show ? '收起搜索区' : '展开搜索区'"
  82. @click="filterForm.show = !filterForm.show;
  83. $nextTick(() => {
  84. singleTableHeight = getRoleHeight($refs['singleTable'].$el) - 45;
  85. }
  86. );"
  87. >{{ filterForm.show ? '收起' : '展开' }}</el-button>
  88. </div>
  89. </div>
  90. </div>
  91. <div class="box-bottom">
  92. <el-form
  93. size="mini"
  94. ref="dialog_form_arr"
  95. label-width="0px"
  96. :model="tableFormDataObj"
  97. >
  98. <el-table stripe
  99. id="singleTable"
  100. ref="singleTable"
  101. :data="tableData"
  102. v-loading="tableLoading"
  103. style="width: 100%;"
  104. :height="filterForm.checked ? '500px' :singleTableHeight"
  105. border
  106. size="mini"
  107. highlight-current-row
  108. show-summary
  109. :summary-method="getSummaries">
  110. >
  111. <!-- <el-table-column
  112. sortable
  113. type="selection"
  114. width="40"
  115. align="center"
  116. fixed="left"
  117. >
  118. </el-table-column> -->
  119. <el-table-column
  120. sortable
  121. prop="seq"
  122. width="70px"
  123. label="序号"
  124. align="center"
  125. fixed="left"
  126. v-if="filterForm.seqshow"
  127. >
  128. </el-table-column>
  129. <el-table-column
  130. sortable
  131. prop="timegranid"
  132. width="70px"
  133. label="timegranid"
  134. align="center"
  135. fixed="left"
  136. v-if="filterForm.seqshow"
  137. >
  138. </el-table-column>
  139. <el-table-column
  140. sortable
  141. prop="clock"
  142. label="时间"
  143. min-width="100px"
  144. :show-overflow-tooltip="true"
  145. align="center"
  146. ></el-table-column>
  147. <el-table-column
  148. sortable
  149. prop="itemid"
  150. label="项目编号"
  151. min-width="100px"
  152. align="center"
  153. :show-overflow-tooltip="true"
  154. ></el-table-column>
  155. <el-table-column
  156. sortable
  157. prop="workprocid"
  158. label="工序"
  159. align="center"
  160. min-width="100px"
  161. :show-overflow-tooltip="true"
  162. >
  163. <template slot-scope="scope">
  164. <span>{{ nameObj.workprocid.obj[scope.row.workprocid] ? nameObj.workprocid.obj[scope.row.workprocid] : scope.row.workprocid }}</span>
  165. </template>
  166. </el-table-column>
  167. <el-table-column
  168. sortable
  169. prop="productid"
  170. label="产品"
  171. align="center"
  172. min-width="100px"
  173. :show-overflow-tooltip="true"
  174. >
  175. <template slot-scope="scope">
  176. <span>{{ nameObj.productid.obj[scope.row.productid] ? nameObj.productid.obj[scope.row.productid] : scope.row.productid }}</span>
  177. </template>
  178. </el-table-column>
  179. <el-table-column
  180. sortable
  181. prop="apportvalue"
  182. label="生产量"
  183. align="center"
  184. min-width="150px"
  185. :show-overflow-tooltip="true"
  186. >
  187. </el-table-column>
  188. <el-table-column
  189. sortable
  190. prop="jtz"
  191. label="盈亏量"
  192. align="center"
  193. min-width="150px"
  194. :show-overflow-tooltip="true"
  195. >
  196. <template slot-scope="scope">
  197. <el-form-item
  198. v-if="filterForm.checked && scope.row.apportvalue != 0"
  199. :prop="scope.row.seq +'.jtz'"
  200. >
  201. <el-input
  202. style="width: 100%;"
  203. v-model="tableFormDataObj[scope.row.seq].jtz"
  204. ></el-input>
  205. </el-form-item>
  206. <span v-else>{{scope.row.jtz}}</span>
  207. </template>
  208. </el-table-column>
  209. <el-table-column
  210. sortable
  211. prop="unitid"
  212. label="单位"
  213. min-width="100px"
  214. align="center"
  215. :show-overflow-tooltip="true"
  216. >
  217. <template slot-scope="scope">
  218. <span>{{ nameObj.unitid.obj[scope.row.unitid] ? nameObj.unitid.obj[scope.row.unitid] : scope.row.unitid }}</span>
  219. </template>
  220. </el-table-column>
  221. </el-table>
  222. </el-form>
  223. <!-- <el-pagination
  224. layout="total, sizes, prev, pager, next, jumper"
  225. :total="total"
  226. :page-sizes="[10, 20, 50, 100, 500, 1000]"
  227. :page-size="pageSize"
  228. :current-page.sync="pageNum"
  229. @size-change="tableSizeChange"
  230. @current-change="getTableData()"
  231. style="text-align: right;margin-top: 10px;"
  232. ></el-pagination> -->
  233. <div class="box-xh" v-if="filterForm.checked">
  234. <el-form
  235. style="margin-left: 630px;"
  236. size="mini"
  237. label-width="100px"
  238. >
  239. <!-- <el-row>
  240. <el-col :span="8">
  241. <el-form-item label="">
  242. <span style="margin-left: 20px;">根据库存量推算:{{difference}}</span>
  243. </el-form-item>
  244. </el-col>
  245. </el-row> -->
  246. <el-row>
  247. <el-col :span="6">
  248. <el-form-item label="盈亏量:">
  249. <el-input clearable
  250. v-model="filterForm.data.kcl"
  251. placeholder=""
  252. ></el-input>
  253. </el-form-item>
  254. </el-col>
  255. <el-col :span="6">
  256. <el-button
  257. class="button"
  258. type="primary"
  259. size="mini"
  260. icon="el-icon-refresh"
  261. @click="againCount2()"
  262. >自动均摊</el-button>
  263. </el-col>
  264. <el-col :span="2">
  265. <el-button
  266. class="button"
  267. type="primary"
  268. size="mini"
  269. icon="el-icon-save"
  270. @click="but_more()"
  271. >保存</el-button>
  272. </el-col>
  273. </el-row>
  274. </el-form>
  275. </div>
  276. </div>
  277. </div>
  278. </div>
  279. </template>
  280. <script>
  281. import timegranDate from '~/components/zg/timegranDate.vue'
  282. import {formatDate, XtcommonSummaries} from '@/utils/util.js';
  283. export default {
  284. name: 'processAndRawMaterials',
  285. components: {
  286. 'zj-timegran-date': timegranDate
  287. },
  288. data () {
  289. return {
  290. activeMenu: '',
  291. filterForm: {
  292. show: true,
  293. checked: false,
  294. seqshow: false,
  295. difference: 0,
  296. data: {
  297. timegranid: '',
  298. clock: '',
  299. productid: '',
  300. workprocid: '',
  301. itemid: '',
  302. kcl: ''
  303. },
  304. rules: {
  305. }
  306. },
  307. pageNum: 1,
  308. pageSize: 20,
  309. total: 0,
  310. singleTableHeight: 0,
  311. tableData: [
  312. // {
  313. // clock: '',
  314. // itemid: '010000C001R',
  315. // timegranid: '',
  316. // workprocid: '球团',
  317. // materialid: '混合矿',
  318. // actualvalue: '0',
  319. // correctvalue: '0',
  320. // apportvalue: '0',
  321. // stdvalue: '0',
  322. // sumvalue: '0',
  323. // ucvalue: '0',
  324. // sumucvalue: '0',
  325. // unitid: '吨',
  326. // bz: ''
  327. // }
  328. ],
  329. nameObj: {
  330. timegranid: {
  331. obj: {},
  332. arr: []
  333. },
  334. productid: {
  335. obj: {
  336. //'CP010':{name:'白灰粉'}
  337. },
  338. arr: [
  339. //{id:'CP010',name:'白灰粉'}
  340. ]
  341. },
  342. workprocid: {
  343. obj: {},
  344. arr: []
  345. },
  346. unitid: {
  347. obj: {},
  348. arr: []
  349. }
  350. },
  351. loading: false,
  352. tableLoading: false,
  353. dialog: {
  354. editorBox: {
  355. show: false,
  356. type: '',
  357. form: {
  358. data: {
  359. clock: '',
  360. itemid: '',
  361. timegranid: '',
  362. actualvalue: '',
  363. correctvalue: '',
  364. apportvalue: '',
  365. kcl: ''
  366. },
  367. rules: {
  368. }
  369. }
  370. }
  371. },
  372. multipleSelection: [],
  373. tableFormDataObj: {}
  374. }
  375. },
  376. created () {
  377. this.activeMenu = window.localStorage.getItem('activeMenu');
  378. },
  379. mounted () {
  380. let that = this;
  381. window.PEDataObj = {
  382. // 将数据绑定到window上,供main页面使用
  383. vm: that,
  384. // tableArr:用于导出成Excel的表格的信息
  385. tableArr: [
  386. {
  387. name: '',
  388. id: 'singleTable'
  389. }
  390. ]
  391. };
  392. that.$nextTick(() => {
  393. // 立即获取的height有一定偏差,通过setTimeout延迟来解决
  394. setTimeout(() => {
  395. that.singleTableHeight = that.getRoleHeight(that.$refs['singleTable'].$el) - 45;
  396. }, 1);
  397. });
  398. //接收路由参数
  399. // if (that.$route.query.workprocid == 'jc') {
  400. // that.nameObj.workprocid = {
  401. // obj:{
  402. // 'AT3011':{
  403. // name: '1#回转窑'
  404. // },
  405. // 'AT3012': {
  406. // name: '2#回转窑'
  407. // }
  408. // },
  409. // arr:[
  410. // {id:'AT3011', name:'1#回转窑'},
  411. // {id:'AT3012', name:'2#回转窑'}
  412. // ]
  413. // }
  414. // that.filterForm.data.workprocid ='AT3011';
  415. // }
  416. // if(that.$route.query.workprocid == 'jj'){
  417. // that.nameObj.workprocid = {
  418. // obj:{
  419. // 'AT2017':{
  420. // name: '炼焦'
  421. // }
  422. // },
  423. // arr:[
  424. // {id:'AT2017', name:'炼焦'}
  425. // ]
  426. // }
  427. // that.filterForm.data.workprocid ='AT2017';
  428. // }
  429. if (that.$route.query.productid) {
  430. that.filterForm.data.productid = that.$route.query.productid;
  431. }
  432. if(that.$route.query.workprocid){
  433. console.log(that.$route.query.workprocid);
  434. that.filterForm.data.workprocid = that.$route.query.workprocid;
  435. }
  436. that.getTimeGranData();
  437. that.getProductIdData();
  438. that.getWorkprocIdData();
  439. that.getUnitIdData();
  440. //that.getTableData();
  441. },
  442. methods: {
  443. // 计算树区域高度
  444. getRoleHeight (dom) {
  445. return window.innerHeight - dom.offsetTop;
  446. },
  447. // 自定义的表格合计方法:只给指定列进行合计
  448. getSummaries (param) {
  449. let that = this;
  450. const prop = ['actualvalue', 'correctvalue', 'apportvalue', 'jtz']; // 合计列绑定的prop
  451. let sum = XtcommonSummaries(param, prop);
  452. that.difference = sum[4] - sum[5];
  453. that.filterForm.data.kcl = sum[5];
  454. return XtcommonSummaries(param, prop);
  455. },
  456. // 获取时间粒度(工序与原材料数据维护)
  457. getTimeGranData () {
  458. let that = this
  459. let url = 'pass/ems/v1/tcmdatasourcetimegrans/getTimegranRmWorkprocMaterialValue';
  460. that.axios.get(url)
  461. .then(function (res) {
  462. if (res.code === '0') {
  463. let arr = [];
  464. let obj = {};
  465. for (let item of res.data) {
  466. arr.push({
  467. id: item.ID,
  468. name: item.NAME
  469. })
  470. obj[item.ID] = item.NAME;
  471. that.filterForm.data.timegranid = that.filterForm.data.timegranid ? that.filterForm.data.timegranid : item.ID;
  472. }
  473. that.nameObj.timegranid.arr = arr;
  474. that.nameObj.timegranid.obj = obj;
  475. } else {
  476. that.$message.error(res.message);
  477. }
  478. });
  479. },
  480. // 获取产品
  481. getProductIdData () {
  482. let that = this
  483. let url = 'pass/ems/v1/trmproducts/getDataForPk'
  484. let params = {
  485. productid: that.filterForm.data.productid
  486. };
  487. that.axios.get(url,{
  488. params: params
  489. })
  490. .then(function (res) {
  491. if (res.code === '0') {
  492. let arr = [];
  493. let obj = {};
  494. for (let item of res.data) {
  495. arr.push({
  496. id: item.id,
  497. name: item.name
  498. })
  499. obj[item.id] = item.name;
  500. }
  501. that.nameObj.productid.arr = arr;
  502. that.nameObj.productid.obj = obj;
  503. //that.filterForm.data.productid = that.nameObj.productid.arr[0].id;
  504. } else {
  505. that.$message.error(res.message);
  506. }
  507. });
  508. },
  509. // 获取工序(产出)
  510. getWorkprocIdData () {
  511. let that = this
  512. let params = {
  513. workprocid: that.filterForm.data.workprocid
  514. };
  515. let url = 'pass/ems/v1/trmworkprocs/getDataForPk';
  516. that.axios.get(url,{
  517. params: params
  518. })
  519. .then(function (res) {
  520. if (res.code === '0') {
  521. let arr = [];
  522. let obj = {};
  523. for (let item of res.data) {
  524. arr.push({
  525. id: item.id,
  526. name: item.name
  527. })
  528. obj[item.id] = item.name;
  529. }
  530. that.nameObj.workprocid.arr = arr;
  531. that.nameObj.workprocid.obj = obj;
  532. that.filterForm.data.workprocid = that.nameObj.workprocid.arr[0].id;
  533. } else {
  534. that.$message.error(res.message);
  535. }
  536. });
  537. },
  538. //是否选中
  539. handleChecked(val){
  540. let that = this;
  541. if (val) {
  542. that.againCount();
  543. }else {
  544. that.getTableData();
  545. that.tableFormDataObj = {};
  546. }
  547. },
  548. // 获取标准计量单位
  549. getUnitIdData () {
  550. let that = this
  551. let url = 'pass/ems/v1/trmunits/getIdAndName';
  552. that.axios.get(url)
  553. .then(function (res) {
  554. if (res.code === '0') {
  555. let arr = [];
  556. let obj = {};
  557. for (let item of res.data) {
  558. arr.push({
  559. id: item.id,
  560. name: item.name
  561. })
  562. obj[item.id] = item.name;
  563. if (item.name === '吨') {
  564. that.nameObj.unitid.defaults = that.nameObj.unitid.defaults ? that.nameObj.unitid.defaults : item.id;
  565. }
  566. }
  567. that.nameObj.unitid.arr = arr;
  568. that.nameObj.unitid.obj = obj;
  569. } else {
  570. that.$message.error(res.message);
  571. }
  572. });
  573. },
  574. //先把消耗值为0或者为空的剔除掉
  575. againCount(){
  576. let that = this;
  577. let tableFormDataObj = {};
  578. // for (let item of that.tableData) {
  579. // let obj = {};
  580. // let xId = item.itemid;
  581. // if(item.apportvalue != 0){
  582. // if (that.tableFormDataObj[xId]) {
  583. // tableFormDataObj[xId] = that.tableFormDataObj[xId];
  584. // }
  585. // else {
  586. // for (let key in item) {
  587. // obj[key] = item[key];
  588. // }
  589. // tableFormDataObj[xId] = obj;
  590. // }
  591. // }
  592. // }
  593. for (let item of that.tableData) {
  594. let obj = {};
  595. let xId = item.seq;
  596. if(item.apportvalue != 0){
  597. if (that.tableFormDataObj[xId]) {
  598. tableFormDataObj[xId] = that.tableFormDataObj[xId];
  599. }
  600. else {
  601. for (let key in item) {
  602. obj[key] = item[key];
  603. }
  604. tableFormDataObj[xId] = obj;
  605. }
  606. }
  607. }
  608. that.tableFormDataObj = tableFormDataObj;
  609. },
  610. //自由均摊
  611. againCount2(){
  612. let that =this;
  613. let ids = [];
  614. for(let i = 0; i < that.tableData.length; i++){
  615. if(that.tableFormDataObj[that.tableData[i].seq]){
  616. ids.push({
  617. id:i
  618. })
  619. }
  620. }
  621. let lengths = ids.length;
  622. var sum = 0;
  623. for(let i = 0; i < lengths; i++){
  624. if(i === (lengths-1)){
  625. let ys = that.floatComputed(that.filterForm.data.kcl,sum,"-");
  626. that.tableData[ids[i].id].jtz = ys.toFixed(4);
  627. }
  628. else {
  629. let avgvalue = (that.filterForm.data.kcl/lengths).toFixed(4);//that.floatComputed(that.filterForm.data.kcl,lengths,"/");
  630. that.tableData[ids[i].id].jtz = avgvalue;
  631. sum += that.floatComputed(avgvalue,0,"+");
  632. }
  633. that.tableFormDataObj = {};
  634. that.againCount();
  635. }
  636. },
  637. // 获取表格中的数据
  638. getTableData (pageNum) {
  639. let that = this;
  640. let params = {};
  641. params = {
  642. timegranid: that.filterForm.data.timegranid,
  643. clock: that.filterForm.data.clock,
  644. productid: that.filterForm.data.productid.toString(),
  645. workprocid: that.filterForm.data.workprocid.toString(),
  646. };
  647. that.pageNum = pageNum || that.pageNum;
  648. that.tableLoading = true;
  649. let url = 'pass/ems/v1/trmworkprocproductvalues/getpkdata';
  650. that.axios.get(url, {
  651. params: params
  652. })
  653. .then(function (res) {
  654. if (res.code === '0') {
  655. let arr = [];
  656. for (let i = 0; i < res.data.list.length; i++) {
  657. let item = res.data.list[i];
  658. arr.push({
  659. seq: item.ITEMID+item.CLOCK,
  660. clock: item.CLOCK,
  661. itemid: item.ITEMID,
  662. timegranid: item.TIMEGRANID,
  663. workprocid: item.WORKPROCID,
  664. productid: item.PRODUCTID,
  665. actualvalue: item.ACTUALVALUE,
  666. correctvalue: item.CORRECTVALUE,
  667. apportvalue: item.APPORTVALUE,
  668. jtz:item.JTZ,
  669. stdvalue: item.stdvalue,
  670. sumvalue: item.SUMVALUE,
  671. ucvalue: item.UCVALUE,
  672. sumucvalue: item.SUMUCVALUE,
  673. unitid: item.UNITID,
  674. bz: item.BZ
  675. })
  676. }
  677. that.tableData = arr;
  678. that.total = res.data.total;
  679. that.filterForm.checked = false;
  680. } else {
  681. that.$message.error(res.message);
  682. }
  683. that.tableLoading = false;
  684. }).catch(function () {
  685. that.tableLoading = false;
  686. });
  687. },
  688. // 改变表格显示条数
  689. tableSizeChange (val) {
  690. let that = this;
  691. that.pageSize = val;
  692. that.getTableData(1);
  693. },
  694. // 重置搜索
  695. tableDataCancel () {
  696. let that = this;
  697. that.filterForm.data.timegranid = '';
  698. that.filterForm.data.clock = '';
  699. that.filterForm.data.workprocid = '';
  700. that.filterForm.data.materialid = '';
  701. that.filterForm.data.itemid = '';
  702. that.getTableData(1);
  703. },
  704. but_edit (row) {
  705. let that = this;
  706. that.dialog.editorBox.form.data.itemid = row.itemid;
  707. that.dialog.editorBox.form.data.clock = row.clock;
  708. that.dialog.editorBox.form.data.timegranid = row.timegranid;
  709. that.dialog.editorBox.form.data.actualvalue = row.actualvalue;
  710. that.dialog.editorBox.form.data.correctvalue = row.correctvalue;
  711. that.dialog.editorBox.form.data.apportvalue = row.apportvalue;
  712. that.dialog.editorBox.type = 'edit';
  713. that.dialog.editorBox.show = true;
  714. },
  715. // 修改多条数据
  716. but_more () {
  717. let that = this;
  718. let url = 'pass/ems/v1/trmworkprocproductvalues/updatecc';
  719. let submitData = [];
  720. for (let item in that.tableFormDataObj) {
  721. submitData.push({
  722. itemid: that.tableFormDataObj[item].itemid,
  723. clock: that.tableFormDataObj[item].clock,
  724. timegranid: that.tableFormDataObj[item].timegranid,
  725. jtz: that.tableFormDataObj[item].jtz
  726. })
  727. }
  728. that.axios.put(url, submitData)
  729. .then(function (res) {
  730. if (res.code === '0') {
  731. that.$message({
  732. message: '保存成功',
  733. type: 'success'
  734. });
  735. that.filterForm.checked = false;
  736. that.getTableData();
  737. } else {
  738. that.$message.error(res.message);
  739. }
  740. that.loading = false;
  741. }).catch(function () {
  742. that.loading = false;
  743. });
  744. }
  745. }
  746. }
  747. function sortNumber (a, b) {
  748. return a - b
  749. }
  750. </script>
  751. <style lang="less">
  752. .processAndRawMaterials {
  753. min-width: 700px;
  754. height: 100%;
  755. .box {
  756. height: 100%;
  757. padding: 15px 15px 0 15px;
  758. .box-top {
  759. .el-form-item {
  760. margin-bottom: 7px;
  761. }
  762. .box-top-gjl {
  763. overflow: hidden;
  764. // margin-top: -7px;
  765. padding: 7px 0;
  766. border-top: 1px solid #ccc;
  767. // border-bottom: 1px solid #ccc;
  768. // margin-bottom: 6px;
  769. }
  770. }
  771. }
  772. .el-table__body .el-form-item--mini.el-form-item {
  773. margin: 0px;
  774. .error {
  775. overflow: hidden;
  776. color: #f56c6c;
  777. font-size: 12px;
  778. line-height: 1;
  779. }
  780. }
  781. }
  782. .box-xh {
  783. min-width: 700px;
  784. height: 100px;
  785. text-align: center;
  786. }
  787. </style>