From 2b1c5e5c3cfe5ef193364490c293fdf0c7605757 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期二, 30 十二月 2025 15:16:35 +0800
Subject: [PATCH] 1.平板sop页面
---
config/api.js | 19 +
pages.json | 14 +
pages/sop/index.vue | 394 +++++++++++++++++++++++++++++++++++++++
pages/sop/sop.vue | 121 ++++++++++++
4 files changed, 548 insertions(+), 0 deletions(-)
diff --git a/config/api.js b/config/api.js
index 630c698..fad3f78 100644
--- a/config/api.js
+++ b/config/api.js
@@ -444,4 +444,23 @@
export const ProductOrderSearch = (data, config = {}) => http.get(
'/AppProduct/ProductOrderSearch', {
params: data
+ })
+
+
+//MES宸ュ崟鏌ヨ
+export const SopSearchMesOrderSearch = (data, config = {}) => http.get(
+ '/SopSearch/MesOrderSearch', {
+ params: data
+ })
+
+//MES宸ュ崟缂栬緫鑾峰彇宸ュ簭鏁版嵁
+export const SopSearchUpdateMesOrderStepSearch = (data, config = {}) => http.get(
+ '/SopSearch/UpdateMesOrderStepSearch', {
+ params: data
+ })
+
+//MES宸ュ崟鏌ョ湅宸ヨ壓SOP
+export const SopSearchMesOrderProcessSopSearch = (data, config = {}) => http.get(
+ '/SopSearch/MesOrderProcessSopSearch', {
+ params: data
})
\ No newline at end of file
diff --git a/pages.json b/pages.json
index f5a34dc..46ab466 100644
--- a/pages.json
+++ b/pages.json
@@ -22,6 +22,20 @@
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
+ }, {
+ "path": "pages/sop/index",
+ "style": {
+ "navigationBarTitleText": "sop",
+ "navigationStyle": "custom",
+ "enablePullDownRefresh": false
+ }
+ }, {
+ "path": "pages/sop/sop",
+ "style": {
+ "navigationBarTitleText": "sop",
+ "navigationStyle": "custom",
+ "enablePullDownRefresh": false
+ }
},
{
"path": "pages/mjgl/mjcx",
diff --git a/pages/sop/index.vue b/pages/sop/index.vue
new file mode 100644
index 0000000..3304141
--- /dev/null
+++ b/pages/sop/index.vue
@@ -0,0 +1,394 @@
+<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 {
+ // 璺宠浆鍒皊op椤甸潰锛屼笖浼犲叆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
+ // }
+ // })
+
+
+
+
+
+ },
+ // 浼猺equest璇锋眰
+ 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>
\ No newline at end of file
diff --git a/pages/sop/sop.vue b/pages/sop/sop.vue
new file mode 100644
index 0000000..c6b17e9
--- /dev/null
+++ b/pages/sop/sop.vue
@@ -0,0 +1,121 @@
+<template>
+ <view>
+ <view class="headTitle">娴欐睙浼樻浣撹偛鐢ㄥ搧鑲′唤鏈夐檺鍏徃宸ュ簭SOP</view>
+ <uni-forms ref="form" :modelValue="form" class="headForm">
+ <uni-forms-item label="宸ュ崟缂栧彿" label-width='100' class="headFormItem">
+ <uni-easyinput v-model="form.mesordercode" type="text" placeholder="璇疯緭鍏�" :clearable='false' />
+ </uni-forms-item>
+ <uni-forms-item label="浜у搧鍚嶇О" label-width='100' class="headFormItem">
+ <uni-easyinput v-model="form.partname" type="text" placeholder="璇疯緭鍏�" :clearable='false' />
+ </uni-forms-item>
+ <uni-forms-item label="宸ュ簭sop" label-width='100' class="headFormItem">
+ <uni-data-select v-model="form.filepath" :localdata="selectArr" :clearable='false'
+ @change="filepathChange"></uni-data-select>
+ </uni-forms-item>
+ <uni-forms-item label="鐗堟湰鍙�" label-width='100' class="headFormItem">
+ <uni-easyinput v-model="form.v" type="text" placeholder="璇疯緭鍏�" :clearable='false' />
+ </uni-forms-item>
+ </uni-forms>
+
+ <button type="primary" @click="goBack" size="mini" class="goback">杩� 鍥�</button>
+
+
+ <web-view class="my-web-view"
+ :src="'https://view.xdocin.com/view?src=' + encodeURIComponent(baseUrl+form.filepath)"></web-view>
+
+ </view>
+</template>
+
+<script>
+ export default {
+ onLoad(option) {
+ this.sopArr = JSON.parse(option.sopArr)
+ this.mesOrderObj = JSON.parse(option.mesOrderObj)
+ },
+ data() {
+ return {
+ selectArr: [],
+ sopArr: [],
+ mesOrderObj: {},
+ form: {
+ partname: '',
+ mesordercode: '',
+ filepath: '',
+ v: ''
+ },
+ baseUrl: this.$baseUrl.split('api')[0],
+ }
+ },
+
+ mounted() {
+ this.selectArr = this.sopArr.map(({
+ filename,
+ filepath
+ }) => ({
+ text: filename,
+ value: filepath
+ }))
+ this.form = {
+ partname: this.mesOrderObj.partname,
+ mesordercode: this.mesOrderObj.wo_code,
+ filepath: this.sopArr[0].filepath,
+ v: this.sopArr[0].version
+ }
+ },
+ methods: {
+ filepathChange(val) {
+ console.log(val)
+ },
+ goBack() {
+ // uni.navigateBack()
+ uni.navigateTo({
+ url: './index'
+ })
+ }
+ }
+
+ }
+</script>
+
+<style scoped>
+ .goback {
+ position: absolute;
+ right: 3vw;
+ top: 6.5vh;
+ }
+
+ .my-web-view {
+ height: 86vh;
+ margin-top: 13vh;
+
+ }
+
+ .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;
+ }
+
+ .uniui-clear {
+ display: none;
+ }
+ }
+</style>
\ No newline at end of file
--
Gitblit v1.9.3