batchJobBom.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901
  1. <template>
  2. <view>
  3. <!-- 单个报工 -->
  4. <view class="title_box rx-bc">
  5. <view class="name">报工信息</view>
  6. </view>
  7. <view class="material">
  8. <view class="content_table">
  9. <!-- <view class="item rx-sc">
  10. <view class="rx ">
  11. <view class="lable lable150 rx-cc ">报工数量</view>
  12. <view class="content">
  13. {{ tableData.length || 0 }}
  14. </view>
  15. </view>
  16. </view> -->
  17. <view class="item rx-sc">
  18. <view class="rx ww55">
  19. <view class="lable lable150 rx-cc">要求生产数量</view>
  20. <view class="content rx-sc">
  21. <view>{{ item.formingNum }}</view>
  22. <view class="unit">{{ item.unit }}</view>
  23. </view>
  24. </view>
  25. <view class="rx ww45">
  26. <view class="lable rx-cc ww80">重量</view>
  27. <view class="content content_num">
  28. <view>{{ item.formingWeight }}</view>
  29. <view class="unit">{{ item.weightUnit }}</view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="item rx-sc">
  34. <view class="rx ww55">
  35. <view class="lable lable150 rx-cc">合格品数量</view>
  36. <view class="content content_num">
  37. <input
  38. class="uni-input"
  39. v-model="item.workReportInfo.formedNum"
  40. :disabled="isDetails"
  41. @input="blurNum(item.workReportInfo)"
  42. type="digit"
  43. />
  44. <view class="unit">{{ item.unit }}</view>
  45. </view>
  46. </view>
  47. <view class="rx ww45">
  48. <view class="lable rx-cc ww80">重量</view>
  49. <view class="content content_num">
  50. <input
  51. class="uni-input"
  52. v-model="item.workReportInfo.formedWeight"
  53. type="digit"
  54. :disabled="isDetails"
  55. />
  56. <view class="unit">{{ item.weightUnit }}</view>
  57. </view>
  58. </view>
  59. </view>
  60. <!-- <view
  61. class="item rx-sc"
  62. v-for="(not, notIndex) in notFormedList"
  63. :key="notIndex"
  64. >
  65. <view class="rx ww55">
  66. <view class="lable lable150 rx-cc">不合格数量</view>
  67. <view class="content content_num">
  68. <input
  69. class="uni-input"
  70. v-model="item.workReportInfo.notFormedNum"
  71. type="digit"
  72. :disabled="isDetails"
  73. v-if="isDetails"
  74. @input="changeNum"
  75. />
  76. <input
  77. class="uni-input"
  78. v-model="not.notFormedNum"
  79. type="number"
  80. v-else
  81. @input="changeNum(not)"
  82. />
  83. <view class="unit">{{ item.unit }}</view>
  84. </view>
  85. </view>
  86. <view class="rx ww45">
  87. <view class="lable rx-cc ww80">重量</view>
  88. <view class="content content_num">
  89. <input
  90. class="uni-input"
  91. v-model="item.workReportInfo.notFormedWeight"
  92. type="digit"
  93. :disabled="isDetails"
  94. v-if="isDetails"
  95. />
  96. <input
  97. class="uni-input"
  98. v-model="not.notFormedWeight"
  99. type="digit"
  100. :disabled="isDetails"
  101. v-else
  102. />
  103. <view class="unit">{{ item.weightUnit }}</view>
  104. </view>
  105. </view>
  106. </view> -->
  107. <view class="item rx-sc">
  108. <view class="rx ww55">
  109. <view class="lable lable150 rx-cc">不合格数量</view>
  110. <view class="content content_num">
  111. <!-- //详情 -->
  112. <input
  113. class="uni-input"
  114. v-model="item.workReportInfo.notFormedNum"
  115. type="digit"
  116. :disabled="isDetails"
  117. @input="changeNum"
  118. />
  119. <view class="unit">{{ item.unit }}</view>
  120. </view>
  121. </view>
  122. <view class="rx ww45">
  123. <view class="lable rx-cc ww80">重量</view>
  124. <view class="content content_num">
  125. <input
  126. class="uni-input"
  127. v-model="item.workReportInfo.notFormedWeight"
  128. type="digit"
  129. :disabled="isDetails"
  130. />
  131. <view class="unit">{{ item.weightUnit }}</view>
  132. </view>
  133. </view>
  134. </view>
  135. <view class="item rx-sc">
  136. <view class="rx ww55">
  137. <view class="lable lable150 rx-cc">报工备注</view>
  138. <view class="content content_num" style="width: 100%">
  139. <input
  140. class="uni-input"
  141. v-model="item.workReportInfo.remark"
  142. :disabled="isDetails"
  143. type="text"
  144. />
  145. </view>
  146. </view>
  147. <!-- v-if="clientEnvironmentId==2" -->
  148. <view class="rx ww45" v-if="clientEnvironmentId == 2">
  149. <view class="lable ww80 rx-cc">批次号</view>
  150. <view class="content content_num" style="width: 100%">
  151. {{ item.batchNo }}
  152. <input
  153. class="uni-input"
  154. v-model="batchNo"
  155. @input="batchNoNew"
  156. :disabled="isDetails"
  157. type="text"
  158. />
  159. </view>
  160. </view>
  161. <!-- 不是首工序展示这个按钮 -->
  162. <view
  163. class="unit-btn"
  164. @click="singleBatch"
  165. v-if="
  166. item.currentTaskDiagram &&
  167. item.currentTaskDiagram.isFirstTask == 1 &&
  168. clientEnvironmentId != 3
  169. "
  170. >确认</view
  171. >
  172. <view
  173. class="unit-btn"
  174. @click="singleBatchTg"
  175. v-if="
  176. item.currentTaskDiagram &&
  177. item.currentTaskDiagram.isFirstTask == 1 &&
  178. clientEnvironmentId == 3
  179. "
  180. >确认</view
  181. >
  182. </view>
  183. </view>
  184. <view class="content_table">
  185. <batchProductJobBom
  186. v-if="
  187. item.product &&
  188. item.product.length &&
  189. item.currentTaskDiagram.type != 4 &&
  190. item.currentTaskDiagram.type != 6 &&
  191. item.singleReport == 0
  192. "
  193. :item="item"
  194. :list="item.product"
  195. :equipmentList="item.equipmentList"
  196. @countNumPl="countNumPl"
  197. >
  198. </batchProductJobBom>
  199. <batchProductJobBom
  200. v-if="
  201. item.product &&
  202. item.product.length &&
  203. item.currentTaskDiagram &&
  204. (item.currentTaskDiagram.type == 2 ||
  205. item.currentTaskDiagram.type == 3 ||
  206. item.currentTaskDiagram.type == 6) &&
  207. item.singleReport == 0
  208. "
  209. :item="item"
  210. :list="item.product"
  211. :equipmentList="item.equipmentList"
  212. @countNumPl="countNumPl"
  213. >
  214. </batchProductJobBom>
  215. </view>
  216. </view>
  217. </view>
  218. </template>
  219. <script>
  220. import {
  221. createInProductBatch,
  222. createInProductBatchTG,
  223. } from "@/api/pda/jobBooking.js";
  224. // import checkboxTable from '../componentsTable/checkbox/checkbox.vue'
  225. import batchProductJobBom from "./batchProductJobBom.vue";
  226. import semiProductJobBomPL from "./semiProductJobBomPL.vue";
  227. import { parameterGetByCode } from "@/api/mainData/index.js";
  228. export default {
  229. props: {
  230. item: {
  231. type: Object,
  232. default: () => {},
  233. },
  234. notFormed: {
  235. type: Array,
  236. default: () => [],
  237. },
  238. isDetails: {
  239. type: Boolean,
  240. default: false,
  241. },
  242. currentTask: {
  243. type: Object,
  244. default: () => {},
  245. },
  246. },
  247. watch: {
  248. notFormed: {
  249. immediate: true,
  250. deep: true,
  251. handler(newVal) {
  252. this.notFormedList = newVal;
  253. },
  254. },
  255. item: {
  256. immediate: true,
  257. deep: true,
  258. handler(newVal) {
  259. console.log(newVal, "newVal");
  260. if (newVal.product && newVal.product.length != 0) {
  261. let formedNum = 0;
  262. let notFormedNum = 0;
  263. newVal.product.forEach((item) => {
  264. if (
  265. !item.extInfo.isQualified ||
  266. item.extInfo.isQualified == 1 ||
  267. item.extInfo.isQualified == 3
  268. ) {
  269. formedNum = formedNum + Number(item.feedQuantity);
  270. } else {
  271. notFormedNum = notFormedNum + Number(item.feedQuantity);
  272. }
  273. });
  274. console.log("合格数量:" + formedNum, "不合格数量:" + notFormedNum);
  275. this.$set(this.item.workReportInfo, "formedNum", formedNum);
  276. this.$set(this.item.workReportInfo, "notFormedNum", notFormedNum);
  277. // console.log(this.item.workReportInfo);
  278. this.item.workReportInfo = this.deepCopy(this.item.workReportInfo);
  279. this.$forceUpdate();
  280. }
  281. // if (!this.currentTaskDiagram.isFirstTask) {
  282. // this.getSemiProductList(newVal);
  283. // }
  284. },
  285. },
  286. },
  287. components: { semiProductJobBomPL, batchProductJobBom },
  288. data() {
  289. return {
  290. forValue: {},
  291. tableData: [],
  292. batchNo: "",
  293. notFormedList: [],
  294. clientEnvironmentId:
  295. uni.getStorageSync("userInfo") &&
  296. uni.getStorageSync("userInfo").clientEnvironmentId, // *1 主环境-601环境 2 soll-索尔环境 3 tg-碳谷环境
  297. };
  298. },
  299. created() {
  300. console.log(this.item, "item1313");
  301. // this.item.product = this.item.pickOutInList;
  302. let newList = [];
  303. if (
  304. this.item.pickOutInList.length != 0 &&
  305. this.item.product.length == 0 &&
  306. this.item.currentTaskDiagram.type == 6
  307. ) {
  308. this.item.pickOutInList.forEach((item) => {
  309. const data = this.deepCopy(item);
  310. newList.push(data);
  311. });
  312. this.$set(this.item, "product", newList);
  313. }
  314. // this.item.product.push(...newList);
  315. // console.log(this.item.product, "this.item.product");
  316. // this.item.pickOutInList = [];
  317. // this.$set(this.item, "product", ...newList);
  318. // this.$set(this.item, "pickOutInList", []);
  319. // }
  320. if (this.isDetails) {
  321. this.notFormedList = this.notFormedList.map((m) => {
  322. return {
  323. notFormedNum: Number(m.quantity),
  324. notFormedWeight: m.weight,
  325. ...m,
  326. };
  327. });
  328. }
  329. this.getByCode();
  330. },
  331. methods: {
  332. tableDataFn(tableData) {
  333. console.log(tableData);
  334. let adultCount = 0;
  335. let noAdultCount = 0;
  336. this.arrDataStatistics(tableData);
  337. tableData.forEach((v) => {
  338. if (v.selected) {
  339. console.log(11111);
  340. if (v.extInfo.isQualified == 1) {
  341. adultCount += 1;
  342. } else {
  343. noAdultCount += 1;
  344. }
  345. }
  346. });
  347. this.$set(this.item.workReportInfo, "formedNum", adultCount);
  348. this.$set(this.notFormedList[0], "notFormedNum", noAdultCount);
  349. // this.tableData = this.notFormedList;
  350. if (!(this.clientEnvironmentId == 3 || this.item.singleReport !== 1)) {
  351. this.item.semiProductList = tableData;
  352. }
  353. },
  354. deepCopy(obj, hash = new WeakMap()) {
  355. if (obj === null) return null;
  356. if (obj instanceof Date) return new Date(obj);
  357. if (obj instanceof RegExp) return new RegExp(obj);
  358. if (typeof obj !== "object" && typeof obj !== "function") return obj;
  359. if (hash.has(obj)) return hash.get(obj);
  360. const result = Array.isArray(obj) ? [] : {};
  361. hash.set(obj, result);
  362. return Object.keys(obj).reduce((acc, key) => {
  363. acc[key] = this.deepCopy(obj[key], hash);
  364. return acc;
  365. }, result);
  366. },
  367. arrDataStatistics(arr) {
  368. console.log(arr);
  369. const adultCount = arr.filter(
  370. (user) => user.extInfo.isQualified == 1
  371. ).length;
  372. const noAdultCount = arr.filter(
  373. (user) => user.extInfo.isQualified !== 1
  374. ).length;
  375. console.log(adultCount, noAdultCount);
  376. this.$set(this.item.workReportInfo, "formedNum", adultCount);
  377. this.$set(this.notFormedList[0], "notFormedNum", noAdultCount);
  378. },
  379. getByCode() {
  380. parameterGetByCode({ code: "enable_quality_plus" }).then((res) => {
  381. if (
  382. res.value == "1" &&
  383. (this.item.currentTaskDiagram.type == 6 ||
  384. this.item.currentTaskDiagram.type == 2 ||
  385. this.item.currentTaskDiagram.type == 2)
  386. ) {
  387. uni.showModal({
  388. title: "提示",
  389. content: "质检需要去PC端进行",
  390. success: function (res) {
  391. if (res.confirm) {
  392. console.log("用户点击确定");
  393. } else if (res.cancel) {
  394. console.log("用户点击取消");
  395. }
  396. },
  397. });
  398. }
  399. });
  400. },
  401. getSemiProductList(newVal) {
  402. console.log(newVal);
  403. if (newVal.semiProductList.length) {
  404. newVal.semiProductList.map((v) => {
  405. v.selected = true;
  406. });
  407. this.arrDataStatistics(newVal.semiProductList);
  408. this.tableData = newVal.semiProductList;
  409. }
  410. if (newVal.pickOutInList.length) {
  411. newVal.pickOutInList.map((v) => {
  412. v.selected = true;
  413. });
  414. this.arrDataStatistics(newVal.pickOutInList);
  415. this.tableData = newVal.pickOutInList;
  416. }
  417. },
  418. singleBatch() {
  419. console.log(this.item.workReportInfo, "11111111");
  420. if (!this.item.workReportInfo.formedNum)
  421. return uni.showToast({
  422. icon: "none",
  423. title: "请输入合格品数",
  424. });
  425. if (
  426. this.notFormedList[0].notFormedNum == "" ||
  427. this.notFormedList[0].notFormedNum == null
  428. )
  429. return uni.showToast({
  430. icon: "none",
  431. title: "请输入不合格品数",
  432. });
  433. const req = {
  434. formedNum: this.item.workReportInfo.formedNum,
  435. notFormedNum: this.notFormedList[0].notFormedNum,
  436. taskId: this.item.workReportInfo.taskId,
  437. workOrderId: this.item.workReportInfo.workOrderId,
  438. };
  439. createInProductBatch(req).then((res) => {
  440. if (res && res.length) {
  441. this.forValue = res[0];
  442. res.map((v) => {
  443. v.selected = true;
  444. });
  445. this.tableData = res;
  446. this.item.product = res;
  447. console.log(this.item);
  448. }
  449. });
  450. },
  451. singleBatchTg() {
  452. if (!this.item.workReportInfo.formedNum)
  453. return uni.showToast({
  454. icon: "none",
  455. title: "请输入合格品数",
  456. });
  457. if (
  458. this.notFormedList[0].notFormedNum == "" ||
  459. this.notFormedList[0].notFormedNum == null
  460. )
  461. return uni.showToast({
  462. icon: "none",
  463. title: "请输入不合格品数",
  464. });
  465. const req = {
  466. formedNum: this.item.workReportInfo.formedNum,
  467. notFormedNum: this.notFormedList[0].notFormedNum,
  468. taskId: this.item.workReportInfo.taskId,
  469. workOrderId: this.item.workReportInfo.workOrderId,
  470. };
  471. createInProductBatchTG(req).then((res) => {
  472. if (res && res.length) {
  473. this.forValue = res[0];
  474. res.map((v) => {
  475. v.selected = true;
  476. });
  477. this.tableData = res;
  478. this.item.product = res;
  479. }
  480. });
  481. },
  482. /**
  483. * 更新批次号
  484. *
  485. * @param e 事件对象
  486. */
  487. batchNoNew(e) {
  488. this.item.workReportInfo.batchNo = this.item.batchNo + e.target.value;
  489. },
  490. setFormedNum(num) {
  491. this.item.workReportInfo.formedNum = num;
  492. let weight =
  493. Number(this.item.workReportInfo.formedNum) *
  494. Number(this.item.singleWeight) *
  495. Number(this.item.weightMultiple);
  496. if (["G", "g", "克"].includes(this.item.singleWeightUnit)) {
  497. weight = parseFloat((weight / 1000).toFixed(2));
  498. } else {
  499. weight = parseFloat(weight.toFixed(2));
  500. }
  501. this.$set(this.item.workReportInfo, "formedWeight", weight);
  502. this.$forceUpdate();
  503. },
  504. penalize() {
  505. this.$emit("penalize", null);
  506. },
  507. handleView(name) {
  508. uni.showToast({
  509. icon: "none",
  510. title: name || "未设置",
  511. });
  512. },
  513. blurNum(value) {
  514. let total = 0;
  515. //匹配非数字
  516. let val = value.formedNum;
  517. let reg = new RegExp("([^0-9]*)", "g");
  518. let ma = val.match(reg);
  519. //如果有非数字,替换成""
  520. if (ma.length > 0) {
  521. for (let k in ma) {
  522. if (ma[k] != "") {
  523. val = val.replace(ma[k], 0);
  524. }
  525. }
  526. }
  527. //可以为0,但不能以0开头
  528. if (val.startsWith("0") && val.length > 1) {
  529. val = val.substring(1, val.length);
  530. }
  531. value.formedNum = val;
  532. if (this.item.currentTaskDiagram.isFirstTask) {
  533. // formingNum 生产数量 feedQuantity this.item.product[0] //投料数量
  534. if (value.formedNum > this.item.formingNum) {
  535. this.$set(
  536. this.item.workReportInfo,
  537. "workReportInfo",
  538. this.item.formingNum
  539. );
  540. this.$set(this.notFormedList[0], "notFormedNum", 0);
  541. this.notForme();
  542. return uni.showToast({
  543. icon: "none",
  544. title: "合格品数量不能大于要求生产数量",
  545. });
  546. }
  547. } else {
  548. if (this.item.product.length) {
  549. const feedNumber = this.item.product.reduce((acc, pre) => {
  550. return pre.feedQuantity ? acc + Number(pre.feedQuantity) : acc;
  551. }, 0);
  552. console.log(this.item, "this.item.product");
  553. if (value.formedNum > feedNumber) {
  554. this.$set(this.item.workReportInfo, "formedNum", feedNumber);
  555. this.$set(this.notFormedList[0], "notFormedNum", 0);
  556. return uni.showToast({
  557. icon: "none",
  558. title: "合格品数量不能大于投料数量",
  559. });
  560. }
  561. // if (value.formedNum > this.item.product[0].feedQuantity) {
  562. // console.log(this.item.product[0].feedQuantity);
  563. // this.$set(
  564. // this.item.workReportInfo,
  565. // "workReportInfo",
  566. // this.item.product[0].feedQuantity
  567. // );
  568. // this.$set(this.notFormedList[0], "notFormedNum", 0);
  569. // this.notForme();
  570. // return uni.showToast({
  571. // icon: "none",
  572. // title: "合格品数量不能大于投料数量",
  573. // });
  574. // }
  575. }
  576. }
  577. console.log(
  578. Number(this.item.workReportInfo.formedNum),
  579. "Number(this.item.workReportInfo.feedQuantity)"
  580. );
  581. console.log(Number(value.formedNum), "Number(value.formedNum)");
  582. if (
  583. this.item.product[0] &&
  584. this.item.product[0].feedQuantity > 0 &&
  585. Number(this.item.workReportInfo.formedNum)
  586. ) {
  587. console.log("555555");
  588. this.$set(
  589. this.notFormedList[0],
  590. "notFormedNum",
  591. Number(value.formedNum) - Number(this.item.workReportInfo.formedNum)
  592. );
  593. this.notForme();
  594. }
  595. let weight =
  596. Number(this.item.workReportInfo.formedNum) *
  597. Number(this.item.singleWeight) *
  598. Number(this.item.weightMultiple);
  599. if (["G", "g", "克"].includes(this.item.singleWeightUnit)) {
  600. weight = parseFloat((weight / 1000).toFixed(2));
  601. } else {
  602. weight = parseFloat(weight.toFixed(2));
  603. }
  604. this.$set(this.item.workReportInfo, "formedWeight", weight);
  605. total =
  606. Number(this.item.workReportInfo.formedNum) +
  607. Number(this.notFormedList[0].notFormedNum);
  608. console.log(total);
  609. this.$emit("modeNum", total);
  610. this.$forceUpdate();
  611. },
  612. notForme() {
  613. let weight =
  614. Number(this.notFormedList[0].notFormedNum) *
  615. Number(this.item.singleWeight) *
  616. Number(this.item.weightMultiple);
  617. if (
  618. this.item.singleWeightUnit == "G" ||
  619. this.item.singleWeightUnit == "g" ||
  620. this.item.singleWeightUnit == "克"
  621. ) {
  622. weight = parseFloat((weight / 1000).toFixed(2));
  623. } else {
  624. weight = parseFloat(weight.toFixed(2));
  625. }
  626. this.$set(this.notFormedList[0], "notFormedWeight", weight);
  627. // if (
  628. // this.item.product[0] &&
  629. // this.item.product[0].feedQuantity > 0 &&
  630. // Number(this.notFormedList[0].notFormedNum)
  631. // ) {
  632. // this.$set(
  633. // this.item.workReportInfo,
  634. // "formedNum",
  635. // this.item.product[0].feedQuantity -
  636. // Number(this.notFormedList[0].notFormedNum)
  637. // );
  638. // let weight =
  639. // Number(this.item.workReportInfo.formedNum) *
  640. // Number(this.item.singleWeight) *
  641. // Number(this.item.weightMultiple);
  642. // if (
  643. // this.item.singleWeightUnit == "G" ||
  644. // this.item.singleWeightUnit == "g" ||
  645. // this.item.singleWeightUnit == "克"
  646. // ) {
  647. // weight = parseFloat((weight / 1000).toFixed(2));
  648. // } else {
  649. // weight = parseFloat(weight.toFixed(2));
  650. // }
  651. // this.$set(this.item.workReportInfo, "formedWeight", weight);
  652. // }
  653. this.$forceUpdate();
  654. },
  655. changeNum(value) {
  656. // 不合格数量
  657. let val = value.notFormedNum;
  658. //匹配非数字
  659. let reg = new RegExp("([^0-9]*)", "g");
  660. let ma = val.match(reg);
  661. //如果有非数字,替换成""
  662. if (ma.length > 0) {
  663. for (let k in ma) {
  664. if (ma[k] != "") {
  665. val = val.replace(ma[k], "0");
  666. }
  667. }
  668. }
  669. //可以为0,但不能以0开头
  670. if (val.startsWith("0") && val.length > 1) {
  671. val = val.substring(1, val.length);
  672. }
  673. // this.$set(this.item.workReportInfo, 'formedNum', val)
  674. value.notFormedNum = val;
  675. console.log(Number(this.item.workReportInfo.formedNum), 1);
  676. console.log(Number(this.notFormedList[0].notFormedNum), 2);
  677. let total =
  678. Number(this.item.workReportInfo.formedNum) +
  679. Number(this.notFormedList[0].notFormedNum);
  680. console.log(total);
  681. this.$emit("modeNum", total);
  682. this.notForme();
  683. // this.blurNum()
  684. },
  685. },
  686. };
  687. </script>
  688. <style lang="scss" scoped>
  689. .unit-btn {
  690. background-color: #157a2c;
  691. height: 48rpx;
  692. padding: 0 20rpx;
  693. line-height: 48rpx;
  694. color: #fff;
  695. }
  696. .content_num {
  697. display: flex;
  698. align-items: center;
  699. padding: 0 4rpx;
  700. font-size: 26rpx !important;
  701. /deep/ .uni-input-input {
  702. border: 2rpx solid #f0f8f2;
  703. background: #f0f8f2;
  704. color: $theme-color;
  705. }
  706. }
  707. .item {
  708. display: flex;
  709. justify-content: space-between;
  710. }
  711. .title_box {
  712. margin-top: 20rpx;
  713. .name {
  714. font-size: 28rpx;
  715. font-style: normal;
  716. font-weight: 400;
  717. color: $theme-color;
  718. padding-left: 20rpx;
  719. position: relative;
  720. &:before {
  721. position: absolute;
  722. content: "";
  723. left: 0rpx;
  724. top: 0rpx;
  725. bottom: 0rpx;
  726. width: 4rpx;
  727. height: 28rpx;
  728. background: $theme-color;
  729. margin: auto;
  730. }
  731. }
  732. }
  733. .material {
  734. margin-top: 10rpx;
  735. .content_table {
  736. width: 100%;
  737. border: 2rpx solid $border-color;
  738. .item {
  739. display: flex;
  740. border-bottom: 2rpx solid $border-color;
  741. .lable {
  742. width: 132rpx;
  743. text-align: center;
  744. background-color: #f7f9fa;
  745. font-size: 26rpx;
  746. border-right: 2rpx solid $border-color;
  747. flex-shrink: 0;
  748. }
  749. .lable220 {
  750. width: 220rpx !important;
  751. font-size: 24rpx;
  752. }
  753. .lable150 {
  754. width: 156rpx !important;
  755. font-size: 24rpx;
  756. }
  757. .ww80 {
  758. width: 80rpx;
  759. }
  760. .content {
  761. width: 518rpx;
  762. min-height: 64rpx;
  763. font-size: 28rpx;
  764. line-height: 28rpx;
  765. font-style: normal;
  766. font-weight: 400;
  767. padding: 18rpx 8rpx;
  768. box-sizing: border-box;
  769. word-wrap: break-word;
  770. flex-grow: 1 !important;
  771. .unit {
  772. padding: 0 4rpx;
  773. font-size: 24rpx;
  774. color: #404446;
  775. }
  776. .penalize {
  777. width: 160rpx;
  778. line-height: 60rpx;
  779. background: $theme-color;
  780. font-size: 24rpx;
  781. text-align: center;
  782. color: #fff;
  783. }
  784. }
  785. .pd4 {
  786. padding: 4rpx 8rpx;
  787. }
  788. &:last-child {
  789. border-bottom: none;
  790. }
  791. }
  792. .ww55 {
  793. width: 55%;
  794. }
  795. .ww45 {
  796. width: 45%;
  797. }
  798. }
  799. }
  800. </style>