minipro_standard/pages_adjust/components/MaterialSelect.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
minipro_standard/pages_adjust/components/user.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
minipro_standard/pages_adjust/pages/processPlan/processPlan.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
minipro_standard/pages_adjust/components/MaterialSelect.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,309 @@ <template> <u-popup :show="show" :round="10" closeable @close="show = false"> <view class="material-content bbox p30 rp"> <view class="tc b f24 c2 mb20">éæ©ç©æ</view> <v-Search @searchInput="searchInput" @submit="submit" :isShow="false" placeholder="æç´¢ç©æåç§°/ç¼ç " /> <div class="content_total">å ±{{form.total}}æ¡æ°æ®</div> <view class="scroll-content"> <!-- refresher-enabled="true" :refresher-triggered="refreshing" @refresherrefresh="onRefresh" --> <scroll-view scroll-y="true" @scrolltolower="loadMore"> <view v-for="(item1, index) in list" :key="index" class="flex mb20" @click="jump(item1)"> <!-- <view class="img36 mr20 pt10"> <u-checkbox-group style="display: block;" name=""> <u-checkbox :checked="item1.isActive"></u-checkbox> </u-checkbox-group> </view> --> <view class="fx1"> <div class="page_content_title_top"> <span>{{ item1.materialName + ' | ' + item1.materialCode }}</span> </div> <div class="page_content_title_bottom"> <span class="green" v-if="item1.qualityType == 0"> åæ ¼ <text class="c1" decode>{{ splite }}</text> </span> <span class="orange" v-else-if="item1.qualityType == 1"> ä¸è¯ <text class="c1" decode>{{ splite }}</text> </span> <span class="red" v-else-if="item1.qualityType == 2"> æ¥åº <text class="c1" decode>{{ splite }}</text> </span> <span v-else> - <text class="c1" decode>{{ splite }}</text> </span> <span> {{item1.procedureName ? item1.procedureName : '-'}} <text class="c1" decode>{{ splite }}</text> </span> <span>{{item1.batch ? item1.batch : '-'}}</span> </div> <div class="mt20 plr25 ptb20 bg_f7 f26"> <div class="c2 mb10"><span class="c6">è´§ä½ï¼</span>{{ item1.locationName }}</div> <div class="c2"><span class="c6">æ°éï¼</span>{{ item1.num }}{{ item1.unitName }}</div> </div> </view> </view> </scroll-view> <!-- <u-list @scrolltoupper="scrolltoupper" @scrolltolower="scrolltolower"> <u-list-item v-for="(item1, index) in list" :key="index"> </u-list-item> </u-list> --> </view> <!-- <view style="height: 98rpx;"></view> --> <!-- <view class=""> <u-safe-bottom></u-safe-bottom> </view> --> <!-- <view class="fixedBottom bottom cY"> <view class="fx1 bbox plr30"> <u-checkbox-group style="display: block;" name="" @change="selectAll()"> <u-checkbox :checked="isAll" label="å ¨é"></u-checkbox> </u-checkbox-group> </view> <view class="submit sbtn_green bbox tc" @click="submitAction">{{ `æäº¤(${totalNum})`}}</view> </view> --> </view> </u-popup> </template> <script> import vSearch from '@/components/Search.vue' import { getStockByPlansForStandard } from '@/util/api/ExWarehouse' export default { name: "selectMaterial", components: { vSearch }, data() { return { show: false, splite: ' | ', form: { capacity: 50, page: 0, total: 0, name: '', smodelLabel: '', categoryId: '' }, list: [], loading: false, finished: false, refreshing: false, total: 0 }; }, props: { deviceId: { type: String, default: '' }, plansId: { type: String, default: '' }, selected: { type: Array, default: [] } }, computed: { all() { for (let i = 0; i < this.list.length; i++) { if (!this.list[i].isActive) { return false } } return true }, totalNum() { let num = 0; this.list.forEach(item => { if (item.isActive) { num += 1 } }) return num; } }, methods: { open() { this.show = true this.refreshing = false this.finished = false this.list = [] this.form.page = 0 this.form.total = 0 this.loadData() }, jump(item) { this.$emit('value', item) this.show = false }, // æç´¢æäº¤ submit() { this.form.page = 0 this.finished = false this.list = [] this.loadData() }, // æç´¢æ¡ searchInput(data) { this.form.page = 0 this.finished = false this.list = [] this.form.name = data this.loadData() }, loadData() { if (!this.finished) { this.loading = true; this.form.page = this.form.page += 1 getStockByPlansForStandard({ capacity: this.form.capacity, page: this.form.page, model: { materialName: this.form.name, deviceId: this.deviceId, plansId: this.plansId, ids: this.selected.length > 0 ? this.selected.join(',') : '' } }).then(res => { if (this.refreshing) { this.list = [] this.refreshing = false; } this.loading = false; if (res.code === 200 && res.data.records && res.data.records.length !== 0) { this.form.total = res.data.total res.data.records.forEach(element => { element.isActive = false }) this.list.push(...res.data.records) } else { this.finished = true; } }).catch(err => { this.loading = false; this.finished = true; if (this.refreshing) { this.list = [] this.refreshing = false; } }) } }, loadMore() { this.pages.page += 1 this.loadData() }, onRefresh() { if (this.refreshing) return this.refreshing = true; this.pages.page = 1 this.loadData() }, selectAll() { this.list.forEach(element => { element.isActive = this.all }) }, submitAction() { this.show = false let arr = [] this.list.forEach(element => { if (element.isActive) { arr.push(element) } }) this.$emit('value', arr) } } } </script> <style lang="scss" scoped> .material-content { display: flex; flex-direction: column; height: 1200rpx; box-sizing: border-box; .scroll-content { height: calc(1100rpx - env(safe-area-inset-bottom)); overflow: scroll; } } .content_total { margin-top: 20rpx; margin-bottom: 20rpx; // padding: 24rpx 30rpx; // background: #F7F7F7; font-size: 24rpx; font-weight: 400; color: #666666; } .page_content_title_top { display: flex; align-items: center; justify-content: space-between; span { &:nth-child(1) { font-size: 30rpx; font-weight: 500; color: #222222; } &:nth-child(2) { flex-shrink: 0; font-size: 24rpx; font-weight: 400; color: #333333; // span { // font-size: 24rpx; // color: $nav-color; // } } } } .page_content_title_bottom { margin-top: 24rpx; span { font-size: 24rpx; font-weight: 400; color: #666666; } } .page_content_title { display: flex; flex-direction: column; margin-bottom: 10rpx; } .bottom { height: 98rpx; .submit { width: 272rpx; height: 98rpx; line-height: 98rpx; } } </style> minipro_standard/pages_adjust/components/user.vue
@@ -5,11 +5,11 @@ </view> <view class="content"> <view class="content_search"> <u-search :showAction="false" placeholder="æç´¢å§å" v-model="keyword"></u-search> <u-search :showAction="false" placeholder="æç´¢å§å" v-model="form.name" @search="searchInput"></u-search> </view> <div class="content_total">å ±{{total}}æ¡æ°æ®</div> <div class="content_total">å ±{{form.total}}æ¡æ°æ®</div> <scroll-view class="content_list" scroll-y> <div class="content_list_item" v-for="(item, index) in indexList" :key="index" @click="getVal(item)"> <div class="content_list_item" v-for="(item, index) in list" :key="index" @click="jump(item)"> <div class="content_list_item_name"> <span>{{item.name}}</span> </div> @@ -20,35 +20,60 @@ </template> <script> import { allUser } from '@/util/api/PlanningAPI' export default { props: { show: Boolean }, data() { return { keyword: '', list: [], loading: false, finished: false, refreshing: false, form: { capacity: 50, page: 0, total: 0, indexList: [] name: '' } }; }, methods: { getVal(item) { // æç´¢æ¡ searchInput(data) { this.form.page = 0 this.finished = false this.list = [] this.loadmore() }, jump(item) { this.$emit('value', item) }, open() { this.indexList = [] this.loadmore() }, scrolltolower() { this.list = [] this.form.page = 0 this.finished = false this.list = [] this.loadmore() }, loadmore() { for (let i = 0; i < 20; i++) { this.indexList.push({ id: i, name: `æä¼ï½ç产é¨ï½${i}` }) allUser({ name: this.form.name }) .then(res => { if (res.code === 200 && res.data && res.data.length !== 0) { this.form.total = res.data.length this.list = res.data } else { this.finished = true; } }).catch(err => { this.loading = false; this.finished = true; if (this.refreshing) { this.list = [] this.refreshing = false; } }) }, close() { this.$emit('close') minipro_standard/pages_adjust/pages/processPlan/processPlan.vue
@@ -44,6 +44,8 @@ <script> import Search from '@/components/Search.vue' import { getList } from "@/util/api/PlanningAPI" export default { components: { Search @@ -71,8 +73,12 @@ }).exec() }) }, onLoad() { this.getLists() }, methods: { clickItem(obj) { uni.$emit('update', {obj}) uni.navigateBack({ delta: 1 }); }, // è·å头é¨ç»ä»¶é«åº¦ @@ -87,85 +93,15 @@ this.lists = [] this.getLists() }, // ç¹å»æ ç¾æç´¢ clickTag(ids) { this.listData.cateIds = ids this.listData.page = 0 this.finished = false this.lists = [] // this.getLists() }, // è·åå表ç»è®¡ pageCounts() { pageCount({ factoryId: this.listData.departIds, procedureIdList: this.listData.procedureIds ? this.listData.procedureIds : [], startDate: this.listData.startDate, endDate: this.listData.endDate, statusList: this.listData.cateIds }).then(res => { if (res.code === 200 && res.data) { this.tagList[0].num = res.data.allNum.toString() this.tagList[1].num = res.data.startNum.toString() this.tagList[2].num = res.data.ingNum.toString() this.tagList[3].num = res.data.endNum.toString() } }) }, // è·åå·¥åæ°æ® getOrganizations() { getOrganization({ type: 1 }).then(res => { if (res.code === 200 && res.data && res.data.length !== 0) { res.data.forEach((item, i) => { item.isActive = i === 0; }) if (res.data.length > 0) { this.factoryList = res.data this.listData.departIds = this.factoryList[0].id this.listData.procedureIds = '' this.finished = false this.getWorkingProcedures(this.factoryList[0].id) this.getLists() this.pageCounts() } } }) }, // è·åå·¥åºæ°æ® getWorkingProcedures(orgId) { this.data = [] getWorkingProcedure({ orgId }) .then(res => { if (res.code === 200 && res.data && res.data.length !== 0) { res.data.forEach((item, i) => { item.isActive = false; }) this.data = res.data } }) }, // æç´¢å¼¹æ¡æäº¤ submit() { let pmodelOrgId = [] this.data.forEach((item) => { if (item.isActive) { pmodelOrgId.push(item.id) } }) this.listData.procedureIds = pmodelOrgId this.listData.page = 0 this.finished = false this.lists = [] // this.getLists() // this.pageCounts() this.pageData.page = 0 this.finished.value = false this.listData.value = [] this.getLists() }, // è·å计ååè¡¨æ°æ® getLists() { console.log('getLists') if (!this.finished) { this.pageData.page = this.pageData.page + 1 this.loading = true minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue
@@ -66,8 +66,8 @@ <text class="green" v-if="item.qualityType == 0">åæ ¼ / </text> <text class="yellow" v-if="item.qualityType == 1">ä¸è¯ / </text> <text class="red" v-if="item.qualityType == 2">æ¥åº / </text> <text>{{ item.locationName }} / </text> <text>{{ item.batch }}</text> <text>{{ item.locationName || '-' }} / </text> <text>{{ item.batch || '-' }}</text> </view> </view> <view class="bg_list_item_num_item_sr"> @@ -75,7 +75,7 @@ placeholder="请è¾å ¥" border="surround" type="number" :customStyle="{width: '180rpx'}" :customStyle="{width: '100%'}" v-model="item.num" @input="inputwl(index)" ></u--input> @@ -213,11 +213,11 @@ <!-- ç产人å --> <user :show="userShow" @close="userShow = false" @value="onConfirm1" /> <!-- çäº§è®¾å¤ --> <u-picker :show="deviceShow" :columns="deviceList" keyName="name" @confirm="onConfirm" @cancel="onCancel"></u-picker> <u-picker :show="deviceShow" :columns="deviceList" keyName="name" @confirm="onConfirm" @cancel="deviceShow = false"></u-picker> <!-- æ¶é´ --> <u-picker :show="TimeShow" :columns="columns" @confirm="onConfirm2" @cancel="TimeShow = false"></u-picker> <!-- ç©æ --> <selectMaterial ref="selectMaterial" @selectAction="getValue" /> <MaterialSelect ref="MaterialSelect" :plansId="String(plansId)" :selected="ids" :deviceId="String(deviceId)" @value="getValue" /> <!-- ä¸è¯é¡¹ --> <u-popup :show="show" @close="show = false" :round="8" closeable zIndex="20000"> <view class="rp p40 contanir"> @@ -225,7 +225,7 @@ <view class="content bl_list"> <div class="bl_list_item" v-for="(item, i) in cateList" :key="i" @click="changeChecked(i)"> <div class="bl_list_item_left"> <u-checkbox-group> <u-checkbox-group @change="poorSelection(item.active, i)"> <u-checkbox :checked="item.active" :label="item.name" :name="item.name"></u-checkbox> </u-checkbox-group> </div> @@ -244,11 +244,13 @@ <script> import user from '../../components/user.vue' import selectMaterial from '@/components/selectMaterial.vue' import MaterialSelect from '../../components/MaterialSelect.vue' import { mapState } from 'vuex' import { getDeviceByCondition, getFindAll, queryOne, queryList, autoWorkReport, getIdPlansExt, categoryExtList } from '@/util/api/PlanningAPI' export default { components: { user, selectMaterial MaterialSelect }, data() { return { @@ -295,21 +297,22 @@ }; }, computed: { ...mapState(['userInfo']), // é¢è®¡å·¥èµ expectedSalary() { if (this.arrType.length === 0) return 0; if (this.arrType[from.index].type == 0) { if (this.arrType[this.from.index].type == 0) { if (!this.from.qualified) return 0 if (this.arrType[from.index].unqualified == 1) { // æ¯å¦è®¡å ¥ä¸è¯å if (this.arrType[this.from.index].unqualified == 1) { // æ¯å¦è®¡å ¥ä¸è¯å let total = Number(this.from.qualified) + Number(this.from.undesirable) return (total * (this.arrType[from.index].salary / 10 / 10)).toFixed(2) } else { return (Number(this.from.qualified) * (this.arrType[from.index].salary / 10 / 10)).toFixed(2) return (Number(this.from.qualified) * (this.arrType[this.from.index].salary / 10 / 10)).toFixed(2) } } else { if (!this.from.duration) return 0; let h = (this.from.duration / 60 / 60).toFixed(2) return (Number(h) * (this.arrType[from.index].salary / 10 / 10)).toFixed(2) return (Number(h) * (this.arrType[this.from.index].salary / 10 / 10)).toFixed(2) } }, // è¾¾æ ç @@ -317,32 +320,99 @@ if (this.arrType.length === 0) return 0; if (!this.from.qualified && !this.from.undesirable) return 0; if (!this.from.duration) return 0; if (!this.arrType[from.index].num) return 0; if (this.arrType[from.index].unqualified == 1) { // æ¯å¦è®¡å ¥ä¸è¯å if (!this.arrType[this.from.index].num) return 0; if (this.arrType[this.from.index].unqualified == 1) { // æ¯å¦è®¡å ¥ä¸è¯å let a = ((Number(this.from.qualified) + Number(this.from.undesirable)) / (this.from.duration / 3600)).toFixed(2) let b = (this.arrType[from.index].num / (this.arrType[from.index].times / 3600)).toFixed(2) let b = (this.arrType[this.from.index].num / (this.arrType[this.from.index].times / 3600)).toFixed(2) return ((Number(a) / Number(b)) * 100).toFixed(2) } else { let a = (this.from.qualified / (this.from.duration / 3600)).toFixed(2) let b = (this.arrType[from.index].num / (this.arrType[from.index].times / 3600)).toFixed(2) let b = (this.arrType[this.from.index].num / (this.arrType[this.from.index].times / 3600)).toFixed(2) return ((Number(a) / Number(b)) * 100).toFixed(2) } } }, onReady() { this.from.userId = this.userInfo.id this.form.userName = this.userInfo.realname }, onLoad() { let arr = [] for(let i = 0; i < 60; i++) { arr.push(i) } this.getData() this.columns = [arr, arr] // æ¥æ¶è®¡å uni.$on('update', (data) => { this.from.processPlan = data.obj this.plansId = data.obj.id this.from.deviceId = '' this.from.deviceName = '' this.deviceId = '' this.total = data.obj.num - data.obj.workorderDistributNum this.wuList = [] this.from.defective = [] this.from.defectiveName = '' this.from.userName = '' this.from.userId = '' // è·åè®¾å¤ getDeviceByCondition({ procedureId: data.obj.procedureId }) .then(res1 => { if (res1.code === 200) { if (res1.data && res1.data.length > 0) { this.deviceId = res1.data[0].id this.from.deviceId = res1.data[0].id this.from.deviceName = res1.data[0].name this.deviceList = [res1.data] } } }) // è·åç±»å getIdPlansExt(data.obj.id) .then(res2 => { if (res2.code === 200) { this.bomType = res2.data.bomType this.hasBom = res2.data.hasBom } }) // è·åå·¥èµç»©ææ°æ® queryList({ deleted: 0, departId: data.obj.factoryId, materialId: data.obj.materialId, procedureId: data.obj.procedureId }).then(result => { if (result.code === 200) { if (result.data && result.data.length > 0) { result.data.forEach((item, index) => { item.name = item.type == 0 ? '计件' : '计æ¶' item.id = item.type item.active = index == 0 }) this.arrType = result.data console.log(this.arrType) } else { this.arrType = [] } } }) }) }, methods: { poorSelection(val, i) { this.cateList.forEach((item, index) => { if (i === index) { item.active = !item.active } }) }, // åæ¢ç»©æç±»å clickPerformanceType(i) { this.from.index = i this.arrType.forEach((item, index) => { if (i === index) { from.type = item.id this.from.type = item.id } item.active = index === i }) @@ -353,7 +423,7 @@ obj.total = val.num this.wuList.unshift(obj) let arr = this.wuList.map(item => item.id) this.ids = arr.join(',') this.ids = arr }, // è·åä¸è¯é¡¹ç® getData() { @@ -371,9 +441,9 @@ }, // éæ©è®¾å¤ onConfirm(e) { this.from.deviceId = e.id this.from.deviceName = e.name this.deviceId = e.id this.from.deviceId = e.value[0].id this.from.deviceName = e.value[0].name this.deviceId = e.value[0].id this.from.userId = '' this.from.userName = '' // getFindAll({ @@ -403,15 +473,15 @@ let name = '' for (let i = 0; i < this.cateList.length; i++) { if (this.cateList[i].active) { if (this.cateList[i].num <= 0) { if (Number(this.cateList[i].num) <= 0) { return uni.showToast({ title: 'ä¸è¯æ°éå¿ é¡»å¤§äº0', icon: 'none', duration: 2000 }); } total = total += this.cateList[i].num total = total += Number(this.cateList[i].num) arr.push(this.cateList[i]) name += this.cateList[i].name + this.cateList[i].num + 'ï¼' } } if (total !== this.from.undesirable) return uni.showToast({ title: 'ä¸è¯æ°å¿ é¡»çäºäº§åºä¸è¯æ°', icon: 'none', duration: 2000 }); if (total !== Number(this.from.undesirable)) return uni.showToast({ title: 'ä¸è¯æ°å¿ é¡»çäºäº§åºä¸è¯æ°', icon: 'none', duration: 2000 }); this.from.defective = arr this.from.defectiveName = name this.show = false @@ -450,7 +520,7 @@ openMaterial() { if (!this.plansId) return uni.showToast({ title: '请å 鿩工åºç产计å', icon: 'none', duration: 2000 }); if (!this.deviceId) return uni.showToast({ title: '请å éæ©ç产设å¤', icon: 'none', duration: 2000 }); this.$refs.selectMaterial.open({}) this.$refs.MaterialSelect.open() }, inputwl(i) { if (this.wuList[i].num > this.wuList[i].total) { @@ -543,6 +613,7 @@ }).then(res => { if (res.code === 200) { uni.showToast({ title: 'æ¥å·¥æåï¼', icon: 'success', duration: 2000 }); this.arrType = [] this.from.processPlan = null this.from.deviceId = '' this.from.deviceName = '' @@ -830,7 +901,7 @@ } } .bg_list_item_num_item_wl { flex-shrink: 0; flex: 1; display: flex; flex-direction: column; text { @@ -888,6 +959,8 @@ } .bg_list_item_num_item_sr { // flex: 1; flex-shrink: 0; width: 230rpx; display: flex; align-items: center; justify-content: flex-end; @@ -911,6 +984,7 @@ font-weight: 400; color: #333333; padding: 0 30rpx; margin-right: 20rpx; } .wulll { width: 400rpx; @@ -1042,7 +1116,8 @@ } } .bl_list_item_right { flex: 1; width: 200rpx; flex-shrink: 0; height: 50rpx; text-align: right; input { @@ -1067,5 +1142,77 @@ } } } .bl_list { width: 100%; height: calc(100% - 168rpx); overflow-y: scroll; margin-top: 30rpx; .bl_list_item { width: 100%; height: 96rpx; display: flex; align-items: center; justify-content: space-between; border-bottom: 1rPX solid #E5E5E5; &:last-child { border: none !important; } .bl_list_item_left { flex: 1; display: flex; align-items: center; input { width: 30rpx; height: 30rpx; border: 1rpX solid #CCCCCC; margin: 0 !important; } span { font-size: 30rpx; color: #222222; margin-left: 10rpx; } } .bl_list_item_right { width: 200rpx; flex-shrink: 0; height: 50rpx; text-align: right; input { padding-left: 5rpx; width: 180rpx; height: 60rpx; border-radius: 8rpx; border: 1rpx solid #CCCCCC; padding: 0 30rpx; box-sizing: border-box; text-align: right; font-size: 28rpx; color: #333333; border-radius: 10rpx; border: 1rPX solid #CCCCCC; &::-webkit-input-placeholder { font-size: 28rpx; font-family: PingFangSC-Regular, PingFang SC; font-weight: 400; color: #999999; } } } } } .bottom-view { left: 40rpx; right: 40rpx; bottom: 0 } } </style>