| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- <template>
- <view class="">
- <uni-popup ref="popup" type="share" backgroundColor="#fff">
- <view class="select-container">
- <view class="title">
- <text class="btn cancel" @tap="close">取消</text>
- 验收
- <text class="btn confirm" @tap="submit">确定</text>
- </view>
- <uni-forms :modelValue="formData" class="form" label-width='75px'>
- <uni-forms-item label="验收人" name="accepterUserId">
- <uni-data-select v-model="formData.accepterUserId" @change="handleChange" :clear="false"
- :localdata="contactInfoVOS"></uni-data-select>
- </uni-forms-item>
- <uni-forms-item label="验收状态" name="accepterStatus">
- <uni-data-select v-model="formData.accepterStatus" :clear="false"
- :localdata="stateLiist"></uni-data-select>
- </uni-forms-item>
- <uni-forms-item label="验收意见" name="accepterRemark">
- <textarea class="textarea" type="text" v-model="formData.accepterRemark" placeholder="验收意见" />
- </uni-forms-item>
- <PhotoBtn ref="photoRef" />
- </uni-forms>
- </view>
- <u-toast ref="uToast"></u-toast>
- </uni-popup>
- </view>
- </template>
- <script>
- import PhotoBtn from './PhotoBtn.vue';
- import {
- getSalesWorkOrderById,
- checkAndAccept
- } from '@/api/salesServiceManagement/workOrder/index.js'
- export default {
- components: {
- PhotoBtn
- },
- data() {
- return {
- acceptShow: false,
- formData: {
- accepterUserId: '',
- accepterUserName: '',
- accepterRemark: '',
- accepterStatus: '',
- id: ''
- },
- contactInfoVOS: [],
- stateLiist: [{
- value: 1,
- text: '通过'
- },
- {
- value: 0,
- text: '不通过'
- }
- ],
- }
- },
- methods: {
- open(id) {
- this.acceptShow = true;
- this.$refs.popup.open();
- this.formData = {
- accepterUserId: '',
- accepterUserName: '',
- accepterRemark: '',
- accepterStatus: '',
- id,
- }
- this.getDadaList(id);
- console.log(this.formData, 'fffffm')
- },
- async getDadaList(id) {
- const {
- afterSalesDemandVO
- } = await getSalesWorkOrderById(id);
- this.contactInfoVOS = afterSalesDemandVO.contactInfoVOS || [];
- this.contactInfoVOS.map((el) => {
- el.value = el.id;
- el.text = el.contactName;
- })
- console.log(this.contactInfoVOS, 'contactInfoVOS')
- },
- handleChange(e) {
- this.accepterUserName = this.contactInfoVOS.find(el => el.id == e).contactName
- },
- submit() {
- if (!this.formData.accepterUserId) {
- this.$refs.uToast.show({
- type: "warning",
- message: "请选择验收人",
- })
- return;
- }
- if (!this.formData.accepterStatus) {
- this.$refs.uToast.show({
- type: "warning",
- message: "请选择验收状态",
- })
- return;
- }
- let accepterImageUrl = this.$refs.photoRef.getImageData();
- let data = {
- ...this.formData,
- accepterImageUrl
- }
- uni.showLoading({
- title: '加载中'
- })
- checkAndAccept(data).then((res) => {
- this.$emit('getList');
- this.close();
- uni.hideLoading();
- }).then((err) => {
- uni.hideLoading();
- })
- },
- close() {
- this.$refs.popup.close();
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .select-container {
- min-height: 60vh;
- .title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 100rpx;
- line-height: 100rpx;
- text-align: center;
- background-color: $j-primary-border-green;
- font-weight: bold;
- padding: 0 20rpx;
- position: relative;
- font-size: 32rpx;
- color: #fff;
- .btn {
- width: 80rpx;
- height: 32rpx;
- display: inline-block;
- font-size: 30rpx;
- border: 1px solid #fff;
- text-align: center;
- line-height: 30rpx;
- margin: 0;
- }
- }
- .form {
- padding: 20rpx 14rpx 0;
- /deep/ .uni-forms-item__label {
- font-size: 28rpx;
- }
- .textarea {
- border: 1px solid #ddd;
- }
- }
- }
- </style>
|