master
mhsnet 2 months ago
parent 9642f5df10
commit 8efe1d6a46

@ -2,14 +2,37 @@ import request from "@/utils/request";
// 采购协同列表-App // 采购协同列表-App
export function getOrderList(params) { export function getOrderList(params) {
let data = { let data = {
orderStatus: params.orderStatus, orderStatus: params.orderStatus,
moduleId: "591255416864768197", moduleId: "591255416864768197",
menuId: "591260119262560581", menuId: "591260119262560581",
}; };
return request({ return request({
url: "/api/example/YysMaterialProcurementOrder/list", url: "/api/example/YysMaterialProcurementOrder/list",
method: "POST", method: "POST",
data, 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,9 +10,10 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"crypto-js": "^4.1.1" "crypto-js": "^4.1.1",
"dayjs": "^1.11.12"
}, },
"extensions": { "extensions": {
"uni-cloud-push": {} "uni-cloud-push": {}
} }
} }

@ -1,23 +1,12 @@
<template> <template>
<u-navbar :is-back="true" title="采购协同" :background="{backgroundColor: '#375AC8'}" title-color="white" back-icon-color="white"> <u-navbar
<!-- <view class="slot-wrap"> :is-back="true"
<u-image title="采购协同"
width="100%" :background="{ backgroundColor: '#375AC8' }"
height="100%" title-color="white"
src="/static/images/yyslogo.png" back-icon-color="white"
mode="aspectFit" >
></u-image>
</view> -->
</u-navbar> </u-navbar>
</template> </template>
<style lang="scss" scope> <style lang="scss" scope></style>
.sty-nav /deep/ .u-slot-content {
height: 100%;
.slot-wrap {
width: 100%;
height: 100%;
background: #375AC8;
}
}
</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,83 +34,92 @@
</u-row> </u-row>
</view> </view>
<view class="" slot="foot"> <view class="" slot="foot">
<u-button <template v-if="orderItem.orderStatus == 1">
size="mini" <u-button
:custom-style="{ size="mini"
color: 'white', :custom-style="{
margin: '5px', color: 'white',
backgroundImage: margin: '5px',
'linear-gradient(to right, rgb(111, 137, 221), rgb(42, 75, 180))', backgroundImage:
}" 'linear-gradient(to right, rgb(111, 137, 221), rgb(42, 75, 180))',
:plain="true" }"
shape="false" :plain="true"
> shape="circle"
接单 @click="fnTakeOrder(orderItem)"
</u-button> >
<u-button 接单
size="mini" </u-button>
:custom-style="{ </template>
color: 'white', <template v-else-if="orderItem.orderStatus == 2">
margin: '5px', <u-button
backgroundImage: size="mini"
'linear-gradient(to right, rgb(255, 133, 133), rgb(249, 61, 61))', :custom-style="{
}" color: 'white',
:plain="true" margin: '5px',
shape="false" backgroundImage:
> 'linear-gradient(to right, rgb(255, 133, 133), rgb(249, 61, 61))',
延期发货 }"
</u-button> :plain="true"
<u-button shape="circle"
size="mini" >
:custom-style="{ 延期发货
color: 'white', </u-button>
margin: '5px', <u-button
backgroundImage: size="mini"
'linear-gradient(to right, rgb(255, 199, 131), rgb(252, 136, 13))', :custom-style="{
}" color: 'white',
:plain="true" margin: '5px',
shape="false" backgroundImage:
> 'linear-gradient(to right, rgb(255, 199, 131), rgb(252, 136, 13))',
缺货结单 }"
</u-button> :plain="true"
<u-button shape="circle"
size="mini" >
:custom-style="{ 缺货结单
color: 'white', </u-button>
margin: '5px', <u-button
backgroundImage: size="mini"
'linear-gradient(to right, rgb(111, 137, 221), rgb(42, 75, 180))', :custom-style="{
}" color: 'white',
:plain="true" margin: '5px',
shape="false" backgroundImage:
> 'linear-gradient(to right, rgb(111, 137, 221), rgb(42, 75, 180))',
投产 }"
</u-button> :plain="true"
<u-button shape="circle"
size="mini" @click="fnToProd(orderItem)"
:custom-style="{ >
color: 'white', 投产
margin: '5px', </u-button>
backgroundImage: <u-button
'linear-gradient(to right, rgb(126, 237, 140), rgb(74, 215, 92))', size="mini"
}" :custom-style="{
:plain="true" color: 'white',
shape="false" margin: '5px',
> backgroundImage:
发货 'linear-gradient(to right, rgb(126, 237, 140), rgb(74, 215, 92))',
</u-button> }"
:plain="true"
shape="circle"
>
发货
</u-button>
</template>
</view> </view>
</u-card> </u-card>
<PopToProd ref="popToProd" @evtRefresh="fnRefreshA"></PopToProd>
<u-top-tips ref="uTips"></u-top-tips>
</view> </view>
</template> </template>
<script> <script>
import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js"; import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
import { mapGetters } from "vuex"; 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 CustomNavbar from "./components/CustomNavbar";
import PopToProd from "./components/PopToProd";
export default { export default {
components: { CustomNavbar }, components: { CustomNavbar, PopToProd },
mixins: [], mixins: [],
data() { data() {
return { return {
@ -152,6 +161,42 @@ export default {
console.log(err); 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> </script>

Loading…
Cancel
Save