|
@@ -2,17 +2,27 @@
|
|
|
<div class="flexCoum">
|
|
|
<van-nav-bar title="今日计划" left-text="返回" @click-left="back" fixed left-arrow />
|
|
|
<div class="seachPlan">
|
|
|
- <van-search
|
|
|
+ <!-- <van-search
|
|
|
v-model="searchValue"
|
|
|
placeholder="请输入搜索关键词"
|
|
|
clearable
|
|
|
@input="debouncedPlanSeach"
|
|
|
@search="debouncedPlanSeach"
|
|
|
@clear="debouncedPlanSeach"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
+ <van-search v-model="searchValue" placeholder="请输入" @input="debouncedPlanSeach" @search="debouncedPlanSeach" @clear="debouncedPlanSeach">
|
|
|
+ <template #left>
|
|
|
+ <div class="searchDropdownMenu">
|
|
|
+ <van-dropdown-menu>
|
|
|
+ <van-dropdown-item v-model="searchTypeValue" :options="searchTypeList" />
|
|
|
+ </van-dropdown-menu>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </van-search>
|
|
|
</div>
|
|
|
<div class="todayPlan flexCoum-box">
|
|
|
- <PlanComponent :titleText="'今日计划'" :planList="planList" v-if="planList.length > 0" @planClick="getPlanList"></PlanComponent>
|
|
|
+ <PlanComponent :titleText="'今日计划'" :planList="planList" v-if="planList.length > 0" @planClick="getPlanList">
|
|
|
+ </PlanComponent>
|
|
|
<van-empty description="暂无数据" v-else />
|
|
|
</div>
|
|
|
</div>
|
|
@@ -28,8 +38,16 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
planList: [], // 今日计划数据
|
|
|
+ searchTypeList: [
|
|
|
+ { text: '排产工单号', value: 1 },
|
|
|
+ { text: '项目名称', value: 2 },
|
|
|
+ { text: '产品名称', value: 3 },
|
|
|
+ { text: '订单号', value: 4 },
|
|
|
+ { text: '工序', value: 5 },
|
|
|
+ ],
|
|
|
+ searchTypeValue: 1,
|
|
|
searchValue: '',
|
|
|
- debouncedPlanSeach: () => {},
|
|
|
+ debouncedPlanSeach: () => { },
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -65,46 +83,46 @@ export default {
|
|
|
pageIndex: 0,
|
|
|
pageSize: 10000,
|
|
|
planType: 0,
|
|
|
- isMob:1,
|
|
|
- searchType: 5,
|
|
|
+ isMob: 1,
|
|
|
+ searchType: this.searchTypeValue,
|
|
|
searchValue: this.searchValue,
|
|
|
// date: this.getNowFormatDate()
|
|
|
})
|
|
|
- .then(res => {
|
|
|
- if (res.code == "ok") {
|
|
|
- res.data.records.forEach(item => { item.flg = false })
|
|
|
- // this.planList = res.data.records;
|
|
|
- this.planList = []
|
|
|
- this.planListCopy = []
|
|
|
- // res.data.records.forEach((item => {
|
|
|
- // const newProgress = item.progress && item.progress.split('%')[0]
|
|
|
- // const progressFlag = newProgress ? (newProgress > 0 && newProgress < 100) ? true : false : false
|
|
|
- // if(item.progress) {
|
|
|
- // item.newProgress = newProgress
|
|
|
- // }
|
|
|
- // const { hasAllocation, hasAllAllocation } = item
|
|
|
- // if(hasAllocation && !hasAllAllocation) {
|
|
|
- // item.backgroundClass = 'blues'
|
|
|
- // return
|
|
|
- // }
|
|
|
- // if(progressFlag) {
|
|
|
- // item.backgroundClass = 'reds'
|
|
|
- // return
|
|
|
- // }
|
|
|
- // if(hasAllocation && hasAllAllocation) {
|
|
|
- // item.backgroundClass = 'greens'
|
|
|
- // return
|
|
|
- // }
|
|
|
- // }))
|
|
|
- setTimeout(() => {
|
|
|
- this.$set(this, 'planList', res.data.records)
|
|
|
- }, 100)
|
|
|
- this.$toast.clear();
|
|
|
- } else {
|
|
|
- this.$toast.clear();
|
|
|
- this.$toast.fail(res.msg);
|
|
|
- }
|
|
|
- }).catch(err => { this.$toast.clear(); });
|
|
|
+ .then(res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ res.data.records.forEach(item => { item.flg = false })
|
|
|
+ // this.planList = res.data.records;
|
|
|
+ this.planList = []
|
|
|
+ this.planListCopy = []
|
|
|
+ // res.data.records.forEach((item => {
|
|
|
+ // const newProgress = item.progress && item.progress.split('%')[0]
|
|
|
+ // const progressFlag = newProgress ? (newProgress > 0 && newProgress < 100) ? true : false : false
|
|
|
+ // if(item.progress) {
|
|
|
+ // item.newProgress = newProgress
|
|
|
+ // }
|
|
|
+ // const { hasAllocation, hasAllAllocation } = item
|
|
|
+ // if(hasAllocation && !hasAllAllocation) {
|
|
|
+ // item.backgroundClass = 'blues'
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if(progressFlag) {
|
|
|
+ // item.backgroundClass = 'reds'
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if(hasAllocation && hasAllAllocation) {
|
|
|
+ // item.backgroundClass = 'greens'
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // }))
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$set(this, 'planList', res.data.records)
|
|
|
+ }, 100)
|
|
|
+ this.$toast.clear();
|
|
|
+ } else {
|
|
|
+ this.$toast.clear();
|
|
|
+ this.$toast.fail(res.msg);
|
|
|
+ }
|
|
|
+ }).catch(err => { this.$toast.clear(); });
|
|
|
},
|
|
|
// 返回当天的日期 格式:yyyy-MM-dd
|
|
|
getNowFormatDate() {
|
|
@@ -130,11 +148,26 @@ export default {
|
|
|
* {
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
+
|
|
|
.seachPlan {
|
|
|
padding-top: 46px;
|
|
|
}
|
|
|
+
|
|
|
.todayPlan {
|
|
|
height: 100%;
|
|
|
background-color: #F4F4F4;
|
|
|
}
|
|
|
+
|
|
|
+.searchDropdownMenu {
|
|
|
+ width: 120px;
|
|
|
+ padding: 0 10px 0 0;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .van-dropdown-menu__bar {
|
|
|
+ box-shadow: none;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .van-dropdown-item__option {
|
|
|
+ padding: 10px 20px;
|
|
|
+}
|
|
|
</style>
|