| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <view> |
| | | <view class="uni-container"> |
| | | |
| | | <view class="headTitle">æµæ±ä¼æ¥ä½è²ç¨åè¡ä»½æéå
¬å¸å·¥åºSOP</view> |
| | | |
| | | |
| | | <uni-forms ref="form" :modelValue="form" class="headForm"> |
| | | <uni-forms-item label="车é´åç§°" label-width='100' class="headFormItem"> |
| | | <uni-data-select v-model="form.wkshopcode" @clear='search' :localdata="wkshopcodeArr" |
| | | @change="val=>search(val,'wkshopcode')"></uni-data-select> |
| | | <!-- <uni-easyinput type="text" v-model="form.wkshopcode" placeholder="请è¾å
¥" @change='search' |
| | | @clear="search" /> --> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="å·¥åç¼å·" label-width='100' class="headFormItem"> |
| | | <uni-easyinput v-model="form.mesordercode" type="text" placeholder="请è¾å
¥" @change='search' |
| | | @clear="search" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="æºååå·" label-width='100' class="headFormItem"> |
| | | <uni-easyinput v-model="form.sourceorder" type="text" placeholder="请è¾å
¥" @change='search' |
| | | @clear="search" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="éå®è®¢å" label-width='100' class="headFormItem"> |
| | | <uni-easyinput v-model="form.saleordercode" type="text" placeholder="请è¾å
¥" @change='search' |
| | | @clear="search" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="产åç¼ç " label-width='100' class="headFormItem"> |
| | | <uni-easyinput v-model="form.partcode" type="text" placeholder="请è¾å
¥" @change='search' |
| | | @clear="search" /> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="产ååç§°" label-width='100' class="headFormItem"> |
| | | <uni-easyinput v-model="form.partname" type="text" placeholder="请è¾å
¥" @change='search' |
| | | @clear="search" /> |
| | | </uni-forms-item> |
| | | </uni-forms> |
| | | |
| | | <uni-table ref="table" :loading="loading" border stripe emptyText="ææ æ´å¤æ°æ®" style="height: 52vh;"> |
| | | <!-- @selection-change="selectionChange" type="selection" --> |
| | | <uni-tr> |
| | | <uni-th width="80" align="center">åºå·</uni-th> |
| | | <uni-th width="150" align="center">ç产车é´</uni-th> |
| | | <uni-th width="150" align="center">å·¥åç¼å·</uni-th> |
| | | <uni-th width="150" align="center">æºåç¼å·</uni-th> |
| | | <uni-th width="150" align="center">éå®è®¢å</uni-th> |
| | | <uni-th width="150" align="center">产åç¼ç </uni-th> |
| | | <uni-th width="150" align="center">产ååç§°</uni-th> |
| | | <uni-th width="150" align="center">产åè§æ ¼</uni-th> |
| | | <uni-th width="150" align="center">å·¥èºè·¯çº¿</uni-th> |
| | | <uni-th width="150" align="center">工忰</uni-th> |
| | | <uni-th width="204" align="center">æä½</uni-th> |
| | | </uni-tr> |
| | | <uni-tr v-for="(item, index) in tableData" :key="index"> |
| | | <uni-td>{{ item.rowNum }}</uni-td> |
| | | <uni-td> |
| | | <!-- <view class="name">{{ item.wkshp_name }}</view> --> |
| | | {{ item.wkshp_name?item.wkshp_name:'/' }} |
| | | </uni-td> |
| | | <uni-td align="center">{{ item.wo_code? item.wo_code:'/' }}</uni-td> |
| | | <uni-td align="center">{{ item.m_po?item.m_po:'/' }}</uni-td> |
| | | <uni-td align="center">{{ item.saleOrderCode?item.saleOrderCode:'/' }}</uni-td> |
| | | <uni-td align="center">{{ item.partcode?item.partcode:'/' }}</uni-td> |
| | | <uni-td align="center">{{ item.partname? item.partname:'/' }}</uni-td> |
| | | <uni-td align="center">{{ item.partspec ? item.partspec:'/'}}</uni-td> |
| | | <uni-td align="center">{{ item.route_name? item.route_name:'/' }}</uni-td> |
| | | <uni-td align="center">{{ item.plan_qty? item.plan_qty:'/' }}</uni-td> |
| | | |
| | | <uni-td> |
| | | <view class="uni-group"> |
| | | <button class="uni-button" size="mini" type="primary" @click="trClick(item)">鿩工å</button> |
| | | <!-- <button class="uni-button" size="mini" type="warn">å é¤</button> --> |
| | | </view> |
| | | </uni-td> |
| | | </uni-tr> |
| | | </uni-table> |
| | | |
| | | <view class="uni-pagination-box"><uni-pagination show-icon :page-size="form.rows" :current="form.page" |
| | | :total="total" @change="change" /></view> |
| | | |
| | | |
| | | |
| | | <uni-table ref="table2" :loading="loading2" border stripe emptyText="请å
鿩工å" style="height: 28vh;"> |
| | | <!-- @selection-change="selectionChange" type="selection" --> |
| | | <uni-tr> |
| | | <uni-th width="80" align="center">åºå·</uni-th> |
| | | |
| | | <uni-th width="150" align="center">å·¥åºç¼ç </uni-th> |
| | | <uni-th width="150" align="center">å·¥åºåç§°</uni-th> |
| | | <uni-th width="150" align="center">å·²ç产æ°é</uni-th> |
| | | <uni-th width="150" align="center">åæ ¼æ°é</uni-th> |
| | | <uni-th width="150" align="center">ä¸è¯æ°é</uni-th> |
| | | <uni-th width="150" align="center">å·¥åºæ°é</uni-th> |
| | | <uni-th width="150" align="center">æåºæ°é</uni-th> |
| | | <uni-th width="150" align="center">æ»å¯æ¥æ°é</uni-th> |
| | | <uni-th width="150" align="center">å¾
产æ°é</uni-th> |
| | | <uni-th width="204" align="center">sopé¢è§</uni-th> |
| | | </uni-tr> |
| | | <uni-tr v-for="(item, index) in sopTableData" :key="index"> |
| | | <uni-td>{{ item.seq }}</uni-td> |
| | | |
| | | <uni-td> {{ item.step_code}} </uni-td> |
| | | <uni-td align="center">{{ item.stepname }}</uni-td> |
| | | <uni-td align="center">{{ item.produceq_qty }}</uni-td> |
| | | <uni-td align="center">{{ item.good_qty}}</uni-td> |
| | | <uni-td align="center">{{ item.ng_qty }}</uni-td> |
| | | <uni-td align="center">{{ item.laborbad_qty }}</uni-td> |
| | | <uni-td align="center">{{ item.materielbad_qty }}</uni-td> |
| | | <uni-td align="center">{{ item.plan_qty }}</uni-td> |
| | | <uni-td align="center">{{ item.delive_qty }}</uni-td> |
| | | |
| | | <uni-td> |
| | | <view class="uni-group"> |
| | | <button class="uni-button" size="mini" type="primary" @click="sopClick(item)">å·¥åºé¢è§</button> |
| | | <!-- <button class="uni-button" size="mini" type="warn">å é¤</button> --> |
| | | </view> |
| | | </uni-td> |
| | | </uni-tr> |
| | | </uni-table> |
| | | |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | SopSearchMesOrderSearch, |
| | | SopSearchUpdateMesOrderStepSearch, |
| | | SopSearchMesOrderProcessSopSearch, |
| | | PrentOrganizationNoCompany |
| | | } from '../../config/api.js'; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | tableData: [], |
| | | // æ°æ®æ»é |
| | | total: 0, |
| | | loading: false, |
| | | loading2: false, |
| | | form: { |
| | | wkshopcode: '', // 车é´ç¼ç |
| | | mesorderstus: '', // å·¥åç¶æç |
| | | mesordercode: '', // å·¥åç¼å· |
| | | partcode: '', // 产åç¼ç |
| | | ordertype: '', // ordertype |
| | | sourceorder: '', // æºååå· |
| | | saleordercode: '', // éå®è®¢å |
| | | partname: '', // 产ååç§° |
| | | partspec: '', // 产åè§æ ¼ |
| | | creatuser: '', // å建人å |
| | | datatype: 'ED', // æ¥æç±»å(计åå¼å·¥(PS)ã计åå®å·¥(PE)ãé¢è®¡äº¤ä»(ED)ãåå»ºæ¥æ(CT)) |
| | | timeValue: [], // æ¥è¯¢æ¥æ |
| | | prop: 'lm_date', // æåºå段 |
| | | order: 'desc', // æåºå段 |
| | | page: 1, // 第å 页 |
| | | rows: 15 // æ¯é¡µå¤å°æ¡ |
| | | }, |
| | | sopTableData: [], |
| | | wkshopcodeArr: [], |
| | | rowData: {} // è¡ç¹å»äºä»¶åå¨å¼ |
| | | |
| | | } |
| | | }, |
| | | onLoad() { |
| | | // this.selectedIndexs = [] |
| | | this.getData(1) |
| | | }, |
| | | mounted() { |
| | | this.getPrentOrganizationNoCompany() |
| | | }, |
| | | methods: { |
| | | async getPrentOrganizationNoCompany() { |
| | | const res = await PrentOrganizationNoCompany() |
| | | this.wkshopcodeArr = res.data.map(({ |
| | | torg_name, |
| | | torg_code |
| | | }) => ({ |
| | | text: torg_name, |
| | | value: torg_code |
| | | })) |
| | | }, |
| | | |
| | | // // å¤éå¤ç |
| | | // selectedItems() { |
| | | // return this.selectedIndexs.map(i => this.tableData[i]) |
| | | // }, |
| | | // // å¤é |
| | | // selectionChange(e) { |
| | | // console.log(e.detail.index) |
| | | // this.selectedIndexs = e.detail.index |
| | | // }, |
| | | // //æ¹éå é¤ |
| | | // delTable() { |
| | | // console.log(this.selectedItems()) |
| | | // }, |
| | | |
| | | // 鿩工å |
| | | trClick(row) { |
| | | this.rowData = row |
| | | const data = { |
| | | sourceid: row.sourceid, |
| | | sourcewo: row.m_po, |
| | | wocode: row.wo_code, |
| | | data_sources: row.data_sources |
| | | } |
| | | this.loading2 = true |
| | | SopSearchUpdateMesOrderStepSearch(data).then(res => { |
| | | this.sopTableData = res.data.stepdata |
| | | this.loading2 = false |
| | | }) |
| | | }, |
| | | // å·¥åºé¢è§ |
| | | async sopClick(row) { |
| | | |
| | | const data = { |
| | | materielcode: this.rowData.partcode, |
| | | routecode: this.rowData.route_code, |
| | | stepcode: row.step_code |
| | | } |
| | | |
| | | const { |
| | | data: res |
| | | } = await SopSearchMesOrderProcessSopSearch(data) |
| | | // console.log(res) |
| | | |
| | | if (res.length === 0) { |
| | | return uni.$u.toast('æ¤å·¥åºæªä¸ä¼ sopï¼è¯·å
ä¸ä¼ !') |
| | | } else { |
| | | // 跳转å°sop页é¢ï¼ä¸ä¼ å
¥sopä¿¡æ¯åå·¥åä¿¡æ¯ |
| | | const rowData = { |
| | | wo_code: this.rowData.wo_code, |
| | | partname: this.rowData.partname |
| | | } |
| | | uni.navigateTo({ |
| | | url: './sop?sopArr=' + JSON.stringify(res) + '&mesOrderObj=' + JSON.stringify(rowData) |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }, |
| | | // å页触å |
| | | change(e) { |
| | | // this.$refs.table.clearSelection() |
| | | // this.selectedIndexs.length = 0 |
| | | this.getData(e.current) |
| | | }, |
| | | // æç´¢ |
| | | search(val, type) { |
| | | if (type === 'wkshopcode') { |
| | | this.form.wkshopcode = val |
| | | } |
| | | this.getData(1) |
| | | }, |
| | | // è·åæ°æ® |
| | | getData(pageCurrent) { |
| | | this.loading = true |
| | | this.form.page = pageCurrent |
| | | |
| | | const data = { |
| | | wkshopcode: this.form.wkshopcode, |
| | | mesorderstus: this.form.mesorderstus, // å·¥åç¶æç |
| | | mesordercode: this.form.mesordercode, // å·¥åç¼å· |
| | | partcode: this.form.partcode, // 产åç¼ç |
| | | partname: this.form.partname, // 产ååç§° |
| | | partspec: this.form.partspec, // 产åè§æ ¼ |
| | | creatuser: this.form.creatuser, // å建人å |
| | | sourceorder: this.form.sourceorder, // æºååå· |
| | | saleordercode: this.form.saleordercode, // éå®è®¢å |
| | | ordertype: this.form.ordertype, // åæ®ç±»å |
| | | datatype: this.form.datatype, |
| | | searchdate: this.form.timeValue.join('~'), |
| | | // createdate: this.form.createdate.toString().length > 0 ? handleDatetime(this.form.createdate) : '', // å建æ¶é´ |
| | | prop: this.form.prop, // æåºå段 |
| | | order: this.form.order, // æåºå段 |
| | | page: this.form.page, // 第å 页 |
| | | rows: this.form.rows // æ¯é¡µå¤å°æ¡ |
| | | } |
| | | |
| | | SopSearchMesOrderSearch(data).then(res => { |
| | | console.log(res) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | this.loading = false |
| | | |
| | | }) |
| | | // this.request({ |
| | | // pageSize: this.pageSize, |
| | | // pageCurrent: pageCurrent, |
| | | // value: value, |
| | | // success: res => { |
| | | // // console.log('data', res); |
| | | // this.tableData = res.data |
| | | // this.total = res.total |
| | | // this.loading = false |
| | | // } |
| | | // }) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }, |
| | | // 伪requestè¯·æ± |
| | | request(options) { |
| | | const { |
| | | pageSize, |
| | | pageCurrent, |
| | | success, |
| | | value |
| | | } = options |
| | | let total = tableData.length |
| | | let data = tableData.filter((item, index) => { |
| | | const idx = index - (pageCurrent - 1) * pageSize |
| | | return idx < pageSize && idx >= 0 |
| | | }) |
| | | if (value) { |
| | | data = [] |
| | | tableData.forEach(item => { |
| | | if (item.name.indexOf(value) !== -1) { |
| | | data.push(item) |
| | | } |
| | | }) |
| | | total = data.length |
| | | } |
| | | |
| | | setTimeout(() => { |
| | | typeof success === 'function' && |
| | | success({ |
| | | data: data, |
| | | total: total |
| | | }) |
| | | }, 500) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | |
| | | <style scoped> |
| | | /* #ifndef H5 */ |
| | | /* page { |
| | | padding-top: 85px; |
| | | } */ |
| | | /* #endif */ |
| | | |
| | | .uni-container { |
| | | /* background-color: #e8e8e8; */ |
| | | } |
| | | |
| | | .uni-group { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | ::v-deep .uni-table-mask { |
| | | background-color: transparent !important; |
| | | } |
| | | |
| | | .headTitle { |
| | | height: 6vh; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | font-size: 40rpx; |
| | | font-weight: bolder; |
| | | font-family: Arial; |
| | | } |
| | | |
| | | .headForm { |
| | | height: 6vh; |
| | | /* border-bottom: 2rpx solid #000; */ |
| | | |
| | | span { |
| | | display: flex; |
| | | justify-content: space-evenly; |
| | | align-items: center; |
| | | } |
| | | |
| | | .headFormItem { |
| | | width: 500rpx; |
| | | } |
| | | } |
| | | |
| | | .uni-pagination-box { |
| | | height: 4vh; |
| | | margin: 1vh 0; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | background-color: #fff; |
| | | } |
| | | </style> |