123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396 |
- <template>
- <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
- <cus-header title='故障报修'></cus-header>
- <div class="box">
- <div class="b_title">
- 故障信息
- <div class="b_status" :class="{'djj':dto.status===1,'yjj':dto.status===0}">{{dto.status===0?'已解决':'未解决'}}</div>
- </div>
- <div class="bs_item">
- <div class="left">项目订单号</div>
- <div class="right">{{'PO0098877666'}}</div>
- </div>
- <div class="bs_item">
- <div class="left">报修地点</div>
- <div class="right">{{'长鑫科技集团股份有限公司'}}</div>
- </div>
- <div class="bs_item">
- <div class="left">产品名称</div>
- <div class="right">{{'高温罩'}}</div>
- </div>
- <div class="bs_item">
- <div class="left">产品编号</div>
- <div class="right">{{'GRT9988811'}}</div>
- </div>
- <div class="bs_item">
- <div class="left">故障发生时间</div>
- <div class="right">{{'2025-03-11 13:00'}}</div>
- </div>
- <div class="bs_item">
- <div class="left">故障类型</div>
- <div class="right">{{'类型A'}}</div>
- </div>
- <div class="bs_item">
- <div class="left">报修人员</div>
- <div class="right">{{'王安宇'}}</div>
- </div>
- <div class="bs_item">
- <div class="left">报修时间</div>
- <div class="right">{{'2025-03-12 13:00'}}</div>
- </div>
- <div class="bs_item">
- <div class="left">故障描述</div>
- <div class="right">{{'故障描述故障描述'}}</div>
- </div>
- </div>
- <div class="box">
- <div class="b_title">故障照片</div>
- <div style="padding-top: 24rpx;">
- <u-upload width="180" height="180"
- :fileList="fileList"
- @afterRead="afterRead"
- @delete="deletePic"
- multiple
- :maxCount="5"
- ></u-upload>
- </div>
- </div>
- <div class="box">
- <div class="b_title">故障处理</div>
- <div class="b_item">
- <div class="left">问题状态</div>
- <div class="right">
- <u-radio-group v-model="params.aaa" :size="30" :iconSize="30">
- <u-radio :labelSize="26" :label="0">已解决</u-radio>
- <u-radio :labelSize="26" :label="1">未解决</u-radio>
- </u-radio-group>
- </div>
- </div>
- <div class="b_item">
- <div class="left">故障原因</div>
- <div class="right">
- <input type="text" placeholder="请输入故障原因" placeholder-class="inp_ph" v-model="params.bbb">
- </div>
- </div>
- <div class="b_item">
- <div class="left">维修开始时间</div>
- <div class="right select" @tap="handleSelect(1)">
- <text>{{startDateText}}</text>
- <image :src="imgBase+'operation/arrow_right.png'" mode="widthFix"></image>
- </div>
- </div>
- <div class="b_item">
- <div class="left">维修结束时间</div>
- <div class="right select" @tap="handleSelect(2)">
- <text>{{endDateText}}</text>
- <image :src="imgBase+'operation/arrow_right.png'" mode="widthFix"></image>
- </div>
- </div>
- <div class="b_item">
- <div class="left">维修人员</div>
- <div class="right">
- <input type="text" placeholder="请输入维修人员" placeholder-class="inp_ph" v-model="params.eee">
- </div>
- </div>
- <div class="b_item2">
- <div class="top">维修描述</div>
- <div class="bottom">
- <u--textarea v-model="dto.fff" placeholder="请输入维修描述" placeholder-class="inp_ph2" border="none" height="110"></u--textarea>
- </div>
- </div>
- </div>
- <div class="bottom_btn">
- <div class="btn" @tap="submit">提交</div>
- <!-- <div class="btn" @tap="back">返回</div> -->
- </div>
- <u-datetime-picker :itemHeight="88" :show="show1" v-model="dto.ccc" mode="date" title="维修开始时间"
- @cancel="show1=false" @confirm="e=>confirm(e,1,'ccc','startDateText')" :immediateChange="true" :minDate="minDate" :maxDate="maxDate"></u-datetime-picker>
- <u-datetime-picker :itemHeight="88" :show="show2" v-model="dto.ccc" mode="date" title="维修结束时间"
- @cancel="show2=false" @confirm="e=>confirm(e,2,'ddd','endDateText')" :immediateChange="true" :minDate="minDate" :maxDate="maxDate"></u-datetime-picker>
- </view>
- </template>
- <script>
- export default {
- data(){
- return {
- dto:{
- status:1
- },
- params:{
- aaa:'',
- bbb:'',
- ccc:'',
- ddd:'',
- eee:'',
- fff:''
- },
- fileList:[],
- show1:false,
- show2:false,
- startDateText:'请输入维修开始时间',
- endDateText:'请输入维修结束时间',
- minDate:'',
- maxDate:'',
- }
- },
- mounted() {
- let d = new Date();
- this.minDate = new Date(d.getFullYear()-3,d.getMonth()+1,d.getDate()).getTime();
- this.maxDate = new Date().getTime();
- },
- methods:{
- handleSelect(type){
- this['show'+type] = true;
- },
- confirm(e,type,key,param){
- this[param] = new Date(e.value).Format('yyyy-MM-dd');
- this.params[key] = new Date(e.value).Format('yyyy-MM-dd');
- this['show'+type] = false;
- },
- submit(){
- uni.navigateBack()
- },
- back(){
- uni.navigateBack()
- },
- // 删除图片
- deletePic(event) {
- this.fileList.splice(event.index, 1);
- },
- // 新增图片
- async afterRead(event) {
- // 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
- let lists = [].concat(event.file);
- let fileListLen = this.fileList.length;
- lists.map((item) => {
- this.fileList.push({
- ...item,
- status: "uploading",
- message: "上传中",
- });
- });
- for (let i = 0; i < lists.length; i++) {
- const result = await this.uploadFilePromise(lists[i].url);
- let item = this.fileList[fileListLen];
- this.fileList.splice(
- fileListLen,
- 1,
- Object.assign(item, {
- status: "success",
- message: "",
- url: result,
- })
- );
- fileListLen++;
- }
- },
- uploadFilePromise(url) {
- return new Promise((resolve, reject) => {
- let a = uni.uploadFile({
- url: "http://192.168.2.21:7001/upload", // 仅为示例,非真实的接口地址
- filePath: url,
- name: "file",
- formData: {
- user: "test",
- },
- success: (res) => {
- setTimeout(() => {
- resolve(res.data.data);
- }, 1000);
- },
- });
- });
- },
- }
- }
- </script>
- <style>
- .inp_ph{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #B9C0C8;
- line-height: 40rpx;
- text-align: right;
- }
- .inp_ph2{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #B9C0C8;
- line-height: 40rpx;
- text-align: left;
- }
- </style>
- <style scoped lang="less">
- ::v-deep .u-radio:last-child{
- margin-left: 93rpx !important;
- }
- ::v-deep .u-upload__button .u-icon__icon{
- font-size: 48rpx !important;
- }
-
- .page{
- padding:0 24rpx 168rpx;
- background: #F4F8FB;
-
- .box{
- background: #FFFFFF;
- border-radius: 16rpx;
- margin-top: 20rpx;
- padding: 36rpx 24rpx;
-
- .b_title{
- padding-left: 16rpx;
- position: relative;
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 32rpx;
- color: #1D2129;
- line-height: 32rpx;
- &::before{
- content: '';
- width: 6rpx;
- height: 32rpx;
- background: #2E69EB;
- position: absolute;
- left: 0;
- top: 50%;
- margin-top: -16rpx;
- }
- .b_status{
- width: 104rpx;
- height: 48rpx;
- border-radius: 6rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 26rpx;
- line-height: 48rpx;
- text-align: center;
- position: absolute;
- left: 168rpx;
- top: 50%;
- margin-top: -24rpx;
- &.djj{
- color: #FEA400;
- background: rgba(254,164,0,0.08);
- }
- &.yjj{
- color: #05C17F;
- background: rgba(20,204,140,0.08);
- }
- }
- }
-
- .bs_item{
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-top: 36rpx;
- .left{
- width: 180rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 26rpx;
- color: #86909C;
- line-height: 26rpx;
- }
- .right{
- width: calc(100% - 180rpx);
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 26rpx;
- color: #1D2129;
- line-height: 26rpx;
- text-align: right;
- }
- }
-
- .b_item{
- display: flex;
- align-items: center;
- justify-content: space-between;
- box-shadow: inset 0rpx -1rpx 0rpx 0rpx #ECEEF5;
- padding: 24rpx 0;
- .left{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 30rpx;
- color: #1D2129;
- line-height: 42rpx;
- }
- .right{
- input{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #4E5969;
- line-height: 40rpx;
- text-align: right;
- }
- &.select{
- display: flex;
- align-items: center;
- text{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #B9C0C8;
- line-height: 40rpx;
- }
- image{
- width: 24rpx;
- height: 24rpx;
- margin-left: 10rpx;
- }
- }
- }
- }
- .b_item2{
- .top{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 30rpx;
- color: #1D2129;
- line-height: 42rpx;
- padding-top: 24rpx;
- }
- .bottom{
- padding-bottom: 24rpx;
- input{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #4E5969;
- line-height: 40rpx;
- }
- }
- }
- }
-
- .bottom_btn{
- width: 100%;
- height: 148rpx;
- padding: 20rpx 48rpx;
- box-sizing: border-box;
- background: #FFFFFF;
- position: fixed;
- bottom: 0;
- left: 0;
- z-index: 9;
- .btn{
- width: 100%;
- height: 88rpx;
- background: #2E69EB;
- border-radius: 16rpx;
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 32rpx;
- color: #FFFFFF;
- line-height: 88rpx;
- text-align: center;
- }
- }
- }
- </style>
|