报工确认基础列表

master
mhsnet 2 months ago
parent 0449a2357d
commit 233b85b744

@ -0,0 +1,20 @@
import request from "@/utils/request";
// 报工确认列表-app
export function confirm(params) {
let data = {
flag: params.flag,
};
return request({
url: "/api/example/YysDayWork/confirm",
method: "POST",
data,
});
}
// 获取用户列表-app
export function userList() {
return request({
url: "/api/system/DataInterface/595963517819945029/Actions/Preview",
method: "POST",
});
}

@ -64,6 +64,13 @@
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, },
{
"path": "pages/yys/dayWork/index",
"style": {
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
{ {
"path": "pages/login/index", "path": "pages/login/index",
"style": { "style": {

@ -39,7 +39,7 @@
methods: { methods: {
handleToBooking(item) { handleToBooking(item) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/yys/materialProcurementOrder/index?test=1' url: item.path
}); });
}, },
}, },

@ -7,7 +7,6 @@
<CustomNavbar /> <CustomNavbar />
<view class="cont"> <view class="cont">
<CategoryPanel :list="categoryList" /> <CategoryPanel :list="categoryList" />
<footRight />
</view> </view>
</template> </template>
</view> </view>
@ -33,14 +32,14 @@ export default {
key: "product", key: "product",
children: [ children: [
{ {
path: "productionReport", path: "/pages/yys/materialProcurementOrder/index",
name: "采购协同", name: "采购协同",
auth: true, auth: true,
imgUrl: "/static/images/caigouxietong@1x.png", imgUrl: "/static/images/caigouxietong@1x.png",
defaultImgUrl: "/static/images/caigouxietong-wuquanxian@1x.png", defaultImgUrl: "/static/images/caigouxietong-wuquanxian@1x.png",
}, },
{ {
path: "assembleReport", path: "/pages/yys/dayWork/index",
name: "报工确认", name: "报工确认",
auth: true, auth: true,
imgUrl: "/static/images/baogongqueren@1x.png", imgUrl: "/static/images/baogongqueren@1x.png",

@ -0,0 +1,12 @@
<template>
<u-navbar
:is-back="true"
title="报工确认"
:background="{ backgroundColor: '#375AC8' }"
title-color="white"
back-icon-color="white"
>
</u-navbar>
</template>
<style lang="scss" scope></style>

@ -0,0 +1,448 @@
<template>
<view>
<u-popup
v-model="isShow"
mode="left"
:border-radius="10"
:closeable="true"
@close="fnCancel"
width="100%"
height="100%"
>
<u-row gutter="12">
<u-col span="12">
<view
:style="{ textAlign: 'center', height: '60px', lineHeight: '60px' }"
>
<text
:style="{ fontSize: '40rpx', fontWeight: 500, color: '#1D2129' }"
>报工确认</text
>
</view>
</u-col>
<u-col span="3" :style="{ padding: '5px', textAlign: 'right' }">
<text>机采数量</text>
</u-col>
<u-col span="9" :style="{ padding: '5px' }">
<text>{{ dataItem.isConfirmNums }}</text>
</u-col>
<u-col span="3" :style="{ padding: '5px', textAlign: 'right' }">
<text>合格数量</text>
</u-col>
<u-col span="9" :style="{ padding: '5px' }">
<u-input
v-model="dataItem.defectiveNum"
type="number"
:border="true"
height="100%"
/>
</u-col>
<u-col span="3" :style="{ padding: '5px', textAlign: 'right' }">
<text>次品数量</text>
</u-col>
<u-col span="9" :style="{ padding: '5px' }">
<u-input
v-model="dataItem.qualifiedNum"
type="number"
:border="true"
height="100%"
/>
</u-col>
<u-col span="3" :style="{ padding: '5px', textAlign: 'right' }">
<text>报工班组</text>
</u-col>
<u-col span="9" :style="{ padding: '5px' }">
<text>{{ dataItem.groupName }}</text>
</u-col>
<u-col
v-if="dataItem.groupType == '1'"
span="12"
:style="{ padding: '5px' }"
>
<view
:style="{
color: '#0D0D26',
fontWeight: 'bloder',
textAlign: 'center',
padding: '10px',
}"
>
<text>报工成员(生成线报工)</text>
</view>
<view>
<u-table>
<u-tr class="u-tr">
<u-th>
<view class="u-th">
<text>姓名</text>
</view>
</u-th>
<u-th>
<view class="u-th">
<text>报工数量</text>
</view>
</u-th>
<u-th>
<view class="u-th">
<text>补偿工时</text>
</view>
</u-th>
<u-th>
<view class="u-th">
<u-icon
name="plus-circle"
color="green"
size="36"
@click="fnProdReportItemAdd"
></u-icon>
</view>
</u-th>
</u-tr>
<u-tr
class="u-tr"
v-for="(
prodReportItem, prodReportIndex
) in dataItem.prodReportList"
:key="prodReportIndex"
>
<u-td>
<view class="u-td">
<text>{{ prodReportItem.reportMember }}</text>
</view>
</u-td>
<u-td>
<view class="u-td">
<text>{{ dataItem.defectiveNum }}</text>
</view>
</u-td>
<u-td>
<view class="u-td">
<u-input
v-model="prodReportItem.compensatoryHour"
type="number"
:border="true"
height="100%"
/>
</view>
</u-td>
<u-td>
<view class="u-td">
<u-icon name="minus-circle" color="red" size="36"></u-icon>
</view>
</u-td>
</u-tr>
</u-table>
</view>
</u-col>
<u-col
v-else-if="dataItem.groupType == '2'"
span="12"
:style="{ padding: '5px' }"
>
<view
:style="{
color: '#0D0D26',
fontWeight: 'bloder',
textAlign: 'center',
padding: '10px',
}"
>
<text>报工成员(包装线报工)</text>
</view>
<view>
<u-table>
<u-tr class="u-tr">
<u-th>
<view class="u-th">
<text>姓名</text>
</view>
</u-th>
<u-th>
<view class="u-th">
<text>报工数量</text>
</view>
</u-th>
<u-th>
<view class="u-th">
<text>补偿工时</text>
</view>
</u-th>
<u-th>
<view class="u-th">
<u-icon
name="plus-circle"
color="green"
size="36"
@click="fnPackageReportItemAdd"
></u-icon>
</view>
</u-th>
</u-tr>
<u-tr
class="u-tr"
v-for="(
packageReportItem, packageReportIndex
) in dataItem.packageReportList"
:key="packageReportIndex"
>
<u-td>
<view class="u-td">{{ packageReportItem.reportMember }}</view>
</u-td>
<u-td>
<view class="u-td">{{ dataItem.defectiveNum }}</view>
</u-td>
<u-td>
<view class="u-td">
<u-input
v-model="packageReportItem.compensatoryHour"
type="number"
:border="true"
height="100%"
/>
</view>
</u-td>
<u-td>
<view class="u-td">
<u-icon name="minus-circle" color="red" size="36"></u-icon>
</view>
</u-td>
</u-tr>
</u-table>
</view>
</u-col>
<u-col span="12" :style="{ padding: '5px' }">
<view
:style="{
color: '#0D0D26',
fontWeight: 'bloder',
textAlign: 'center',
padding: '10px',
}"
>
<text>领料上报</text>
</view>
<view>
<u-table>
<u-tr class="u-tr">
<u-th>
<view class="u-th">
<text>材料名称</text>
</view>
</u-th>
<u-th>
<view class="u-th">
<text>当班领用</text>
</view>
</u-th>
<u-th>
<view class="u-th">
<text>本班结存</text>
</view>
</u-th>
<u-th>
<view class="u-th">
<u-icon
name="plus-circle"
color="green"
size="36"
@click="fnRequisitionReportItemAdd"
></u-icon>
</view>
</u-th>
</u-tr>
<u-tr
class="u-tr"
v-for="(
requisitionReportItem, requisitionReportIndex
) in dataItem.requisitionReportList"
:key="requisitionReportIndex"
>
<u-td class="u-td">{{
requisitionReportItem.materialCode
}}</u-td>
<u-td class="u-td">
<u-input
v-model="requisitionReportItem.duty"
type="number"
:border="true"
height="100%"
/>
</u-td>
<u-td class="u-td">
<u-input
v-model="requisitionReportItem.classBalance"
type="number"
:border="true"
height="100%"
/>
</u-td>
<u-td class="u-td"
><u-icon name="minus-circle" color="red" size="36"></u-icon
></u-td>
</u-tr>
</u-table>
</view>
</u-col>
<u-col span="12">
<view :style="{ textAlign: 'center', margin: '25rpx 0rpx' }">
<u-button
size="mini"
shape="circle"
type="primary"
:custom-style="{
margin: '5px 20px',
padding: '5px 20px',
}"
@click="fnOk"
>
报工确认
</u-button>
</view>
</u-col>
</u-row>
</u-popup>
<u-top-tips ref="uTips"></u-top-tips>
</view>
</template>
<script>
import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
import { mapGetters } from "vuex";
import { toProd } from "@/api/yys/materialProcurementOrder.js";
import { userList } from "@/api/yys/dayWork.js";
import dayjs from "dayjs";
export default {
components: {},
mixins: [],
data() {
return {
isShow: false,
productionNumber: undefined,
dataItem: {},
productionTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
isShowPickerA: false,
pickerParams: {
year: true,
month: true,
day: true,
hour: true,
minute: true,
second: true,
},
prodReportItemO: {
reportMember: undefined,
compensatoryHour: undefined,
},
packageReportItemO: {
reportMember: undefined,
compensatoryHour: undefined,
},
requisitionReportItemO: {
materialCode: undefined,
duty: undefined,
classBalance: undefined,
},
};
},
watch: {},
computed: {},
onLoad(params) {},
onUnload() {},
methods: {
init(dataItem) {
if (!dataItem.prodReportList) {
dataItem.prodReportList = [];
}
if (!dataItem.packageReportList) {
dataItem.packageReportList = [];
}
if (!dataItem.requisitionReportList) {
dataItem.requisitionReportList = [];
}
this.fnUserList();
this.dataItem = dataItem;
this.productionNumber = undefined;
this.productionTime = dayjs().format("YYYY-MM-DD HH:mm:ss");
this.isShow = true;
},
fnCancel() {
this.dataItem = {};
this.isShow = false;
},
fnOk() {
if (!this.productionNumber) {
this.$refs.uTips.show({
title: "数量不能为空",
type: "error",
duration: "2300",
});
console.log(this.productionNumber);
return true;
}
let _params = {
orderNumber: this.dataItem.orderNumber,
productionTime: dayjs(this.productionTime),
productionNumber: this.productionNumber,
};
toProd(_params)
.then((res) => {
if (res.code == 200) {
this.$emit("evtRefresh");
}
})
.catch((err) => {
console.log(err);
});
this.fnCancel();
},
fnShowPickerA() {
this.isShowPickerA = true;
},
fnProductionTime(timeObj) {
this.productionTime =
timeObj.year +
"-" +
timeObj.month +
"-" +
timeObj.day +
" " +
timeObj.hour +
":" +
timeObj.minute +
":" +
timeObj.second;
},
fnUserList() {
userList()
.then((res) => {
if (res.code == 200) {
console.log(res);
}
})
.catch((err) => {
console.log(err);
});
},
fnProdReportItemAdd() {
this.dataItem.prodReportList.push(this.prodReportItemO);
},
fnPackageReportItemAdd() {
this.dataItem.packageReportList.push(this.packageReportItemO);
},
fnRequisitionReportItemAdd() {
this.dataItem.requisitionReportList.push(this.requisitionReportItemO);
},
},
};
</script>
<style lang="scss" scoped>
/deep/.u-th {
width: 100%;
height: 32px;
}
/deep/.u-td {
width: 100%;
height: 32px;
}
</style>

