singleJobBom.vue 24 KB

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