Commit 992ee9e5 authored by chenzj's avatar chenzj

Merge branch 'dev' of http://git.local.topsunit.com/mes/mes-pad into dev

# Conflicts:
#	pages/mes/prodReport/index.vue
parents e4df7608 a93b3703
...@@ -50,6 +50,12 @@ const install = (Vue, vm) => { ...@@ -50,6 +50,12 @@ const install = (Vue, vm) => {
//修改任务状态 //修改任务状态
changeStatus: (params = {}) => changeStatus: (params = {}) =>
vm.$u.post(config.adminPath + '/mobile/pro/protask/change', params), vm.$u.post(config.adminPath + '/mobile/pro/protask/change', params),
//开始任务加提示
changeCheckMachineTool: (params = {}) =>
vm.$u.get(
config.adminPath +
`/mes/pro/protask/checkMachineTool/${params.taskWorkunitId}`
),
//生产报工 //生产报工
feedback: (params = {}) => feedback: (params = {}) =>
vm.$u.post(config.adminPath + '/mobile/pro/protask/feedback', params), vm.$u.post(config.adminPath + '/mobile/pro/protask/feedback', params),
...@@ -62,9 +68,10 @@ const install = (Vue, vm) => { ...@@ -62,9 +68,10 @@ const install = (Vue, vm) => {
// //
getIpqcCode: (params = {}) => getIpqcCode: (params = {}) =>
vm.$u.get(config.adminPath + '/system/autocode/get/IPQC_CODE', params), vm.$u.get(config.adminPath + '/system/autocode/get/IPQC_CODE', params),
//查看人员管理 //查看人员管理
userQuery: (params = {}) => vm.$u.get(config.adminPath + '/mes/md/workstationworker/list' ,params), userQuery: (params = {}) =>
vm.$u.get(config.adminPath + '/mes/md/workstationworker/list', params),
//增加缺陷记录 //增加缺陷记录
addDefectrecord: (params = {}) => addDefectrecord: (params = {}) =>
...@@ -354,7 +361,10 @@ const install = (Vue, vm) => { ...@@ -354,7 +361,10 @@ const install = (Vue, vm) => {
tmToolMachinesRecord: (params = {}) => tmToolMachinesRecord: (params = {}) =>
vm.$u.putJson(config.adminPath + '/tm/tmToolMachines', params), vm.$u.putJson(config.adminPath + '/tm/tmToolMachines', params),
tmToolMachinesScancode: (params = {}) => tmToolMachinesScancode: (params = {}) =>
vm.$u.postJson(config.adminPath + '/tm/tmToolMachines/scancode', params), vm.$u.postJson(
config.adminPath + '/tm/tmToolMachines/scancode',
params
),
}, },
}; };
......
...@@ -78,6 +78,7 @@ export default { ...@@ -78,6 +78,7 @@ export default {
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
line-height: 30px; line-height: 30px;
font-size: 40rpx;
} }
......
...@@ -25,10 +25,11 @@ ...@@ -25,10 +25,11 @@
@toggleAllSelection="toggleAllSelection" @toggleAllSelection="toggleAllSelection"
:border="true" :border="true"
:data="tableData" :data="tableData"
></zb-table> >
</zb-table>
</view> </view>
<view class="prod-body-left-num">总报工订单数:{{ tableData.length }}</view> <view class="prod-body-left-num">可选订单数:{{ tableData.length }}</view>
<view class="prod-body-left-bom"> <!-- <view class="prod-body-left-bom"> -->
<!-- <view class="prod-body-left-bom-type">--> <!-- <view class="prod-body-left-bom-type">-->
<!-- <u-subsection :list="typeList" :current="currentType" type="primary" font-size="28"--> <!-- <u-subsection :list="typeList" :current="currentType" type="primary" font-size="28"-->
<!-- @change="typeChange"></u-subsection>--> <!-- @change="typeChange"></u-subsection>-->
...@@ -62,9 +63,9 @@ ...@@ -62,9 +63,9 @@
<!-- </u-col>--> <!-- </u-col>-->
<!-- </u-row>--> <!-- </u-row>-->
<!-- </u-form>--> <!-- </u-form>-->
<zb-table :columns="issusLineColumn" :stripe="true" :fit="true" :border="true" :data="issusLineList"></zb-table> <!-- <zb-table :columns="issusLineColumn" :stripe="true" :fit="true" :border="true" :data="issusLineList"></zb-table> -->
<!-- </view>--> <!-- </view>-->
</view> <!-- </view> -->
</view> </view>
<scroll-view class="prod-body-right" scroll-y> <scroll-view class="prod-body-right" scroll-y>
<view style="text-align: center; line-height: 80rpx; font-size: 28rpx; font-weight: 600"> <view style="text-align: center; line-height: 80rpx; font-size: 28rpx; font-weight: 600">
...@@ -181,7 +182,7 @@ ...@@ -181,7 +182,7 @@
v-model="knifeTempVisible" v-model="knifeTempVisible"
width="1600rpx" width="1600rpx"
> >
<u-form label-width="130px" :model="knifeTempSearch" :rules="rules"> <!-- <u-form label-width="130px" :model="knifeTempSearch" :rules="rules">
<u-row> <u-row>
<u-col span="6"> <u-col span="6">
<u-form-item label="扫描刃模版条码" prop="quantity"> <u-form-item label="扫描刃模版条码" prop="quantity">
...@@ -194,10 +195,10 @@ ...@@ -194,10 +195,10 @@
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
</u-form> </u-form> -->
<dModelList :data="dModelData" @action="upDownGetList"/> <dModelList :data="dModelData" @action="upDownGetList"/>
</u-modal> </u-modal>
//生产报工报工人员 <!-- //生产报工报工人员 -->
<u-modal <u-modal
title="报工人员" title="报工人员"
@confirm="userDetermine()" @confirm="userDetermine()"
...@@ -986,6 +987,17 @@ userTempVisible: false, ...@@ -986,6 +987,17 @@ userTempVisible: false,
changeWorkstation() { changeWorkstation() {
uni.$emit('changeWorkunit'); uni.$emit('changeWorkunit');
}, },
// 判断是否显示红色
isTrClassStyle(row, i) {
console.log(row, i, 999)
var oDate1 = new Date();
var oDate2 = new Date(row.endTime);
if(oDate1.getTime() > oDate2.getTime()){
return true; //第一个大
} else {
return false; //第二个大
}
},
commonClick(oper) { commonClick(oper) {
if (['Refresh', 'MaterialUsageRecord'].indexOf(oper) === -1 && this.tableSelectData.length === 0) { if (['Refresh', 'MaterialUsageRecord'].indexOf(oper) === -1 && this.tableSelectData.length === 0) {
this.$u.toast('请选择工作任务!'); this.$u.toast('请选择工作任务!');
...@@ -1001,6 +1013,9 @@ userTempVisible: false, ...@@ -1001,6 +1013,9 @@ userTempVisible: false,
if (item.status === 'BEGINNING') { if (item.status === 'BEGINNING') {
status = true; status = true;
} else { } else {
this.$u.api.changeCheckMachineTool({
taskWorkunitId: item.taskWorkunitId
})
this.changeStatus(item.taskId, item.taskWorkunitId,'BEGINNING',item.workunitId); this.changeStatus(item.taskId, item.taskWorkunitId,'BEGINNING',item.workunitId);
} }
}); });
...@@ -1233,7 +1248,10 @@ userTempVisible: false, ...@@ -1233,7 +1248,10 @@ userTempVisible: false,
}) })
.then((res) => { .then((res) => {
if (res.code === 200) { if (res.code === 200) {
this.tableData = res.rows; // 过滤可加工数量为0的数据
this.tableData = res.rows.filter(item => {
return !(item.quantityWait == '0')
})
if (this.tableData.length > 0) { if (this.tableData.length > 0) {
this.curTaskInfo = this.tableData[0]; this.curTaskInfo = this.tableData[0];
...@@ -1306,7 +1324,6 @@ userTempVisible: false, ...@@ -1306,7 +1324,6 @@ userTempVisible: false,
taskId: taskId, taskId: taskId,
status: status, status: status,
taskWorkunitId: taskWorkunitId, taskWorkunitId: taskWorkunitId,
workunitId: workunitId,
attr1: this.stopReason attr1: this.stopReason
}) })
.then((res) => { .then((res) => {
...@@ -1773,9 +1790,13 @@ userTempVisible: false, ...@@ -1773,9 +1790,13 @@ userTempVisible: false,
} }
.prod-body-left-task { .prod-body-left-task {
height: calc(100vh - 80rpx - 500rpx); height: calc(100vh - 80rpx);
min-height: 400rpx; min-height: 400rpx;
border: 1px solid rgb(232, 232, 232); border: 1px solid rgb(232, 232, 232);
/deep/ .item-tr.trbg .item-td{
background:#fb9461 !important;
// color:#fff !important;
}
} }
.prod-body-left-num { .prod-body-left-num {
......
<template>
<view>
<u-button @click="exportPDF">预览pdf</u-button>
</view>
</template>
<script>
import { io } from 'socket.io-client';
import uButton from '../../uview-ui/components/u-button/u-button.vue';
export default {
components: { uButton },
data() {
return {
socket: {},
url: 'http://192.168.3.91:8082/static/123.pdf'
};
},
created() {
// this.socket = io('http://192.168.23.19:17521', {
// transports: ['websocket'],
// auth: {
// token: 'Bearer ' + this.vuex_token // 在此处填入你 client 设置的 token,缺省可留空
// }
// });
// this.socket.on('connect', () => {
// globalThis.connect = true;
// console.log('连接成功444');
// // TODO: Do something for your project
// });
// this.socket.on('clients', (clients) => {
// globalThis.clients = clients;
// console.log(clients, 'clients');
// });
// this.socket.on('printerList', (printerList) => {
// globalThis.printerList = printerList;
// console.log(printerList, 'printerList');
// });
},
methods: {
handlePrint() {
console.log(this.socket, 'this.$socket');
this.$socket.emit('news', {
client: null,
printer: null,
type: 'url_pdf',
pdf_path: 'http://192.168.23.19:8081/static/123.pdf'
});
},
previewPdf() {
// 预览pdf文件
// uni.openDocument({
// filePath: 'http://192.168.3.91:8082/static/123.pdf',
// showMenu: true,
// success: function(file) {
// console.log("file-success", file)
// }
// })
let fileType = ['doc', 'xls', 'ppt', 'pdf', 'docx', 'xlsx', 'pptx'];
//下载文件资源到本地
const url = '/api/static/123.pdf';
uni.downloadFile({
url,
success: function (res) {
console.log(res);
var filePath = res.tempFilePath;
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function (res) {}
});
},
fail: function (err) {
console.log('下载失败:', err);
}
});
},
saveFile(tempFilePath) {
//保存到本地
//文件保存到本地
const url = '/api/static/123.pdf';
uni.saveFile({
tempFilePath: url, //临时路径
success: function (res) {
uni.showToast({
icon: 'none',
mask: true,
title: '文件已保存:' + res.savedFilePath, //保存路径
duration: 3000
});
setTimeout(() => {
//打开文档查看
uni.openDocument({
filePath: res.savedFilePath,
success: function (res) {
// console.log('打开文档成功');
}
});
}, 3000);
}
});
},
exportPDF() {
let url = this.url;
// #ifdef APP-PLUS
uni.downloadFile({
url,
success: (res) => {
console.log(res);
if (res.statusCode === 200) {
// 保存pdf文件至手机,一般安卓端存储路径为:手机存储/dcim/camera文件夹下
// uni.showToast({
// title: '文件已保存至/DCIM/CAMERA文件夹下',
// icon: 'none'
// });
// 预览pdf文件
uni.openDocument({
filePath: res.tempFilePath,
showMenu: true,
success: function (file) {
console.log('file-success', file);
}
});
}
}
});
// #endif
},
downLoadFile(fileName, fileType) {
console.log('开始下载');
//这里填写接口地址
let url = '/api/static/123.pdf';
uni.downloadFile({
//调用官方提供的uni.downloadFile
url: url, //将刚刚提前准备好的url传过来
header: {
//如果需要填写请求头信息则在此处填写
},
success: function (res) {
console.log(res);
if (res.statusCode === 200) {
console.log('下载成功:', res.tempFilePath);
//下载成功,并把下载好的文件保存在临时区域中
uni.saveFile({
//使用该功能,以将临时文件保存在手机中可长久存储的区域
tempFilePath: res.tempFilePath,
success: (saveResult) => {
// 在保存文件成功后,使用 uni.openDocument 方法打开文件
console.log('文件保存成功:', saveResult);
uni.openDocument({
filePath: saveResult.savedFilePath,
fileType: fileType, //这里把预先限定好的文件类型传来
success: function () {
console.log('文件打开成功!');
//至此,手机会从app中跳转到文件预览界面
//之后可从预览界面返回app中
},
fail: function (err) {
console.log('打开失败', err);
}
});
},
fail: function (err) {
console.log('保存文件失败', err);
}
});
}
},
fail: function (err) {
console.log('下载失败:', err);
}
});
},
//文件预览
prefile(e) {
let that = this;
let url = '/api/static/123.pdf';
uni.downloadFile({
url: url,
success: function (res) {
let filepathss = plus.io.convertLocalFileSystemURL(res.tempFilePath);
setTimeout(
() =>
uni.openDocument({
filePath: filepathss,
showMenu: false,
success: function () {
console.log('打开文档成功');
},
fail: function () {
uni.showToast({
title: '暂不支持此类型',
duration: 2000,
icon: 'none'
});
}
}),
1000
);
},
fail: function (res) {
console.log(res); //失败
}
});
}
}
};
</script>
<style lang="scss"></style>
\ No newline at end of file
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
:style=" `height: calc(100% - ${showSummary?80:40}px)`"> :style=" `height: calc(100% - ${showSummary?80:40}px)`">
<view class="zb-table-fixed"> <view class="zb-table-fixed">
<view class="zb-table-tbody"> <view class="zb-table-tbody">
<view :class="['item-tr',highlight&&isHighlight(item,index)?'current-row':'']" <view :class="['item-tr',highlight&&isHighlight(item,index)?'current-row':'', isTrClassStyle&&isTrClassStyle(item,index)? 'trbg': '']"
@click.stop="rowClick(item,index)" @click.stop="rowClick(item,index)"
v-for="(item,index) in transData" :key="item.key"> v-for="(item,index) in transData" :key="item.key">
<view <view
...@@ -466,6 +466,10 @@ export default { ...@@ -466,6 +466,10 @@ export default {
type: String, type: String,
default: '合计' default: '合计'
}, },
isTrClassStyle: {
type: Function,
default: ()=> {}
},
showHeader: { showHeader: {
type: Boolean, type: Boolean,
default: true default: true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment