report-info.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <scroll-view scroll-y="true" class="report-info">
  3. <!-- 日报详情 - 任务信息 -->
  4. <view class="report-info-content form-content">
  5. <uni-forms ref="reportInfoRef" labelWidth="140px" :modelValue="reportData">
  6. <!-- 甲方 -->
  7. <uni-forms-item class="form-item" :label="`${$t('ruiDu.firstParty')}:`" name="manufactureName">
  8. <uni-easyinput
  9. style="text-align: right"
  10. type="textarea"
  11. :autoHeight="true"
  12. :inputBorder="false"
  13. :clearable="false"
  14. :styles="{ disableColor: '#fff' }"
  15. :placeholder="selectPlaceholder"
  16. :disabled="props.formDisable"
  17. :value="reportData.manufactureName" />
  18. </uni-forms-item>
  19. <!-- 合同号 -->
  20. <uni-forms-item class="form-item" :label="`${$t('ruiDu.contractNo')}:`" name="contractName">
  21. <uni-easyinput
  22. style="text-align: right"
  23. type="textarea"
  24. :autoHeight="true"
  25. :inputBorder="false"
  26. :clearable="false"
  27. :styles="{ disableColor: '#fff' }"
  28. :placeholder="selectPlaceholder"
  29. :disabled="props.formDisable"
  30. :value="reportData.contractName" />
  31. </uni-forms-item>
  32. <!-- 井号 -->
  33. <uni-forms-item class="form-item" :label="`${$t('ruiDu.wellNo')}:`" name="wellName">
  34. <uni-easyinput
  35. style="text-align: right"
  36. type="textarea"
  37. :autoHeight="true"
  38. :inputBorder="false"
  39. :clearable="false"
  40. :styles="{ disableColor: '#fff' }"
  41. :placeholder="selectPlaceholder"
  42. :disabled="props.formDisable"
  43. :value="reportData.wellName" />
  44. </uni-forms-item>
  45. <!-- 施工队伍 -->
  46. <uni-forms-item class="form-item" :label="`${$t('ruiDu.constructionTeam')}:`" name="constructionTeam">
  47. <uni-easyinput
  48. style="text-align: right"
  49. type="textarea"
  50. :autoHeight="true"
  51. :inputBorder="false"
  52. :clearable="false"
  53. :styles="{ disableColor: '#fff' }"
  54. :placeholder="selectPlaceholder"
  55. :disabled="props.formDisable"
  56. :value="reportData.deptName" />
  57. </uni-forms-item>
  58. <!-- 施工地点 -->
  59. <uni-forms-item class="form-item" :label="`${$t('ruiDu.constructionLocation')}:`" name="location">
  60. <uni-easyinput
  61. style="text-align: right"
  62. type="textarea"
  63. :autoHeight="true"
  64. :inputBorder="false"
  65. :clearable="false"
  66. :styles="{ disableColor: '#fff' }"
  67. :placeholder="selectPlaceholder"
  68. :disabled="props.formDisable"
  69. :value="reportData.location" />
  70. </uni-forms-item>
  71. <!-- 工艺 -->
  72. <uni-forms-item class="form-item" :label="`${$t('ruiDu.process')}:`" name="techniqueNames">
  73. <uni-easyinput
  74. style="text-align: right"
  75. type="textarea"
  76. :autoHeight="true"
  77. :inputBorder="false"
  78. :clearable="false"
  79. :styles="{ disableColor: '#fff' }"
  80. :placeholder="selectPlaceholder"
  81. :disabled="props.formDisable"
  82. :value="reportData.techniqueNames" />
  83. </uni-forms-item>
  84. <!-- 带班干部 -->
  85. <uni-forms-item class="form-item" :label="`${$t('ruiDu.shiftLeader')}:`" name="responsiblePersonNames">
  86. <uni-easyinput
  87. style="text-align: right"
  88. type="textarea"
  89. :autoHeight="true"
  90. :inputBorder="false"
  91. :clearable="false"
  92. :styles="{ disableColor: '#fff' }"
  93. :placeholder="selectPlaceholder"
  94. :disabled="props.formDisable"
  95. :value="reportData.responsiblePersonNames" />
  96. </uni-forms-item>
  97. <!-- 搬迁日期 -->
  98. <uni-forms-item class="form-item" :label="`${$t('ruiDu.relocationDate')}:`" name="relocationDate">
  99. <uni-datetime-picker
  100. type="datetime"
  101. returnType="timestamp"
  102. :border="false"
  103. :placeholder="selectPlaceholder"
  104. :disabled="props.formDisable"
  105. v-model="reportData.relocationDate">
  106. </uni-datetime-picker>
  107. </uni-forms-item>
  108. <!-- 开工日期 -->
  109. <uni-forms-item class="form-item" :label="`${$t('ruiDu.commencementDate')}:`" name="commencementDate">
  110. <uni-datetime-picker
  111. type="datetime"
  112. returnType="timestamp"
  113. :border="false"
  114. :placeholder="selectPlaceholder"
  115. :disabled="props.formDisable"
  116. v-model="reportData.commencementDate">
  117. </uni-datetime-picker>
  118. </uni-forms-item>
  119. <!-- 完工日期 -->
  120. <uni-forms-item class="form-item" :label="`${$t('ruiDu.completionDate')}:`" name="completionDate">
  121. <uni-datetime-picker
  122. type="datetime"
  123. returnType="timestamp"
  124. :border="false"
  125. :placeholder="selectPlaceholder"
  126. :disabled="props.formDisable"
  127. v-model="reportData.completionDate">
  128. </uni-datetime-picker>
  129. </uni-forms-item>
  130. <!-- 施工周期 -->
  131. <uni-forms-item class="form-item" :label="`${$t('ruiDu.constructionCycle')}:`" name="constructionPeriod">
  132. <uni-easyinput
  133. style="text-align: right"
  134. type="textarea"
  135. :autoHeight="true"
  136. :inputBorder="false"
  137. :clearable="false"
  138. :styles="{ disableColor: '#fff' }"
  139. :placeholder="selectPlaceholder"
  140. :disabled="props.formDisable"
  141. :value="reportData.constructionPeriod" />
  142. </uni-forms-item>
  143. <!-- 设备配置 -->
  144. <uni-forms-item class="form-item" :label="`${$t('ruiDu.equipmentConfig')}:`" name="deviceNames">
  145. <uni-easyinput
  146. style="text-align: right"
  147. type="textarea"
  148. :autoHeight="true"
  149. :inputBorder="false"
  150. :clearable="false"
  151. :styles="{ disableColor: '#fff' }"
  152. :placeholder="selectPlaceholder"
  153. :disabled="props.formDisable"
  154. :value="reportData.deviceNames" />
  155. </uni-forms-item>
  156. <uni-forms-item class="form-item" :label="`审批意见:`" v-if="approval">
  157. <uni-easyinput
  158. style="text-align: right"
  159. type="textarea"
  160. :autoHeight="true"
  161. :inputBorder="false"
  162. :clearable="false"
  163. :disabled="formDisable"
  164. :styles="{ disableColor: '#fff' }"
  165. :placeholder="inputPlaceholder"
  166. v-model="approvalOpinion"
  167. :maxlength="1000" />
  168. </uni-forms-item>
  169. </uni-forms>
  170. </view>
  171. </scroll-view>
  172. </template>
  173. <script setup>
  174. import { ref, computed, getCurrentInstance, onMounted, watch } from 'vue';
  175. // -------------------------- 引入api接口 start--------------------------
  176. // -------------------------- 引入api接口 end --------------------------
  177. // --------------------------引用组件-----start---------------------------
  178. // --------------------------引用组件-----end-----------------------------
  179. // --------------------------引用全局变量$t-------------------------------
  180. const { appContext } = getCurrentInstance();
  181. const t = appContext.config.globalProperties.$t;
  182. // --------------------------引用字典项-----------------------------------
  183. import { useDataDictStore } from '@/store/modules/dataDict';
  184. const { getIntDictOptions, getStrDictOptions } = useDataDictStore();
  185. // -------------------------接收父组件传递的参数--------------------------
  186. const props = defineProps({
  187. reportId: {
  188. type: String,
  189. default: '',
  190. },
  191. reportData: {
  192. type: Object,
  193. default: () => {},
  194. },
  195. formDisable: {
  196. type: Boolean,
  197. default: true, // 是否禁用表单
  198. },
  199. approval: {
  200. type: Boolean,
  201. default: false,
  202. },
  203. });
  204. // -------------------------- 生命周期函数 --------------------------
  205. onMounted(() => {
  206. console.log('report-info mounted');
  207. });
  208. // -------------------------- 页面变量 --------------------------
  209. // 表单ref
  210. const formRef = ref(null);
  211. // 选择占位符
  212. const selectPlaceholder = computed(() => {
  213. return props.formDisable ? ' ' : t('operation.PleaseSelect');
  214. });
  215. const inputPlaceholder = computed(() => {
  216. return props.formDisable ? ' ' : t('operation.PleaseInput');
  217. });
  218. // -------------------------- 页面方法 --------------------------
  219. const approvalOpinion = ref('');
  220. watch(
  221. () => props.reportData.opinion,
  222. newVal => {
  223. approvalOpinion.value = newVal || '';
  224. }
  225. );
  226. // -------------------------- 暴露给父组件的外部方法 --------------------------
  227. defineExpose({ approvalOpinion });
  228. // -------------------------- 事件派发 --------------------------
  229. const emit = defineEmits([]);
  230. </script>
  231. <style lang="scss" scoped>
  232. @import '@/style/work-order-detail.scss';
  233. .report-info {
  234. height: 100%;
  235. color: #333;
  236. }
  237. :deep(.uni-textarea-textarea:disabled),
  238. :deep(.uni-input-input:disabled) {
  239. color: #333;
  240. }
  241. :deep(.uni-date-x) {
  242. color: #333;
  243. }
  244. </style>