123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315 |
- <template>
- <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
- <cus-header title='故障工单'></cus-header>
- <div class="status">
- <div class="pre" :class="{'active':sidx===0}" @tap="changeStatus('',0)">全部</div>
- <div class="pre" :class="{'active':sidx===1}" @tap="changeStatus(0,1)">待解决</div>
- <div class="pre" :class="{'active':sidx===2}" @tap="changeStatus(1,2)">已解决</div>
- </div>
- <div class="query">
- <!-- <div class="pre" @tap="selectQuery(1)">
- <span>{{typeText}}</span>
- <u-icon name="arrow-down-fill" color="#C0C4CC" size="20rpx"></u-icon>
- </div> -->
- <div class="pre" @tap="selectQuery(2)">
- <span>{{timeText}}</span>
- <u-icon name="arrow-down-fill" color="#C0C4CC" size="20rpx"></u-icon>
- </div>
- <div class="pre" @tap="selectQuery(3)">
- <span>{{placeText}}</span>
- <u-icon name="arrow-down-fill" color="#C0C4CC" size="20rpx"></u-icon>
- </div>
- </div>
- <div class="boxs" v-if="dataList.length">
- <div class="item" v-for="(item,index) in dataList" :key="index">
- <div class="left">
- <div class="name">{{item.customer||''}}</div>
- <p>故障类型<span>{{item.typeName}}</span></p>
- <p>故障描述<span>{{item.repairDesc||''}}</span></p>
- <p>报修时间<span>{{item.createDate||''}}</span></p>
- </div>
- <div class="right">
- <div class="top" :class="{'djj':item.status===0,'yjj':item.status===1}">{{item.status===0?'待解决':'已解决'}}</div>
- <div class="bottom" @tap="toDetail(item)">查看</div>
- </div>
- </div>
- </div>
- <template v-else>
- <page-empty :height="'calc(100vh - 140px)'"></page-empty>
- </template>
- <u-picker :itemHeight="88" :show="show1" :columns="columns1" keyName="label" title="故障类型"
- @cancel="show1=false" @confirm="e=>confirm(e,1)" :immediateChange="true"></u-picker>
- <u-datetime-picker :itemHeight="88" :show="show2" v-model="queryParams.month" mode="date" title="报修时间"
- @cancel="show2=false" @confirm="e=>confirm(e,2)" :immediateChange="true" :minDate="minDate" :maxDate="maxDate"></u-datetime-picker>
- <u-picker :itemHeight="88" :show="show3" :columns="columns3" title="报修地点"
- @cancel="show3=false" @confirm="e=>confirm(e,3)" :immediateChange="true"></u-picker>
- </view>
- </template>
- <script>
- import pageEmpty from '@/components/pageEmpty/index.vue'
- export default {
- components:{
- pageEmpty
- },
- data(){
- return {
- sidx:0,
- typeText:'故障类型',
- timeText:'报修时间',
- placeText:'报修地点',
- queryParams:{
- page:1,
- limit:10,
- createStartDate:'',
- createEndDate:'',
- customer:'',
- status:''
- },
- show1:false,
- show2:false,
- show3:false,
- columns1:[[
- {value:0,label:'类型1'},
- {value:1,label:'类型2'}
- ]],
- columns3:[],
- minDate:'',
- maxDate:'',
- isOver:false,
- dataList:[]
- }
- },
- onReachBottom() {
- if(this.isOver) return
- this.getList();
- },
- async onShow() {
- this.init()
- this.getCustomerList();
- await this.getTypeList();
- this.getList();
- let d = new Date();
- this.minDate = new Date(d.getFullYear()-3,d.getMonth()+1,d.getDate()).getTime();
- this.maxDate = new Date().getTime();
- },
- methods:{
- getTypeList(){
- return new Promise((resolve,reject)=>{
- this.$api.get('/sys/dict/data/getListByType/wms_operation_category').then(res=>{
- if(res.data.code===0){
- this.typeList = res.data.data;
- resolve()
- }else this.$showToast(res.data.msg)
- })
- })
- },
- getCustomerList(){
- this.$api.get('/wms/project/getCustomerList',{page:1,limit:-1}).then(res=>{
- if(res.data.code!==0) return this.$showToast(res.data.msg)
- this.columns3 = [res.data.data]
- })
- },
- init(){
- this.sidx = 0;
- this.typeText = '故障类型';
- this.timeText = '报修时间';
- this.placeText = '报修地点';
- this.queryParams = {
- page:1,
- limit:10,
- createStartDate:'',
- createEndDate:'',
- customer:'',
- status:''
- };
- this.isOver = false;
- this.dataList = [];
- },
- changeStatus(status,idx){
- this.init();
- this.sidx = idx;
- this.queryParams.status = status;
- this.getList();
- },
- getList(){
- this.$api.get('/wms/order/operation/page',this.queryParams).then(res=>{
- if(res.data.code===0){
- if(this.dataList.length<res.data.data.total){
- this.queryParams.page++;
- this.dataList = [...this.dataList,...res.data.data.list];
- this.dataList.forEach(d=>{
- d.typeName = this.typeList.find(t=>t.dictValue==d.optCategory)?.dictLabel;
- })
- }else this.isOver = true
- }else this.$showModal(res.data.msg)
- });
- },
- selectQuery(type){
- this['show'+type] = true;
- },
- toDetail(item){
- uni.navigateTo({
- url:'/pagesOperation/workorder/detail?id='+item?.id
- })
- },
- confirm(e,type){
- this.init();
- if(type==1){
- this.typeText = e.value[0].label;
- this.queryParams.type = e.value[0].value;
- this.show1 = false;
- }else if(type==2){
- this.timeText = new Date(e.value).Format('yyyy-MM-dd');
- this.queryParams.createStartDate = new Date(e.value).Format('yyyy-MM-dd');
- this.queryParams.createEndDate = new Date(new Date().setDate(new Date(this.queryParams.createStartDate).getDate()+1)).Format('yyyy-MM-dd');
- this.show2 = false;
- }else if(type==3){
- this.placeText = e.value[0];
- this.queryParams.customer = e.value[0];
- this.show3 = false;
- }
- this.getList();
- }
- }
- }
- </script>
- <style scoped lang="less">
- .page{
- padding-bottom: 40rpx;
- background: #F4F8FB;
-
- .status{
- width: 100%;
- height: 90rpx;
- background: #FFFFFF;
- box-shadow: inset 0rpx -1rpx 0rpx 0rpx #ECEEF5;
- display: flex;
- .pre{
- width: calc(100% / 3);
- height: 90rpx;
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 30rpx;
- color: #1D2129;
- line-height: 90rpx;
- text-align: center;
- position: relative;
- &.active{
- font-weight: bold;
- font-size: 32rpx;
- color: #2E69EB;
- &::after{
- content: '';
- width: 59rpx;
- height: 5rpx;
- background: #2E69EB;
- position: absolute;
- bottom: 0;
- left: 50%;
- margin-left: -30rpx;
- }
- }
- }
- }
-
- .query{
- width: 100%;
- height: 88rpx;
- background: #FFFFFF;
- display: flex;
- .pre{
- width: calc(100% / 2);
- height: 88rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- span{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 26rpx;
- color: #86909C;
- line-height: 26rpx;
- margin-right: 12rpx;
- }
- }
- }
-
- .boxs{
- padding: 0 24rpx;
- margin-top: 20rpx;
- .item{
- background: #FFFFFF;
- box-shadow: inset 0rpx -1rpx 0rpx 0rpx #ECEEF5;
- padding: 36rpx 27rpx;
- display: flex;
- .left{
- width: calc(100% - 115rpx);
- padding-right: 20rpx;
- box-sizing: border-box;
- .name{
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 30rpx;
- color: #1D2129;
- line-height: 42rpx;
- text-align: left;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- p{
- margin-top: 36rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 26rpx;
- color: #86909C;
- line-height: 26rpx;
- span{
- color: #1D2129;
- margin-left: 64rpx;
- }
- }
- }
- .right{
- width: 115rpx;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .top{
- width: 104rpx;
- height: 48rpx;
- border-radius: 6rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 26rpx;
- line-height: 48rpx;
- text-align: center;
- &.djj{
- color: #FEA400;
- background: rgba(254,164,0,0.08);
- }
- &.yjj{
- color: #05C17F;
- background: rgba(20,204,140,0.08);
- }
- }
- .bottom{
- width: 115rpx;
- height: 64rpx;
- background: #2E69EB;
- border-radius: 16rpx;
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 28rpx;
- color: #FFFFFF;
- line-height: 64rpx;
- text-align: center;
- }
- }
- }
- }
-
- }
- </style>
|