|
|
@@ -17,10 +17,11 @@
|
|
|
class="exe-item-detli-time"
|
|
|
type="date"
|
|
|
:model-value="exeDate"
|
|
|
+ @change="(e) => onConfirm(e)"
|
|
|
:hide-second="true"
|
|
|
:border="false"
|
|
|
/>
|
|
|
- <view class="item-right-li priamry"> {{props.detailData.showNum}} </view>
|
|
|
+ <view class="item-right-li priamry"> {{showNum}} </view>
|
|
|
</view>
|
|
|
<van-row class="table-item header">
|
|
|
<van-col span="8">要求执行时间</van-col>
|
|
|
@@ -29,7 +30,7 @@
|
|
|
<van-col span="5">执行状态</van-col>
|
|
|
</van-row>
|
|
|
<view
|
|
|
- v-for="(item, index) in props.detailData.execInfos">
|
|
|
+ v-for="(item, index) in newExecInfos">
|
|
|
<van-row class="table-item">
|
|
|
<van-col span="8">{{item?.execSttTime}}</van-col>
|
|
|
<van-col span="7">{{item?.execTime}}</van-col>
|
|
|
@@ -44,8 +45,11 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { ref, watch, onMounted, nextTick } from 'vue';
|
|
|
+ import { $http } from '../../../config/https';
|
|
|
import Detailtem from './Detailtem.vue';
|
|
|
const exeDate = ref(''); // 执行日期
|
|
|
+ const showNum = ref('');
|
|
|
+ const newExecInfos = ref([]);
|
|
|
const props = defineProps({
|
|
|
visibleDetail: {
|
|
|
type: Boolean,
|
|
|
@@ -68,16 +72,43 @@
|
|
|
|
|
|
//初始化
|
|
|
const initData = () =>{
|
|
|
- let exeDateNow = formatDateTime();
|
|
|
- exeDate.value = exeDateNow;
|
|
|
-
|
|
|
+ $http.post('urlDeault',this, {
|
|
|
+ code: '04220027',
|
|
|
+ data: {
|
|
|
+ params: [{
|
|
|
+ "ordID": props.detailData.ordID,
|
|
|
+ "exeDate": exeDate.value
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ success: function(res) {
|
|
|
+ if (+res.errorCode === 0) {
|
|
|
+ newExecInfos.value = res.result;
|
|
|
+
|
|
|
+ // 计算已执行数量和总数量,生成showNum
|
|
|
+ const totalExecCount = Array.isArray(res.result) ? res.result.length : 0;
|
|
|
+ const executedCount = Array.isArray(res.result)
|
|
|
+ ? res.result.filter(exec => exec.statusDesc === '已执行').length
|
|
|
+ : 0;
|
|
|
+ showNum.value = `${executedCount}/${totalExecCount}`;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
+ // 确定选择日期
|
|
|
+ const onConfirm = (value) => {
|
|
|
+ exeDate.value = value;
|
|
|
+ initData();
|
|
|
+ };
|
|
|
+
|
|
|
watch(
|
|
|
() => props.detailData,
|
|
|
(newVal) => {
|
|
|
- // todo根据ID获取详情数据
|
|
|
- initData();
|
|
|
+ if(props.detailData && props.detailData?.ordID){
|
|
|
+ let exeDateNow = formatDateTime();
|
|
|
+ exeDate.value = exeDateNow;
|
|
|
+ initData();
|
|
|
+ }
|
|
|
},
|
|
|
{ immediate: true, deep: true },
|
|
|
);
|