|
@@ -1,17 +1,35 @@
|
|
<template>
|
|
<template>
|
|
<div class="distribution">
|
|
<div class="distribution">
|
|
- <van-nav-bar title="报工" left-text="返回" @click-left="back" fixed left-arrow />
|
|
|
|
|
|
+ <van-nav-bar :title="reportBoolean ? '查看报工' : '报工'" left-text="返回" @click-left="back" fixed left-arrow />
|
|
<div class="distribution_con contentRoll">
|
|
<div class="distribution_con contentRoll">
|
|
- <div>
|
|
|
|
- <van-field v-model="vehicleNum" type="digit" label="车辆序号" @blur="getMyPlanProcedureList()"/>
|
|
|
|
|
|
+ <!-- 报工 -->
|
|
|
|
+ <div v-if="!reportBoolean">
|
|
|
|
+ <van-field v-model="vehicleNum" type="digit" label="车辆序号" @blur="getMyPlanProcedureList()" />
|
|
</div>
|
|
</div>
|
|
|
|
+ <!-- 查看报工 -->
|
|
|
|
+ <div v-if="reportBoolean">
|
|
|
|
+ <van-cell title="日期" :value="reportDate" @click="reportDateShow = true" is-link />
|
|
|
|
+ <van-cell title="人员" :value="personnelName" @click="popupShow = true" is-link>
|
|
|
|
+ <template #right-icon>
|
|
|
|
+ <div class="vanCellIcon">
|
|
|
|
+ <van-icon name="cross" class="search-icon" v-if="personnelName" color="#969799" @click.stop="clearName" />
|
|
|
|
+ <van-icon name="arrow" class="search-icon" v-else color="#969799" />
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </van-cell>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 内容 -->
|
|
<van-empty v-if="myPlanProcedureList.length == 0">暂无待报工任务</van-empty>
|
|
<van-empty v-if="myPlanProcedureList.length == 0">暂无待报工任务</van-empty>
|
|
<div v-for="(prod, prodIndex) in myPlanProcedureList" :key="prodIndex">
|
|
<div v-for="(prod, prodIndex) in myPlanProcedureList" :key="prodIndex">
|
|
<div class="distribution_header">
|
|
<div class="distribution_header">
|
|
- <div class="textDis">{{ prod.plan_type == 0 ? prod.product_name : prod.task_name }}</div>
|
|
|
|
|
|
+ <div class="textDis">
|
|
|
|
+ <span>{{ prod.plan_type == 0 ? prod.product_name : prod.task_name }}</span>
|
|
|
|
+ <span v-if="reportBoolean">{{ prod.userName }}</span>
|
|
|
|
+ </div>
|
|
<div v-if="prod.plan_type == 0">{{ prod.product_scheduling_num }}</div>
|
|
<div v-if="prod.plan_type == 0">{{ prod.product_scheduling_num }}</div>
|
|
- <div>{{ prod.start_date.replace(/-/g, '') }}-{{!prod.end_date?"":prod.end_date.replace(/-/g, '') }}</div>
|
|
|
|
- <div v-if="prod.vehicle_num_start && prod.vehicle_num_end">{{ prod.vehicle_num_start }}-{{ prod.vehicle_num_end }}</div>
|
|
|
|
|
|
+ <div>{{ prod.start_date.replace(/-/g, '') }}-{{ !prod.end_date ? "" : prod.end_date.replace(/-/g, '') }}</div>
|
|
|
|
+ <div v-if="prod.vehicle_num_start && prod.vehicle_num_end">{{ prod.vehicle_num_start }}-{{ prod.vehicle_num_end
|
|
|
|
+ }}</div>
|
|
</div>
|
|
</div>
|
|
<div class="distribution_box" v-for="item, index in prod.procedureList" :key="index" @click="reportItem(item)">
|
|
<div class="distribution_box" v-for="item, index in prod.procedureList" :key="index" @click="reportItem(item)">
|
|
<div>
|
|
<div>
|
|
@@ -22,13 +40,24 @@
|
|
</van-row>
|
|
</van-row>
|
|
<div style="margin-top:10px;text-align: center;">
|
|
<div style="margin-top:10px;text-align: center;">
|
|
<van-row gutter="20">
|
|
<van-row gutter="20">
|
|
- <van-col span="8">
|
|
|
|
|
|
+ <!-- <van-col span="8">
|
|
<div class="valueCls">
|
|
<div class="valueCls">
|
|
{{ item.progress }}%
|
|
{{ item.progress }}%
|
|
</div>
|
|
</div>
|
|
<div class="labelCls">
|
|
<div class="labelCls">
|
|
进度
|
|
进度
|
|
</div>
|
|
</div>
|
|
|
|
+ </van-col> -->
|
|
|
|
+ <van-col span="8">
|
|
|
|
+ <div class="valueCls" v-if="reportBoolean">
|
|
|
|
+ {{ (item.finishNum && item.finishNum) ? item.finishNum : 0 }}
|
|
|
|
+ </div>
|
|
|
|
+ <div class="valueCls" v-if="!reportBoolean">
|
|
|
|
+ {{ num }}
|
|
|
|
+ </div>
|
|
|
|
+ <div class="labelCls">
|
|
|
|
+ 件数
|
|
|
|
+ </div>
|
|
</van-col>
|
|
</van-col>
|
|
<van-col span="8">
|
|
<van-col span="8">
|
|
<div class="valueCls">
|
|
<div class="valueCls">
|
|
@@ -54,14 +83,20 @@
|
|
</div>
|
|
</div>
|
|
<!-- 弹出层选人 -->
|
|
<!-- 弹出层选人 -->
|
|
<van-popup v-model="popupShow" round position="bottom" :style="{ height: '80%', background: '#F4F4F4' }">
|
|
<van-popup v-model="popupShow" round position="bottom" :style="{ height: '80%', background: '#F4F4F4' }">
|
|
|
|
+ <ChooseSomeone ref="ChooseSomeone" :groupView="1" :typeSHow="false" @ChooseSomeoneChanhe="chooseSomeoneChanhe"
|
|
|
|
+ :peopleListId="[personnelId]" :peopleList="crewMember" v-if="popupShow"></ChooseSomeone>
|
|
</van-popup>
|
|
</van-popup>
|
|
|
|
+ <!-- 日期 -->
|
|
|
|
+ <van-calendar v-model="reportDateShow" :min-date="minDate" @confirm="reportDateOnConfirm" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import ChooseSomeone from '../../components/chooseSomeone.vue'
|
|
export default {
|
|
export default {
|
|
props: {},
|
|
props: {},
|
|
components: {
|
|
components: {
|
|
|
|
+ ChooseSomeone
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -71,13 +106,29 @@ export default {
|
|
popupShow: false,
|
|
popupShow: false,
|
|
titleText: '今日计划', // 默认文字
|
|
titleText: '今日计划', // 默认文字
|
|
todayAndTomorrow: true, // true 今日计划,false 明日计划
|
|
todayAndTomorrow: true, // true 今日计划,false 明日计划
|
|
- vehicleNum:null
|
|
|
|
|
|
+ vehicleNum: null,
|
|
|
|
+ reportBoolean: false, // false 报工, true 查看报工
|
|
|
|
+ reportDateShow: false, // 报工日期弹出层
|
|
|
|
+ minDate: new Date(2010, 0, 1),
|
|
|
|
+ reportDate: this.formatDate(new Date()), // 报工日期
|
|
|
|
+ personnelName: '', // 人员姓名
|
|
|
|
+ personnelId: '', // 人员id
|
|
|
|
+ crewMember: [], // 班组人员列表
|
|
|
|
+ userInfo: JSON.parse(localStorage.userInfo),
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {},
|
|
computed: {},
|
|
watch: {},
|
|
watch: {},
|
|
created() { },
|
|
created() { },
|
|
mounted() {
|
|
mounted() {
|
|
|
|
+ const { name } = this.$route.query;
|
|
|
|
+ this.reportBoolean = name == '查看报工' ? true : false;
|
|
|
|
+ if (this.reportBoolean) {
|
|
|
|
+ const { id, name } = this.userInfo
|
|
|
|
+ this.personnelName = name
|
|
|
|
+ this.personnelId = id
|
|
|
|
+ this.getCrewMemberList()
|
|
|
|
+ }
|
|
this.getMyPlanProcedureList();
|
|
this.getMyPlanProcedureList();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -92,24 +143,114 @@ export default {
|
|
this.distributionIndex = index
|
|
this.distributionIndex = index
|
|
this.popupShow = true
|
|
this.popupShow = true
|
|
},
|
|
},
|
|
-
|
|
|
|
|
|
+ getCrewMemberList() {
|
|
|
|
+ this.$axios.post('/department/getMyManageUserList', {
|
|
|
|
+ date: this.reportDate,
|
|
|
|
+ })
|
|
|
|
+ .then(res => {
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ this.crewMember = res.data.map(item => {
|
|
|
|
+ return {
|
|
|
|
+ name: item.name,
|
|
|
|
+ id: item.id,
|
|
|
|
+ jobNumber: item.jobNumber,
|
|
|
|
+ phone: item.phone
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.$toast.fail(res.msg);
|
|
|
|
+ }
|
|
|
|
+ }).catch(err => { this.$toast.clear(); });
|
|
|
|
+ },
|
|
getMyPlanProcedureList() {
|
|
getMyPlanProcedureList() {
|
|
const toast = this.$toast.loading({
|
|
const toast = this.$toast.loading({
|
|
forbidClick: true,
|
|
forbidClick: true,
|
|
duration: 0
|
|
duration: 0
|
|
});
|
|
});
|
|
- this.$axios.post("/plan-procedure-total/getReportForWorkList", {
|
|
|
|
- vehicleNum:this.vehicleNum
|
|
|
|
- })
|
|
|
|
|
|
+
|
|
|
|
+ let urls = ''
|
|
|
|
+ let params = {}
|
|
|
|
+ console.log('查看 ==>', this.reportBoolean, typeof this.reportBoolean)
|
|
|
|
+ if (this.reportBoolean) {
|
|
|
|
+ urls = '/report/getReportList'
|
|
|
|
+ params = {
|
|
|
|
+ // date: '2023-11-20',
|
|
|
|
+ // userId: '8377462629387460613'
|
|
|
|
+ date: this.reportDate,
|
|
|
|
+ userId: this.personnelId
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ urls = '/plan-procedure-total/getReportForWorkList'
|
|
|
|
+ params = {
|
|
|
|
+ vehicleNum: this.vehicleNum
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.$axios.post(urls, params)
|
|
.then(res => {
|
|
.then(res => {
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
this.$toast.clear();
|
|
this.$toast.clear();
|
|
- this.myPlanProcedureList = res.data;
|
|
|
|
|
|
+ if (this.reportBoolean) {
|
|
|
|
+ this.myPlanProcedureList = this.handleData(res.data);
|
|
|
|
+ console.log(this.handleData(res.data))
|
|
|
|
+ } else {
|
|
|
|
+ this.myPlanProcedureList = res.data;
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
this.$toast.clear();
|
|
this.$toast.clear();
|
|
this.$toast.fail(res.msg);
|
|
this.$toast.fail(res.msg);
|
|
}
|
|
}
|
|
}).catch(err => { this.$toast.clear(); });
|
|
}).catch(err => { this.$toast.clear(); });
|
|
|
|
+
|
|
|
|
+ // this.$axios.post("/report/getReportList", {
|
|
|
|
+ // date: '2023-11-20',
|
|
|
|
+ // userId: '8377462629387460613'
|
|
|
|
+ // })
|
|
|
|
+ // this.$axios.post("/plan-procedure-total/getReportForWorkList", {
|
|
|
|
+ // vehicleNum:this.vehicleNum
|
|
|
|
+ // })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ handleData(data) {
|
|
|
|
+ let newList = []
|
|
|
|
+ for (var j in data) {
|
|
|
|
+ const it = data[j].data
|
|
|
|
+ let obj = {}
|
|
|
|
+ let arr = []
|
|
|
|
+ for (var i in it) {
|
|
|
|
+ const item = it[i]
|
|
|
|
+ obj = {
|
|
|
|
+ end_date: item.endDate,
|
|
|
|
+ plan_id: item.planId,
|
|
|
|
+ plan_type: item.planType,
|
|
|
|
+ plan_name: item.planName,
|
|
|
|
+ product_name: item.productName,
|
|
|
|
+ product_scheduling_num: item.productSchedulingNum,
|
|
|
|
+ start_date: item.startDate.join('-'),
|
|
|
|
+ task_change_notice_num: item.taskChangeNoticeNum,
|
|
|
|
+ task_name: item.taskName,
|
|
|
|
+ task_type_name: item.taskTypeName,
|
|
|
|
+ vehicle_num_end: item.vehicleNumEnd,
|
|
|
|
+ vehicle_num_start: item.vehicleNumStart,
|
|
|
|
+ }
|
|
|
|
+ arr.push({
|
|
|
|
+ check_type: item.checkType,
|
|
|
|
+ checker_id: item.checkerId,
|
|
|
|
+ checker_name: item.checkerName,
|
|
|
|
+ job_of_money: item.jobOfMoney,
|
|
|
|
+ plan_check_type: item.planCheckType,
|
|
|
|
+ procedure_name: item.procedureName,
|
|
|
|
+ progress: item.progress,
|
|
|
|
+ work_time: item.workTime,
|
|
|
|
+ finishNum: item.finishNum,
|
|
|
|
+ id: item.id
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ obj.procedureList = arr
|
|
|
|
+ obj.userName = data[j].name
|
|
|
|
+ newList.push(obj)
|
|
|
|
+ }
|
|
|
|
+ return newList
|
|
},
|
|
},
|
|
|
|
|
|
//打开报工页面
|
|
//打开报工页面
|
|
@@ -121,6 +262,34 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ formatDate(date) {
|
|
|
|
+ // 中国标准时间转成 YYYY-MM-DD
|
|
|
|
+ const year = date.getFullYear();
|
|
|
|
+ const month = date.getMonth() + 1;
|
|
|
|
+ const day = date.getDate();
|
|
|
|
+ return `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`;
|
|
|
|
+ },
|
|
|
|
+ reportDateOnConfirm(date) {
|
|
|
|
+ this.reportDateShow = false;
|
|
|
|
+ this.reportDate = this.formatDate(date);
|
|
|
|
+ this.getCrewMemberList()
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 选中人员
|
|
|
|
+ chooseSomeoneChanhe(item) {
|
|
|
|
+ const { name, id } = item[0]
|
|
|
|
+ this.$set(this, 'personnelName', name)
|
|
|
|
+ this.$set(this, 'personnelId', id)
|
|
|
|
+ this.getMyPlanProcedureList()
|
|
|
|
+ this.$refs.ChooseSomeone['loadingBtn'] = false
|
|
|
|
+ this.popupShow = false
|
|
|
|
+ },
|
|
|
|
+ clearName() {
|
|
|
|
+ this.$set(this, 'personnelName', '')
|
|
|
|
+ this.$set(this, 'personnelId', '')
|
|
|
|
+ this.getMyPlanProcedureList()
|
|
|
|
+ }
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -130,11 +299,31 @@ export default {
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.vanCellIcon {
|
|
|
|
+ width: 16px;
|
|
|
|
+ height: 24px;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ margin-left: 4px;
|
|
|
|
+}
|
|
|
|
+
|
|
.textDis {
|
|
.textDis {
|
|
width: 320px;
|
|
width: 320px;
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ align-items: center;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
|
|
+
|
|
|
|
+ span:first-child {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: 260px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
.valueCls {
|
|
.valueCls {
|
|
@@ -225,4 +414,5 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-}</style>
|
|
|
|
|
|
+}
|
|
|
|
+</style>
|