@ -0,0 +1,140 @@
<template>
<view class="viewport">
<CustomNavbar />
<u-tabs
:list="tabsList"
:is-scroll="false"
:current="tabsCurrent"
@change="fnTabsChg"
></u-tabs>
<u-card v-for="orderItem in orderList">
<view class="" slot="head">
<text>{{ orderItem.deviceCode }}{{ orderItem.deviceName }}</text>
</view>
<view class="" slot="body">
<u-row gutter="16">
<u-col span="12">
<text>生成日期</text
><text>{{ fnFormat(orderItem.manufactureTime) }}</text>
</u-col>
<u-col span="6">
<text>产品名称</text><text>{{ orderItem.productName }}</text>
</u-col>
<u-col span="6">
<text>规格型号</text><text>{{ orderItem.models }}</text>
</u-col>
<u-col span="6">
<text>计划数量</text
><text
>{{ orderItem.planNumber }} {{ orderItem.measurementUnit }}</text
>
</u-col>
<u-col span="6">
<text>待确认数量</text
><text
>{{ orderItem.isConfirmNums }}
{{ orderItem.measurementUnit }}</text
>
</u-col>
<u-col span="12">
<text>班次</text><text>{{ orderItem.className }}</text>
</u-col>
<u-col span="12">
<text>开始结束时间</text
><text>{{ orderItem.startTime }} - {{ orderItem.endTime }}</text>
</u-col>
</u-row>
</view>
<view :style="{ textAlign: 'center' }" slot="foot">
<u-button
size="mini"
:custom-style="{
color: 'white',
margin: '5px',
backgroundColor: '#2A4BB4',
}"
:plain="true"
shape="circle"
@click="fnPopSure(orderItem)"
>
<text :style="{ padding: '20px' }">去确认</text>
</u-button>
</view>
</u-card>
<PopSure ref="refPopSure" @evtRefresh="fnRefreshA"></PopSure>
<u-top-tips ref="uTips"></u-top-tips>
</view>
</template>
<script>
import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
import { mapGetters } from "vuex";
import dayjs from "dayjs";
import {
getOrderList,
takeOrder,
finish,
} from "@/api/yys/materialProcurementOrder.js";
import { confirm } from "@/api/yys/dayWork.js";
import CustomNavbar from "./components/CustomNavbar";
import PopSure from "./components/PopSure";
export default {
components: { CustomNavbar, PopSure },
mixins: [],
data() {
return {
isLoading: false,
tabsList: [
{ name: "未确认", flag: "1" },
{ name: "已确认", flag: "2" },
],
tabsCurrent: 0,
orderList: [],
};
},
watch: {},
computed: {},
onLoad(params) {
this.fnGetList();
},
onUnload() {},
methods: {
fnTabsChg(index) {
this.tabsCurrent = index;
this.fnGetList();
},
fnGetList() {
let tabsNow = this.tabsList[this.tabsCurrent];
let params = {
flag: tabsNow.flag,
};
confirm(params)
.then((res) => {
if (res.code == 200) {
this.orderList = res.data;
}
console.log(res);
})
.catch((err) => {
console.log(err);
});
},
fnPopSure(orderItem) {
this.$refs.refPopSure.init(orderItem);
},
fnRefreshA() {
this.$refs.uTips.show({
title: "投产提交成功",
type: "success",
duration: "2300",
});
this.fnGetList();
},
fnFormat(time, fmtStr = "YYYY-MM-DD") {
return dayjs(time).format(fmtStr);
},
},
};
</script>
<style lang="scss"></style>
Loading…
Cancel
Save