master
mhsnet 2 months ago
parent 9642f5df10
commit 8efe1d6a46

@ -13,3 +13,26 @@ export function getOrderList(params) {
data,
});
}
// 接单-App
export function takeOrder(params) {
let data = {
orderNumber: params.orderNumber,
};
return request({
url:
"/api/example/YysMaterialProcurementOrder/takeOrder/" + data.orderNumber,
method: "GET",
});
}
export function toProd(params) {
let data = {
orderNumber: params.orderNumber,
productionTime: params.productionTime,
productionNumber: params.productionNumber,
};
return request({
url: "/api/example/YysMaterialProcurementOrder/toProd",
method: "POST",
data,
});
}

@ -10,7 +10,8 @@
"author": "",
"license": "ISC",
"dependencies": {
"crypto-js": "^4.1.1"
"crypto-js": "^4.1.1",
"dayjs": "^1.11.12"
},
"extensions": {
"uni-cloud-push": {}

@ -1,23 +1,12 @@
<template>
<u-navbar :is-back="true" title="采购协同" :background="{backgroundColor: '#375AC8'}" title-color="white" back-icon-color="white">
<!-- <view class="slot-wrap">
<u-image
width="100%"
height="100%"
src="/static/images/yyslogo.png"
mode="aspectFit"
></u-image>
</view> -->
<u-navbar
:is-back="true"
title="采购协同"
:background="{ backgroundColor: '#375AC8' }"
title-color="white"
back-icon-color="white"
>
</u-navbar>
</template>
<style lang="scss" scope>
.sty-nav /deep/ .u-slot-content {
height: 100%;
.slot-wrap {
width: 100%;
height: 100%;
background: #375AC8;
}
}
</style>
<style lang="scss" scope></style>

@ -0,0 +1,169 @@
<template>
<view>
<u-popup
v-model="isShow"
mode="center"
:border-radius="10"
:closeable="true"
@close="fnCancel"
width="90%"
>
<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="12" :style="{ margin: '10rpx' }">
<text :style="{ fontSize: '32rpx' }"> 本次投产时间 </text>
<text :style="{ fontSize: '32rpx' }" @click="fnShowPickerA">
{{ productionTime }}
</text>
<u-picker
mode="time"
:default-time="productionTime"
v-model="isShowPickerA"
:params="pickerParams"
@confirm="fnProductionTime"
></u-picker>
</u-col>
<u-col span="12" :style="{ margin: '10rpx' }">
<text :style="{ color: 'red' }">*</text> <text>本次投产数量</text>
</u-col>
<u-col span="10">
<view :style="{ textAlign: 'center', margin: '10rpx' }">
<u-input
v-model="productionNumber"
type="number"
:border="true"
placeholder="请输入投产数量"
/>
</view>
</u-col>
<u-col span="2">
<text>{{ orderItem.unit }}</text>
</u-col>
<u-col span="12">
<view :style="{ textAlign: 'center', margin: '25rpx 0rpx' }">
<u-button
size="mini"
shape="circle"
@click="fnCancel"
:custom-style="{
margin: '5px 20px',
padding: '5px 20px',
}"
>
取消
</u-button>
<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 dayjs from "dayjs";
export default {
components: {},
mixins: [],
data() {
return {
isShow: false,
productionNumber: undefined,
orderItem: {},
productionTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
isShowPickerA: false,
pickerParams: {
year: true,
month: true,
day: true,
hour: true,
minute: true,
second: true,
},
};
},
watch: {},
computed: {},
onLoad(params) {},
onUnload() {},
methods: {
init(orderItem) {
this.orderItem = orderItem;
this.isShow = true;
},
fnCancel() {
this.orderItem = {};
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.orderItem.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;
},
},
};
</script>
<style lang="scss"></style>

@ -34,6 +34,7 @@
</u-row>
</view>
<view class="" slot="foot">
<template v-if="orderItem.orderStatus == 1">
<u-button
size="mini"
:custom-style="{
@ -43,10 +44,13 @@
'linear-gradient(to right, rgb(111, 137, 221), rgb(42, 75, 180))',
}"
:plain="true"
shape="false"
shape="circle"
@click="fnTakeOrder(orderItem)"
>
接单
</u-button>
</template>
<template v-else-if="orderItem.orderStatus == 2">
<u-button
size="mini"
:custom-style="{
@ -56,7 +60,7 @@
'linear-gradient(to right, rgb(255, 133, 133), rgb(249, 61, 61))',
}"
:plain="true"
shape="false"
shape="circle"
>
延期发货
</u-button>
@ -69,7 +73,7 @@
'linear-gradient(to right, rgb(255, 199, 131), rgb(252, 136, 13))',
}"
:plain="true"
shape="false"
shape="circle"
>
缺货结单
</u-button>
@ -82,7 +86,8 @@
'linear-gradient(to right, rgb(111, 137, 221), rgb(42, 75, 180))',
}"
:plain="true"
shape="false"
shape="circle"
@click="fnToProd(orderItem)"
>
投产
</u-button>
@ -95,22 +100,26 @@
'linear-gradient(to right, rgb(126, 237, 140), rgb(74, 215, 92))',
}"
:plain="true"
shape="false"
shape="circle"
>
发货
</u-button>
</template>
</view>
</u-card>
<PopToProd ref="popToProd" @evtRefresh="fnRefreshA"></PopToProd>
<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 { getOrderList } from "@/api/yys/materialProcurementOrder.js";
import { getOrderList, takeOrder } from "@/api/yys/materialProcurementOrder.js";
import CustomNavbar from "./components/CustomNavbar";
import PopToProd from "./components/PopToProd";
export default {
components: { CustomNavbar },
components: { CustomNavbar, PopToProd },
mixins: [],
data() {
return {
@ -152,6 +161,42 @@ export default {
console.log(err);
});
},
fnTakeOrder(orderItem) {
uni.showModal({
title: "确认接单",
content: "确认接单(编号:" + orderItem.orderNumber + ")",
success: (res) => {
if (res.confirm) {
//
console.log("用户确认接单");
takeOrder(orderItem)
.then((res) => {
if (res.code == 200) {
this.fnGetList();
}
})
.catch((err) => {
console.log(err);
});
} else if (res.cancel) {
//
console.log("用户取消接单");
}
},
});
console.log(orderItem);
},
fnToProd(orderItem) {
this.$refs.popToProd.init(orderItem);
},
fnRefreshA() {
this.$refs.uTips.show({
title: '投产提交成功',
type: 'success',
duration: '2300'
})
this.fnGetList();
},
},
};
</script>

Loading…
Cancel
Save