| | |
| | | <template> |
| | | <view class="container"> |
| | | <view v-if="authIncludes('eam:reportRepair:add')" class="container"> |
| | | <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> |
| | | <block slot="backText">返回</block> |
| | | <block slot="content">新增-报修</block> |
| | |
| | | |
| | | <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> |
| | | <uni-group top="1"> |
| | | <!-- <uni-forms-item required name="num" label="设备编号:"> |
| | | <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" |
| | | placeholder="请选择" /> |
| | | </uni-forms-item> --> |
| | | |
| | | <uni-forms-item required :label-width="100" name="num" label="设备编号:"> |
| | | <uni-easyinput v-model=" formData.numSear" placeholder="请选择" :disabled="true" suffixIcon="search" |
| | | <uni-easyinput v-model="formData.numSear" placeholder="请选择" :disabled="true" suffixIcon="search" |
| | | @iconClick="OnenterpriseId()" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item required :label-width="100" name="name" label="故障简称:"> |
| | |
| | | <uni-easyinput v-model="formData.faultType" :disabled='true' /> |
| | | </uni-forms-item> |
| | | <uni-forms-item required :label-width="100" name="faultDescription" label="故障描述:"> |
| | | <uni-easyinput v-model="formData.faultDescription" :disabled='true' /> |
| | | <uni-easyinput v-model="formData.faultDescription" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item name="outNum" label="报修图片:"> |
| | | <uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" :sourceType="sourceType" |
| | | @select="select" @progress="progress" @success="success" @fail="fail" @delete="deletea" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item required name="name" :label-width="100" label="是否停机:"> |
| | | <uni-data-select v-model="formData.breakdownFlag" :localdata="isTrueList" @change="changeisTrueList" |
| | |
| | | <uni-datetime-picker type="datetime" v-model="formData.loadTime" /> |
| | | </uni-forms-item> |
| | | |
| | | <uni-forms-item name="outNum" label="报修图片:"> |
| | | <uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" :sourceType="sourceType" |
| | | @select="select" @progress="progress" @success="success" @fail="fail" @delete="deletea" /> |
| | | </uni-forms-item> |
| | | |
| | | <uni-forms-item name="faultDescription" label="备注:"> |
| | | <!-- <uni-forms-item name="faultDescription" label="备注:"> |
| | | <uni-easyinput type="textarea" v-model="formData.remark" /> |
| | | </uni-forms-item> |
| | | </uni-forms-item> --> |
| | | </uni-group> |
| | | </uni-forms> |
| | | |
| | |
| | | |
| | | |
| | | </view> |
| | | <view v-else class="container"> |
| | | <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> |
| | | <block slot="backText">返回</block> |
| | | <block slot="content">新增-报修</block> |
| | | </cu-custom> |
| | | |
| | | <view class="padding flex flex-direction"> |
| | | 当前用户没有操作权限 |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; |
| | | export default { |
| | | mixins: [MescrollMixin], // 使用mixin |
| | | |
| | | data() { |
| | | return { |
| | | // 图片回显 |
| | |
| | | equipmentList: [], |
| | | isTrueList: [{ |
| | | text: "是", |
| | | value: "0" |
| | | value: 0 |
| | | }, |
| | | { |
| | | text: "否", |
| | | value: "1" |
| | | value: 1 |
| | | } |
| | | ], |
| | | type: 'top', |
| | |
| | | faultNameList: [], |
| | | faultName: '', |
| | | faultType: '', |
| | | breakdownFlag: '', |
| | | breakdownFlag: 1, |
| | | loadTime: Date.now(), |
| | | faultDescription: '' |
| | | }, |
| | |
| | | announcement1: [], |
| | | msg1Count: 0, |
| | | msg2Count: 0, |
| | | msg1Title: "" |
| | | msg1Title: "", |
| | | equipmentId: '', |
| | | AuthLsit: [] |
| | | } |
| | | }, |
| | | mounted() { |
| | | console.log('从 store 获取的 auth:', this.$store.getters.getAuth) |
| | | }, |
| | | computed: { |
| | | authList() { |
| | | return this.$store.getters.getAuth || [] |
| | | }, |
| | | top() { |
| | | return this.CustomBar * 2 + 130 |
| | | }, |
| | |
| | | this.getSera() |
| | | }, |
| | | created() { |
| | | // this.getEquipment(); |
| | | |
| | | this.getfaultReasonList(); |
| | | }, |
| | | methods: { |
| | | authIncludes(code) { |
| | | return this.authList.some(auth => auth.action === code) |
| | | }, |
| | | getSera() { |
| | | //联网加载数据 |
| | | this.$http.get(this.url.part, { |
| | |
| | | console.log(this.announcement1); |
| | | //设置列表数据 |
| | | if (res.data.success) { |
| | | this.equipmentId = this.announcement1.id |
| | | this.formData.numSear = this.announcement1.equipmentCode + '[' + this.announcement1 |
| | | .equipmentName + |
| | | ']' |
| | |
| | | for (let i = 0; i < this.formData.faultNameList.length; i++) { |
| | | if (this.formData.faultNameList[i].id === value) { |
| | | this.formData.faultType = this.formData.faultNameList[i].faultCategory_dictText |
| | | this.formData.faultDescription = this.formData.faultNameList[i].faultDescription |
| | | // this.formData.faultDescription = this.formData.faultNameList[i].faultDescription |
| | | } |
| | | |
| | | } |
| | |
| | | }, |
| | | |
| | | changeisTrueList(e) { |
| | | console.log(e) |
| | | this.formData.breakdownFlag = e; |
| | | }, |
| | | select(e) { |
| | |
| | | console.log('删除图片', e); |
| | | }, |
| | | ProductionTask() { |
| | | if (this.formData.num == 0 || this.formData.num == undefined) { |
| | | console.log(this.formData.num) |
| | | |
| | | |
| | | if (this.formData.num === undefined || this.formData.num === null || this.formData.num === '') { |
| | | uni.showToast({ |
| | | icon: "none", |
| | | title: '设备编号为空!', |
| | | duration: 2000 |
| | | }); |
| | | return false |
| | | return false; |
| | | } |
| | | |
| | | |
| | | if (this.formData.faultName == 0 || this.formData.faultName == undefined) { |
| | | uni.showToast({ |
| | | icon: "none", |
| | |
| | | }); |
| | | return false |
| | | } |
| | | if (this.formData.faultDescription == 0 || this.formData.faultDescription == undefined) { |
| | | uni.showToast({ |
| | | icon: "none", |
| | | title: '故障描述为空!', |
| | | duration: 2000 |
| | | }); |
| | | return false |
| | | } |
| | | |
| | | if (this.formData.breakdownFlag === undefined || this.formData.breakdownFlag === null) { |
| | | uni.showToast({ |
| | | icon: "none", |
| | | title: '是否停机为空!', |
| | | duration: 2000 |
| | | }); |
| | | return false; |
| | | } |
| | | |
| | | // 请求开始 增加遮罩层 |
| | | uni.showLoading({ |
| | | mask: true, |
| | |
| | | title: '提交成功', |
| | | duration: 2000 |
| | | }); |
| | | this.$Router.replaceAll({ |
| | | name: 'index' |
| | | console.log(this.equipmentId) |
| | | // uni.reLaunch({ |
| | | // url: `/pages/reportRepair/reportRepairList/reportRepairList?equipmentId=${this.equipmentId}` |
| | | // }) |
| | | uni.reLaunch({ |
| | | url: '/pages/index/index' |
| | | }) |
| | | |
| | | } else { |
| | | uni.showToast({ |
| | | icon: "error", |
| | | title: res.data.message, |
| | | duration: 2000 |
| | | }); |
| | | } |
| | | }).catch(() => { |
| | | this.$tip.loaded(); |
| | | uni.hideLoading(); |
| | | uni.showToast({ |
| | | icon: "error", |
| | | title: '提交失败', |
| | | title: '网络连接失败', |
| | | duration: 2000 |
| | | }); |
| | | }); |
| | |
| | | } |
| | | |
| | | .popupView { |
| | | margin-top: 85px; |
| | | margin-top: 45px; |
| | | height: auto; |
| | | } |
| | | </style> |