| | |
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | |
|
| | | </div>
|
| | | <div class="details_dj" v-if="typeView === 1">
|
| | |
|
| | | <div class="details_dj_list"> |
| | | |
| | | <u-swipe-action>
|
| | | <u-swipe-action-item v-for="(item, index) in djData" :key="index" :options="options"
|
| | | @click="dele(item.id)">
|
| | | <scroll-view scroll-y="true" refresher-enabled="true" @scrolltolower="getLists">
|
| | | <u-swipe-action v-for="(item, index) in djData" :key="index">
|
| | | <u-swipe-action-item :options="options" @click="dele(item.id)">
|
| | | <div class="details_dj_list_item">
|
| | | <span>{{ item.attrName }}:{{ item.val }}</span>
|
| | | <span>{{ item.userName }} {{ item.createTime }}</span>
|
| | | </div>
|
| | | </u-swipe-action-item>
|
| | | </u-swipe-action>
|
| | | </scroll-view>
|
| | | </div>
|
| | | </div>
|
| | | <!-- v-if="info.status === 2 || info.procedureNeedcheck === 1" -->
|
| | |
| | | queryOne,
|
| | | queryList
|
| | | } from '@/util/api/PlanningAPI'
|
| | | import { REGULAR } from '@/util/utils'
|
| | | export default {
|
| | | components: {
|
| | | workOrderInfo
|
| | |
| | | ],
|
| | | form: {
|
| | | time: '',
|
| | | efective: [],
|
| | | defective: [],
|
| | | defectiveName: '',
|
| | | durationName: '0小时0分钟',
|
| | | duration: 0,
|
| | |
| | | typeView: 0,
|
| | | workorderId: '',
|
| | | info: {},
|
| | | feedingData: [
|
| | | // {
|
| | | // id: 0,
|
| | | // materialName: '墙体砖',
|
| | | // procedureName: '压制',
|
| | | // qualityType: 1,
|
| | | // locationName: 'CP-01',
|
| | | // batch: '20230713',
|
| | | // num: 2,
|
| | | // maxNum: 10,
|
| | | // unitAttribute: 1,
|
| | | // unitName: '块'
|
| | | // },
|
| | | ],
|
| | | feedingData: [],
|
| | | options: [{
|
| | | text: '删除',
|
| | | style: {
|
| | | backgroundColor: 'red',
|
| | | }
|
| | | }],
|
| | | arrType: [{
|
| | | name: '计时',
|
| | | type: 1,
|
| | | salary: 1000,
|
| | | },
|
| | | {
|
| | | name: '计件',
|
| | | type: 0,
|
| | | salary: 100
|
| | | },
|
| | | ],
|
| | | arrType: [],
|
| | | // 产出合格/不良
|
| | | produceFrom: {
|
| | | qualifiedId: '',
|
| | |
| | | undesirableId: '',
|
| | | undesirable: '' // 不良
|
| | | },
|
| | | djData: [{
|
| | | attrName: '出水时间',
|
| | | val: '2022-05-28 16:3',
|
| | | userName: '张三 ',
|
| | | createTime: '2022-05-28 16:32:'
|
| | | }],
|
| | | cateList: [
|
| | | // {
|
| | | // active: false,
|
| | | // name: '毛刺',
|
| | | // num: 0
|
| | | // },
|
| | | ], |
| | | triggered: false, |
| | | finished: true,
|
| | | djData: [],
|
| | | cateList: [],
|
| | | pages: { |
| | | capacity: 10, |
| | | page: 1, |
| | |
| | | this.queryByIds()
|
| | | this.getOrocessRecords()
|
| | | this.getData()
|
| | | uni.$on('spotAdd', () => { |
| | | if (this.typeView == 1) { |
| | | this.pages.page = 1 |
| | | this.pageDJs() |
| | | } |
| | | })
|
| | | },
|
| | | computed: {
|
| | | expectedSalary() {
|
| | |
| | | },
|
| | | clickIten(index) {
|
| | | this.typeView = index
|
| | | if (this.typeView == 1) { |
| | | this.pages.page = 1
|
| | | this.pageDJs()
|
| | | }
|
| | | },
|
| | | timeConfirm({
|
| | | value
|
| | |
| | | if (!num) return |
| | | console.log(Number(this.produceFrom.qualified) + Number(this.produceFrom.undesirable))
|
| | | if ((Number(this.produceFrom.qualified) + Number(this.produceFrom.undesirable)) > this.info.planNum) { |
| | | uni.showToast({ title:'产出数量不能大于计划数量', duration: 2000, icon:'none' })
|
| | | uni.showToast({
|
| | | title: '产出数量不能大于计划数量',
|
| | | duration: 2000,
|
| | | icon: 'none'
|
| | | })
|
| | | return
|
| | | }
|
| | | if (num >= 0) {
|
| | |
| | | } else {
|
| | | this.produceFrom.undesirable = 0
|
| | | } |
| | | uni.showToast({ title:'产出数量不能小于', duration: 2000, icon:'none' }) |
| | | uni.showToast({
|
| | | title: '产出数量不能小于',
|
| | | duration: 2000,
|
| | | icon: 'none'
|
| | | })
|
| | | }
|
| | | },
|
| | | clickPerformanceType(item, index) {
|
| | | this.form.index = index
|
| | | this.form.type = item.type
|
| | | },
|
| | | submit() {},
|
| | | submit() { |
| | | let createUnqualifiedDTOList = this.form.defective.map((item) => { |
| | | return { |
| | | categoryId: item.id, |
| | | unQualifiedNum: item.num |
| | | } |
| | | }) |
| | | let createWorkorderRecordDTO = { |
| | | workorderId: this.workorderId, |
| | | duration: this.form.duration ? this.form.duration : 0, |
| | | qualifiedNum: this.produceFrom.qualified ? this.produceFrom.qualified : 0, |
| | | unQualifiedNum: this.produceFrom.undesirable ? this.produceFrom.undesirable : 0 |
| | | } |
| | | // id: route.query.id |
| | | comfirmDoneStandard({ |
| | | createUnqualifiedDTOList, |
| | | createWorkorderRecordDTO |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | uni.$u.toast('报工成功') |
| | | setTimeout(() => { |
| | | uni.navigateBack({ data: 2}) |
| | | }, 2000) |
| | | } |
| | | }) |
| | | },
|
| | | jumpdj() { |
| | | uni.navigateTo({ |
| | | url: `/pages_adjust/pages/spotCheck/spotCheck?id=${this.workorderId}` |
| | | }) |
| | | },
|
| | | pageDJs() {},
|
| | | getLists() { |
| | | if (!this.finished) { |
| | | return |
| | | } |
| | | this.finished = false |
| | | this.pages.page += 1 |
| | | this.pageDJs() |
| | | },
|
| | | pageDJs() { |
| | | |
| | | pageDJ({
|
| | | capacity: this.pages.capacity,
|
| | | page: this.pages.page,
|
| | | model: {
|
| | | workorderId: this.workorderId
|
| | | }
|
| | | }).then(res => { |
| | | let {data} = res |
| | | if (data.page == 1) { |
| | | this.djData = [] |
| | | } |
| | | this.djData.push(...data.records)
|
| | | // loading.value = false
|
| | | }).catch(err => {
|
| | | // loading.value = false
|
| | | // finished.value = true
|
| | | }) |
| | | .finally(() => { |
| | | this.finished = true |
| | | })
|
| | | },
|
| | | dele(id) {
|
| | | // deletedj(id)
|
| | | // .then(res => {
|
| | | // if (res.code === 200) {
|
| | | // djData.value = []
|
| | | // finished.value = false
|
| | | // page.page = 1
|
| | | // djData.value = []
|
| | | // pageDJs()
|
| | | // }
|
| | | // })
|
| | | deletedj(id)
|
| | | .then(res => {
|
| | | if (res.code === 200) {
|
| | | this.finished = true
|
| | | this.pages.page = 1
|
| | | this.pageDJs()
|
| | | }
|
| | | })
|
| | | },
|
| | | confirm() {
|
| | | console.log('confirm', this.cateList);
|
| | | let isOpen = false
|
| | | this.cateList.forEach((item, index) => {
|
| | | if (item.active) {
|
| | |
| | | }
|
| | | })
|
| | | if (!isOpen) { |
| | | uni.showToast({ title:'请选择不良项', duration: 2000, icon:'none' }) |
| | | uni.showToast({
|
| | | title: '请选择不良项',
|
| | | duration: 2000,
|
| | | icon: 'none'
|
| | | })
|
| | | return |
| | | }
|
| | | let arr = []
|
| | |
| | | this.cateList.forEach((item, index) => {
|
| | | if (item.active) {
|
| | | if (item.num <= 0) { |
| | | uni.showToast({ title:'不良数量必须大于0', duration: 2000, icon:'none' })
|
| | | uni.showToast({
|
| | | title: '不良数量必须大于0',
|
| | | duration: 2000,
|
| | | icon: 'none'
|
| | | })
|
| | | return
|
| | | }
|
| | | total = total += item.num
|
| | |
| | | }
|
| | | })
|
| | | if (total != Number(this.produceFrom.undesirable)) { |
| | | uni.showToast({ title:'不良数必须等于产出不良数', duration: 2000, icon:'none' }) |
| | | uni.showToast({
|
| | | title: '不良数必须等于产出不良数',
|
| | | duration: 2000,
|
| | | icon: 'none'
|
| | | })
|
| | | return |
| | | }
|
| | | this.form.defective = arr
|