form.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896
  1. <script setup>
  2. import { ref, computed, watch, nextTick, reactive } from "vue";
  3. import { onLoad } from "@dcloudio/uni-app";
  4. import { getRuiYingReportDetail } from "@/api/ruiying";
  5. import { useDataDictStore } from "@/store/modules/dataDict";
  6. import tpfTimeRange from "@/components/tpf-time-range/tpf-time-range.vue";
  7. import dayjs from "dayjs";
  8. import { useDebounceFn } from "@/utils/useDebounceFn.js";
  9. const props = defineProps({
  10. type: {
  11. type: String,
  12. default: "edit",
  13. },
  14. });
  15. const NON_PROD_FIELDS = [
  16. { key: "repairTime", label: "设备故障" },
  17. { key: "selfStopTime", label: "设备保养" },
  18. { key: "accidentTime", label: "工程质量" },
  19. { key: "complexityTime", label: "技术受限" },
  20. { key: "rectificationTime", label: "生产组织" },
  21. { key: "waitingStopTime", label: "不可抗力" },
  22. { key: "partyaDesign", label: "甲方设计" },
  23. { key: "partyaPrepare", label: "甲方准备" },
  24. { key: "partyaResource", label: "甲方资源" },
  25. { key: "relocationTime", label: "生产配合" },
  26. { key: "winterBreakTime", label: "待命" },
  27. { key: "otherNptTime", label: "其他非生产时间" },
  28. ];
  29. const FORM_KEYS = [
  30. "id",
  31. "deptId",
  32. "projectId",
  33. "taskId",
  34. "deptName",
  35. "contractName",
  36. "taskName",
  37. "rigStatus",
  38. "designWellDepth",
  39. "currentDepth",
  40. "dailyPowerUsage",
  41. "dailyFuel",
  42. "mudDensity",
  43. "mudViscosity",
  44. "lateralLength",
  45. "wellInclination",
  46. "azimuth",
  47. "designWellStruct",
  48. "personnel",
  49. "drillingWorkingTime",
  50. "otherProductionTime",
  51. "lastCurrentDepth",
  52. "reportDetails",
  53. "constructionBrief",
  54. "remark",
  55. "createTime",
  56. "opinion",
  57. "repairTime",
  58. "selfStopTime",
  59. "accidentTime",
  60. "complexityTime",
  61. "rectificationTime",
  62. "waitingStopTime",
  63. "partyaDesign",
  64. "partyaPrepare",
  65. "partyaResource",
  66. "relocationTime",
  67. "winterBreakTime",
  68. "otherNptTime",
  69. "otherNptReason",
  70. "status",
  71. "auditStatus",
  72. "location",
  73. ];
  74. const formType = ref("edit");
  75. const initFormData = () => {
  76. const base = {
  77. drillingWorkingTime: 0,
  78. otherProductionTime: 0,
  79. constructionBrief: "",
  80. reportDetails: [],
  81. };
  82. // 初始化所有非生产时间字段为 0
  83. NON_PROD_FIELDS.forEach((field) => {
  84. base[field.key] = 0;
  85. });
  86. return base;
  87. };
  88. const form = ref(initFormData());
  89. const formatT = (arr) =>
  90. `${arr[0].toString().padStart(2, "0")}:${arr[1].toString().padStart(2, "0")}`;
  91. async function loadDetail(id) {
  92. try {
  93. const { data } = await getRuiYingReportDetail({ id });
  94. form.value = initFormData();
  95. FORM_KEYS.forEach((key) => {
  96. if (
  97. Object.prototype.hasOwnProperty.call(data, key) &&
  98. data[key] !== null &&
  99. data[key] !== undefined
  100. ) {
  101. form.value[key] = data[key];
  102. }
  103. });
  104. form.value.reportDetails = form.value.reportDetails.map((item) => ({
  105. reportDate: item.reportDate || form.value.createTime,
  106. duration: item.duration || 0,
  107. constructionDetail: item.constructionDetail || "",
  108. currentDepth: item.currentDepth || 0,
  109. currentOperation: item.currentOperation || "",
  110. startTime: formatT(item.startTime),
  111. endTime: formatT(item.endTime),
  112. }));
  113. if (!form.value.reportDetails.length) {
  114. addReportDetailRow();
  115. }
  116. form.value.id = id;
  117. if (props.type.includes("approval") && data.auditStatus !== 10) {
  118. formType.value = "readonly";
  119. }
  120. if (props.type.includes("edit") && data.status !== 0) {
  121. formType.value = "readonly";
  122. }
  123. if (props.type.includes("detail")) {
  124. formType.value = "readonly";
  125. }
  126. } finally {
  127. }
  128. }
  129. const addReportDetailRow = () => {
  130. if (!form.value.reportDetails) {
  131. form.value.reportDetails = [];
  132. }
  133. form.value.reportDetails.push({
  134. reportDate: form.value.createTime ?? dayjs().valueOf(),
  135. startTime: "08:00",
  136. endTime: "08:00",
  137. duration: 0,
  138. constructionDetail: "",
  139. currentDepth: 0,
  140. currentOperation: "",
  141. });
  142. };
  143. const removeReportDetailRow = (index) => {
  144. if (index === 0) {
  145. uni.showToast({ title: "至少填写一条生产动态", icon: "none" });
  146. return;
  147. }
  148. form.value.reportDetails?.splice(index, 1);
  149. };
  150. const dictStore = useDataDictStore();
  151. const nptReasonOptions = ref([]);
  152. const rigStatusOptions = ref([]);
  153. const loadOptions = () => {
  154. nptReasonOptions.value = dictStore
  155. .getStrDictOptions("nptReason")
  156. .map((v) => ({
  157. text: v.label,
  158. value: v.value,
  159. }));
  160. rigStatusOptions.value = dictStore
  161. .getStrDictOptions("rigStatus")
  162. .map((v) => ({
  163. text: v.label,
  164. value: v.value,
  165. }));
  166. };
  167. onLoad((options) => {
  168. if (dictStore.dataDict.length <= 0) {
  169. dictStore.loadDataDictList().then(() => {
  170. loadOptions();
  171. });
  172. } else loadOptions();
  173. loadDetail(options.id);
  174. });
  175. const defaultProps = computed(() => ({
  176. inputBorder: false,
  177. clearable: false,
  178. placeholder: "请输入",
  179. style: {
  180. "text-align": "right",
  181. },
  182. styles: {
  183. disableColor: "#fff",
  184. },
  185. }));
  186. const disabled = computed(() => (field) => {
  187. if (field === "edit")
  188. return (
  189. formType.value === "readonly" ||
  190. props.type.includes("approval") ||
  191. props.type.includes("detail")
  192. );
  193. else return formType.value === "readonly";
  194. });
  195. const formRef = ref(null);
  196. // 辅助函数:计算总时间
  197. const sumNonProdTimes = () => {
  198. let sum = 0;
  199. NON_PROD_FIELDS.forEach((field) => {
  200. sum += Number(form.value[field.key] || 0);
  201. });
  202. return sum;
  203. };
  204. // 校验函数:总时间必须为 24
  205. const validateTotalTime = (rule, value, data, callback) => {
  206. const drillingTime = Number(form.value.drillingWorkingTime || 0);
  207. const otherTime = Number(form.value.otherProductionTime || 0);
  208. const nonProdSum = sumNonProdTimes();
  209. let total = 0;
  210. let msg = "";
  211. total = parseFloat((drillingTime + otherTime + nonProdSum).toFixed(2));
  212. msg = `进尺(${drillingTime})+其他(${otherTime})+非生产(${nonProdSum})=${total}H,必须为24H`;
  213. if (Math.abs(total - 24) > 0.01) {
  214. callback(msg);
  215. }
  216. return true;
  217. };
  218. const validateLastCurrentDepth = (rule, value, data, callback) => {
  219. if (value && Number(value) < (form.value.lastCurrentDepth ?? 0)) {
  220. callback(`当前深度需大于等于上一次填报深度${form.value.lastCurrentDepth}m`);
  221. } else {
  222. callback();
  223. }
  224. };
  225. // uni-forms 规则定义
  226. const rules = reactive({
  227. currentDepth: {
  228. rules: [
  229. { required: true, errorMessage: "请输入当前深度" },
  230. { validateFunction: validateLastCurrentDepth },
  231. ],
  232. },
  233. drillingWorkingTime: {
  234. rules: [
  235. { required: true, errorMessage: "请输入进尺工作时间" },
  236. { validateFunction: validateTotalTime },
  237. ],
  238. },
  239. constructionBrief: {
  240. rules: [
  241. {
  242. required: props.type === "approval",
  243. errorMessage: `请输入当日施工简报`,
  244. },
  245. ],
  246. },
  247. });
  248. const allTimeKeys = [
  249. "drillingWorkingTime",
  250. "otherProductionTime",
  251. ...NON_PROD_FIELDS.map((f) => f.key),
  252. ];
  253. watch(
  254. () => allTimeKeys.map((key) => form.value[key]),
  255. () => {
  256. nextTick(() => {
  257. formRef.value?.validateField("drillingWorkingTime");
  258. });
  259. }
  260. );
  261. defineExpose({ formRef, form, loadDetail });
  262. const orange = computed(() => {
  263. const drillingTime = Number(form.value.drillingWorkingTime || 0);
  264. const otherTime = Number(form.value.otherProductionTime || 0);
  265. const nonProdSum = sumNonProdTimes();
  266. let total = 0;
  267. total = parseFloat((drillingTime + otherTime + nonProdSum).toFixed(2));
  268. if (Math.abs(total - 24) > 0.01) return true;
  269. return false;
  270. });
  271. const reportDetailsTimeRangeRef = ref(null);
  272. const startTime = ref("00:00");
  273. const startDefaultTime = ref("08:00");
  274. const endTime = ref("24:00");
  275. const endDefaultTime = ref("08:00");
  276. const reportDetailIndex = ref(0);
  277. const handleClickTimeRangeItem = (index) => {
  278. reportDetailIndex.value = index;
  279. reportDetailsTimeRangeRef.value.open();
  280. };
  281. const calculateDuration = (row) => {
  282. if (!row.startTime || !row.endTime) {
  283. row.duration = 0;
  284. return;
  285. }
  286. const todayStr = dayjs().format("YYYY-MM-DD");
  287. const start = dayjs(`${todayStr} ${row.startTime}`);
  288. const end = dayjs(`${todayStr} ${row.endTime}`);
  289. let diffMinutes = end.diff(start, "minute");
  290. if (diffMinutes < 0) {
  291. diffMinutes += 1440;
  292. }
  293. row.duration = Number((diffMinutes / 60).toFixed(2));
  294. };
  295. const reportDetailsTimeRange = (data) => {
  296. form.value.reportDetails[reportDetailIndex.value].startTime = data[0];
  297. form.value.reportDetails[reportDetailIndex.value].endTime = data[1];
  298. calculateDuration(form.value.reportDetails[reportDetailIndex.value]);
  299. inputCurrentDepth();
  300. };
  301. const inputCurrentDepth = useDebounceFn(function inputCurrentDepth() {
  302. const details = form.value.reportDetails;
  303. if (Array.isArray(details) && details.length > 0) {
  304. const latestDetail = details.reduce((prev, current) => {
  305. const currentFullTime = dayjs(current.reportDate)
  306. .hour(parseInt(current.endTime.split(":")[0]))
  307. .minute(parseInt(current.endTime.split(":")[1]))
  308. .valueOf();
  309. const prevFullTime = dayjs(prev.reportDate)
  310. .hour(parseInt(prev.endTime.split(":")[0]))
  311. .minute(parseInt(prev.endTime.split(":")[1]))
  312. .valueOf();
  313. return currentFullTime >= prevFullTime ? current : prev;
  314. });
  315. form.value.currentDepth = latestDetail.currentDepth;
  316. }
  317. }, 300);
  318. </script>
  319. <template>
  320. <view class="content">
  321. <view class="tip">
  322. <view class="item">
  323. <view class="left">
  324. <span>油量消耗:</span>
  325. 当日油耗
  326. </view>
  327. <span class="right red"> >9000升 红色预警 </span>
  328. </view>
  329. <view class="item">
  330. <view class="left">
  331. <span>时间平衡:</span>
  332. 进尺 + 其它生产 + 非生产 = 24H
  333. </view>
  334. <span class="right orange"> ≠24H 橙色预警 </span>
  335. </view>
  336. </view>
  337. <view v-if="!type.includes('approval') && form.opinion" class="opinion">
  338. <span class="left">审批意见:</span>
  339. <span class="right"> {{ form.opinion }} </span>
  340. </view>
  341. <uni-forms
  342. ref="formRef"
  343. labelWidth="auto"
  344. :model="form"
  345. :rules="rules"
  346. validateTrigger="submit"
  347. err-show-type="toast">
  348. <uni-forms-item label="施工队伍" name="deptName">
  349. <span class="readOnly">{{ form.deptName }}</span>
  350. </uni-forms-item>
  351. <uni-forms-item label="项目" name="contractName">
  352. <span class="readOnly">{{ form.contractName }}</span>
  353. </uni-forms-item>
  354. <uni-forms-item label="任务" name="taskName">
  355. <span class="readOnly">{{ form.taskName }}</span>
  356. </uni-forms-item>
  357. <uni-forms-item label="施工区域" name="location">
  358. <span class="readOnly">{{ form.location }}</span>
  359. </uni-forms-item>
  360. <uni-forms-item label="施工状态" name="rigStatus">
  361. <uni-data-select
  362. :clear="true"
  363. align="right"
  364. placeholder="请选择"
  365. :localdata="rigStatusOptions"
  366. placement="top"
  367. :disabled="disabled('edit')"
  368. v-model="form.rigStatus" />
  369. </uni-forms-item>
  370. <uni-forms-item label="设计井深(m)" name="designWellDepth">
  371. <span class="readOnly">{{ form.designWellDepth }}</span>
  372. </uni-forms-item>
  373. <uni-forms-item label="当前井深(m)" name="currentDepth" required>
  374. <uni-easyinput
  375. type="number"
  376. v-bind="defaultProps"
  377. :disabled="disabled('edit')"
  378. v-model="form.currentDepth" />
  379. </uni-forms-item>
  380. <uni-forms-item label="当日用电量(kWh)" name="dailyPowerUsage">
  381. <uni-easyinput
  382. type="number"
  383. v-bind="defaultProps"
  384. :disabled="disabled('edit')"
  385. v-model="form.dailyPowerUsage" />
  386. </uni-forms-item>
  387. <uni-forms-item label="当日油耗(升)" name="dailyFuel">
  388. <uni-easyinput
  389. type="number"
  390. :class="{ 'red-text': Number(form.dailyFuel) > 9000 }"
  391. v-bind="defaultProps"
  392. :disabled="disabled('edit')"
  393. v-model="form.dailyFuel" />
  394. </uni-forms-item>
  395. <uni-forms-item label="泥浆粘度(S)" name="mudViscosity">
  396. <uni-easyinput
  397. type="number"
  398. v-bind="defaultProps"
  399. :disabled="disabled('edit')"
  400. v-model="form.mudViscosity" />
  401. </uni-forms-item>
  402. <!-- <uni-forms-item label="泥浆粘度(S)" name="mudViscosity">
  403. <uni-easyinput
  404. type="number"
  405. v-bind="defaultProps"
  406. :disabled="disabled('edit')"
  407. v-model="form.mudViscosity" />
  408. </uni-forms-item> -->
  409. <uni-forms-item label="水平段长度(m)" name="lateralLength">
  410. <uni-easyinput
  411. type="number"
  412. v-bind="defaultProps"
  413. :disabled="disabled('edit')"
  414. v-model="form.lateralLength" />
  415. </uni-forms-item>
  416. <uni-forms-item label="井斜(°)" name="wellInclination">
  417. <uni-easyinput
  418. type="number"
  419. v-bind="defaultProps"
  420. :disabled="disabled('edit')"
  421. v-model="form.wellInclination" />
  422. </uni-forms-item>
  423. <uni-forms-item label="方位(°)" name="azimuth">
  424. <uni-easyinput
  425. type="number"
  426. v-bind="defaultProps"
  427. :disabled="disabled('edit')"
  428. v-model="form.azimuth" />
  429. </uni-forms-item>
  430. <uni-forms-item label="设计井身结构" name="designWellStruct">
  431. <uni-easyinput
  432. type="textarea"
  433. autoHeight
  434. v-bind="defaultProps"
  435. :disabled="disabled('edit')"
  436. v-model="form.designWellStruct"
  437. :maxlength="1000" />
  438. </uni-forms-item>
  439. <uni-forms-item label="人员情况" name="personnel">
  440. <uni-easyinput
  441. type="textarea"
  442. autoHeight
  443. v-bind="defaultProps"
  444. :disabled="disabled('edit')"
  445. v-model="form.personnel"
  446. :maxlength="1000" />
  447. </uni-forms-item>
  448. <!-- <uni-forms-item label="生产动态" name="productionStatus" required>
  449. <uni-easyinput
  450. type="textarea"
  451. autoHeight
  452. v-bind="defaultProps"
  453. v-model="form.productionStatus"
  454. :disabled="disabled('edit')"
  455. :maxlength="1000" />
  456. </uni-forms-item> -->
  457. <uni-forms-item
  458. label="当日施工简报"
  459. :required="type === 'approval'"
  460. name="constructionBrief">
  461. <uni-easyinput
  462. type="textarea"
  463. autoHeight
  464. v-bind="defaultProps"
  465. :disabled="type !== 'approval'"
  466. v-model="form.constructionBrief"
  467. :maxlength="2000" />
  468. </uni-forms-item>
  469. <uni-forms-item label="备注" name="remark">
  470. <uni-easyinput
  471. type="textarea"
  472. autoHeight
  473. v-bind="defaultProps"
  474. :disabled="disabled('edit')"
  475. v-model="form.remark"
  476. :maxlength="1000" />
  477. </uni-forms-item>
  478. <uv-divider text="生产动态" textPosition="left"></uv-divider>
  479. <uni-forms-item v-if="!disabled('edit')">
  480. <button
  481. type="primary"
  482. size="mini"
  483. class="detail-btn"
  484. @click="addReportDetailRow()">
  485. 添加一行
  486. </button>
  487. </uni-forms-item>
  488. <template v-for="(item, index) in form.reportDetails" :key="index">
  489. <uv-divider v-if="index !== 0" class="divider"></uv-divider>
  490. <uni-forms-item
  491. label="日期"
  492. required
  493. :name="['reportDetails', index, 'reportDate']"
  494. :rules="[{ required: true, errorMessage: '请选择日期' }]">
  495. <uni-datetime-picker
  496. class="datetime-picker"
  497. type="date"
  498. returnType="timestamp"
  499. v-model="item.reportDate"
  500. :border="false"
  501. :disabled="disabled('edit')"
  502. @change="inputCurrentDepth()" />
  503. </uni-forms-item>
  504. <uni-forms-item :label="`${$t('ruiDu.timeNode')}:`" required>
  505. <view
  506. class="item-content"
  507. @click="disabled('edit') ? '' : handleClickTimeRangeItem(index)">
  508. <view class="time-range-item" v-if="item.startTime && item.endTime">
  509. {{ item.startTime }} 至 {{ item.endTime }}
  510. </view>
  511. <view class="time-range-item" v-else> '请选择' </view>
  512. </view>
  513. </uni-forms-item>
  514. <uni-forms-item label="时长(H)">
  515. <span class="readOnly">{{ item.duration }}</span>
  516. </uni-forms-item>
  517. <uni-forms-item
  518. label="工况"
  519. required
  520. :name="['reportDetails', index, 'currentOperation']"
  521. :rules="[{ required: true, errorMessage: '请输入工况' }]">
  522. <uni-easyinput
  523. type="textarea"
  524. autoHeight
  525. v-bind="defaultProps"
  526. :disabled="disabled('edit')"
  527. v-model="item.currentOperation"
  528. :maxlength="2000" />
  529. </uni-forms-item>
  530. <uni-forms-item
  531. label="结束井深(m)"
  532. required
  533. :name="['reportDetails', index, 'currentDepth']"
  534. :rules="[
  535. { required: true, errorMessage: '请输入结束深度' },
  536. { validateFunction: validateLastCurrentDepth },
  537. ]">
  538. <uni-easyinput
  539. type="number"
  540. v-bind="defaultProps"
  541. :disabled="disabled('edit')"
  542. v-model.number="item.currentDepth"
  543. @input="(val) => inputCurrentDepth(val, index)" />
  544. </uni-forms-item>
  545. <uni-forms-item
  546. label="详情"
  547. required
  548. :name="['reportDetails', index, 'constructionDetail']"
  549. :rules="[{ required: true, errorMessage: '请输入详情' }]">
  550. <uni-easyinput
  551. type="textarea"
  552. autoHeight
  553. v-bind="defaultProps"
  554. :disabled="disabled('edit')"
  555. v-model="item.constructionDetail"
  556. :maxlength="2000" />
  557. </uni-forms-item>
  558. <uni-forms-item v-if="!disabled('edit')" label="操作">
  559. <button
  560. type="warn"
  561. size="mini"
  562. class="detail-btn"
  563. @click="removeReportDetailRow(index)">
  564. 删除
  565. </button>
  566. </uni-forms-item>
  567. </template>
  568. <uv-divider text="生产时间" textPosition="left"></uv-divider>
  569. <uni-forms-item
  570. label="进尺工作时间(H)"
  571. name="drillingWorkingTime"
  572. required>
  573. <uni-easyinput
  574. type="number"
  575. v-bind="defaultProps"
  576. :class="{ 'orange-text': orange }"
  577. :disabled="disabled('edit')"
  578. v-model="form.drillingWorkingTime" />
  579. </uni-forms-item>
  580. <uni-forms-item
  581. label="其它生产时间(H)"
  582. name="otherProductionTime"
  583. required>
  584. <uni-easyinput
  585. type="number"
  586. v-bind="defaultProps"
  587. :class="{ 'orange-text': orange }"
  588. :disabled="disabled('edit')"
  589. v-model="form.otherProductionTime" />
  590. </uni-forms-item>
  591. <uv-divider text="非生产时间" textPosition="left"></uv-divider>
  592. <uni-forms-item
  593. v-for="field in NON_PROD_FIELDS"
  594. :key="field.key"
  595. :label="field.label + '(H)'"
  596. :name="field.key">
  597. <uni-easyinput
  598. type="number"
  599. :class="{ 'orange-text': orange }"
  600. v-bind="defaultProps"
  601. :disabled="disabled('edit')"
  602. v-model="form[field.key]" />
  603. </uni-forms-item>
  604. <uni-forms-item label="其他非生产原因" name="otherNptReason">
  605. <uni-easyinput
  606. type="textarea"
  607. autoHeight
  608. v-bind="defaultProps"
  609. v-model="form.otherNptReason"
  610. :disabled="disabled('edit')"
  611. :maxlength="1000" />
  612. </uni-forms-item>
  613. <uni-forms-item
  614. v-if="type.includes('approval')"
  615. label="审批意见"
  616. name="opinion">
  617. <uni-easyinput
  618. type="textarea"
  619. autoHeight
  620. v-bind="defaultProps"
  621. :disabled="disabled('approval')"
  622. v-model="form.opinion"
  623. :maxlength="1000" />
  624. </uni-forms-item>
  625. </uni-forms>
  626. </view>
  627. <tpf-time-range
  628. ref="reportDetailsTimeRangeRef"
  629. :startTime="startTime"
  630. :startDefaultTime="startDefaultTime"
  631. :endTime="endTime"
  632. :endDefaultTime="endDefaultTime"
  633. @timeRange="reportDetailsTimeRange"></tpf-time-range>
  634. </template>
  635. <style lang="scss" scoped>
  636. .content {
  637. background-color: white;
  638. padding: 16px 16px;
  639. border-radius: 8px;
  640. box-sizing: border-box;
  641. }
  642. .uni-forms {
  643. margin-top: 10px;
  644. height: 100%;
  645. .uni-form {
  646. height: 100%;
  647. }
  648. .uni-forms-item {
  649. display: flex;
  650. align-items: center;
  651. flex: 1;
  652. margin-bottom: 6px;
  653. border-bottom: 1px dashed #cacccf;
  654. }
  655. :deep(.uni-forms-item__content) {
  656. text-align: right;
  657. .readOnly {
  658. padding-right: 10px;
  659. }
  660. }
  661. :deep(.uni-forms-item__label) {
  662. height: 44px;
  663. font-weight: 500;
  664. font-size: 14px;
  665. color: #333333 !important;
  666. width: max-content !important;
  667. }
  668. :deep(.uni-select) {
  669. border: none;
  670. text-align: right;
  671. padding-right: 0;
  672. .uniui-bottom:before {
  673. content: "\e6b5" !important;
  674. font-size: 16px !important;
  675. }
  676. }
  677. :deep(.uni-easyinput__content-textarea) {
  678. min-height: inherit;
  679. margin: 10px;
  680. }
  681. :deep(.is-disabled) {
  682. color: #333333 !important;
  683. }
  684. :deep(.red-text > .is-disabled) {
  685. color: rgb(220 38 38 / 0.8) !important;
  686. }
  687. :deep(.orange-text > .is-disabled) {
  688. color: rgb(234 88 12 / 0.8) !important;
  689. }
  690. :deep(.uni-select--disabled) {
  691. background-color: #fff;
  692. }
  693. }
  694. .red-text {
  695. color: rgb(220 38 38 / 0.8) !important;
  696. }
  697. .orange-text {
  698. color: rgb(234 88 12 / 0.8) !important;
  699. }
  700. .red {
  701. border: 1px solid rgb(254 226 226);
  702. color: rgb(220 38 38 / 0.8);
  703. background-color: rgb(254 226 226);
  704. }
  705. .orange {
  706. border: 1px solid rgb(254 215 170);
  707. color: rgb(234 88 12 / 0.8);
  708. background-color: rgb(254 215 170);
  709. }
  710. .tip {
  711. border-radius: 8px;
  712. border: 1px solid #e5e5e5;
  713. background-color: rgba(239, 246, 255, 0.8);
  714. box-sizing: border-box;
  715. padding: 10px;
  716. display: flex;
  717. flex-direction: column;
  718. gap: 6px;
  719. .item {
  720. display: flex;
  721. align-items: center;
  722. justify-content: space-between;
  723. font-size: 12px;
  724. .left {
  725. color: rgb(75 85 99);
  726. span {
  727. color: rgb(31 41 55);
  728. font-weight: 600;
  729. }
  730. }
  731. .right {
  732. display: inline-flex;
  733. align-items: center;
  734. border-radius: 4px;
  735. padding: 2px 4px;
  736. font-weight: 500;
  737. }
  738. }
  739. }
  740. .opinion {
  741. border-radius: 8px;
  742. border: 1px solid rgb(254 240 138);
  743. background-color: rgb(254 252 232);
  744. box-sizing: border-box;
  745. padding: 10px;
  746. display: flex;
  747. align-items: center;
  748. justify-content: space-between;
  749. font-size: 12px;
  750. margin-top: 10px;
  751. .left {
  752. font-weight: 600;
  753. color: rgb(133 77 14);
  754. }
  755. .right {
  756. font-weight: 500;
  757. color: rgb(75 85 99);
  758. }
  759. }
  760. :deep(.uv-divider__text) {
  761. color: #333 !important;
  762. }
  763. .detail-btn {
  764. margin: 0;
  765. margin-left: auto;
  766. float: right;
  767. }
  768. .time-range-item {
  769. margin: 10px;
  770. }
  771. .item-content {
  772. display: flex;
  773. align-items: center;
  774. justify-content: end;
  775. }
  776. .divider {
  777. margin: 0;
  778. transform: translateY(-7px);
  779. :deep(.uv-line) {
  780. border-width: 2px !important;
  781. border-color: rgb(41, 121, 255) !important;
  782. }
  783. }
  784. :deep(.datetime-picker) {
  785. .uniui-calendar {
  786. &::before {
  787. display: none;
  788. }
  789. }
  790. .uni-date-editor--x__disabled {
  791. opacity: 1 !important;
  792. }
  793. .uni-date__x-input {
  794. color: #333 !important;
  795. }
  796. }
  797. </style>