update: 增加打印
This commit is contained in:
parent
e5bb761556
commit
b71988a8f0
|
@ -98,7 +98,9 @@
|
||||||
<view class="active" @click="handleReviewPay"> 审核立即支付 </view>
|
<view class="active" @click="handleReviewPay"> 审核立即支付 </view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 零皮重不需要重新过皮 -->
|
<!-- 零皮重不需要重新过皮 -->
|
||||||
<view v-if="state.order.scaleStatus === 2 && state.order.weighingMethod === 0">
|
<view
|
||||||
|
v-if="state.order.scaleStatus === 2 && state.order.weighingMethod === 0"
|
||||||
|
>
|
||||||
<u-button
|
<u-button
|
||||||
text="重新过皮"
|
text="重新过皮"
|
||||||
plain
|
plain
|
||||||
|
@ -123,6 +125,7 @@
|
||||||
text="打印"
|
text="打印"
|
||||||
type="primary"
|
type="primary"
|
||||||
:customStyle="{ 'border-radius': '43rpx' }"
|
:customStyle="{ 'border-radius': '43rpx' }"
|
||||||
|
@click="handlePrint"
|
||||||
></u-button>
|
></u-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -164,10 +167,10 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ReceiveApi } from "@/services/index";
|
import { DeviceApi, ReceiveApi } from "@/services/index";
|
||||||
import { onLoad } from "@dcloudio/uni-app";
|
import { onLoad } from "@dcloudio/uni-app";
|
||||||
import SmallModal from "@/components/Modal/smallModal.vue";
|
import SmallModal from "@/components/Modal/smallModal.vue";
|
||||||
import { ScaleStatus } from "@/utils/enum";
|
import { OrderType, ScaleStatus } from "@/utils/enum";
|
||||||
const keyword = ref("");
|
const keyword = ref("");
|
||||||
const contrlModalParams = reactive<{ [attrName: string]: any }>({
|
const contrlModalParams = reactive<{ [attrName: string]: any }>({
|
||||||
paySelect: {
|
paySelect: {
|
||||||
|
@ -222,7 +225,7 @@ const state = reactive<{
|
||||||
}>({
|
}>({
|
||||||
order: {
|
order: {
|
||||||
carNumber: "",
|
carNumber: "",
|
||||||
balanceTotalPrice: 0
|
balanceTotalPrice: 0,
|
||||||
},
|
},
|
||||||
sheetList: [
|
sheetList: [
|
||||||
{
|
{
|
||||||
|
@ -319,7 +322,7 @@ const handleConfirm = () => {
|
||||||
],
|
],
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
state.order.balanceTotalPrice = amount.value || 0
|
state.order.balanceTotalPrice = amount.value || 0;
|
||||||
uni.showToast({ title: "修改成功" });
|
uni.showToast({ title: "修改成功" });
|
||||||
gridList1[gridList1.length - 1].num = amount.value || "";
|
gridList1[gridList1.length - 1].num = amount.value || "";
|
||||||
isInput.value = false;
|
isInput.value = false;
|
||||||
|
@ -387,6 +390,20 @@ const handleReWeight = () => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handlePrint = () => {
|
||||||
|
DeviceApi.print({
|
||||||
|
id: state.order.id,
|
||||||
|
orderType: OrderType.Receive,
|
||||||
|
userId: state.order.deviceId
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "打印成功",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
onLoad((option) => {
|
onLoad((option) => {
|
||||||
state.order.id = parseInt((option as any).id);
|
state.order.id = parseInt((option as any).id);
|
||||||
state.scaleStatus = parseInt((option as any).scaleStatus);
|
state.scaleStatus = parseInt((option as any).scaleStatus);
|
||||||
|
|
|
@ -180,6 +180,7 @@
|
||||||
text="打印"
|
text="打印"
|
||||||
type="primary"
|
type="primary"
|
||||||
:customStyle="{ 'border-radius': '43rpx' }"
|
:customStyle="{ 'border-radius': '43rpx' }"
|
||||||
|
@click="handlePrint"
|
||||||
></u-button>
|
></u-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -207,8 +208,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ShipmentApi } from "@/services/index";
|
import { DeviceApi, ShipmentApi } from "@/services/index";
|
||||||
import { ScaleStatusBtnType } from "@/utils/enum";
|
import { OrderType, ScaleStatusBtnType } from "@/utils/enum";
|
||||||
import { onLoad, onShow } from "@dcloudio/uni-app";
|
import { onLoad, onShow } from "@dcloudio/uni-app";
|
||||||
import SmallModal from "@/components/Modal/smallModal.vue";
|
import SmallModal from "@/components/Modal/smallModal.vue";
|
||||||
const payMethodMap: any = {
|
const payMethodMap: any = {
|
||||||
|
@ -586,6 +587,19 @@ const init = () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const handlePrint = () => {
|
||||||
|
DeviceApi.print({
|
||||||
|
id: state.order.id,
|
||||||
|
orderType: OrderType.Shipment,
|
||||||
|
userId: state.order.deviceId
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
uni.showToast({
|
||||||
|
title: "打印成功",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
init();
|
init();
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,46 +1,54 @@
|
||||||
import { http } from '@/utils/http'
|
import { http } from "@/utils/http";
|
||||||
|
|
||||||
// 设备信息新增
|
// 设备信息新增
|
||||||
export const addDevice = (data: any) => {
|
export const addDevice = (data: any) => {
|
||||||
return http({
|
return http({
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
url: '/api/device/addDevice',
|
url: "/api/device/addDevice",
|
||||||
data,
|
data,
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
// 设备信息修改
|
// 设备信息修改
|
||||||
export const editDevice = (data: any) => {
|
export const editDevice = (data: any) => {
|
||||||
return http({
|
return http({
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
url: '/api/device/edit',
|
url: "/api/device/edit",
|
||||||
data,
|
data,
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
// 设备信息逻辑删除
|
// 设备信息逻辑删除
|
||||||
export const deleteDevice = (data: any) => {
|
export const deleteDevice = (data: any) => {
|
||||||
return http({
|
return http({
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
url: '/api/device/deleteDevice',
|
url: "/api/device/deleteDevice",
|
||||||
data,
|
data,
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
// 设备信息根据id查询
|
// 设备信息根据id查询
|
||||||
export const selectDeviceId = (data: any) => {
|
export const selectDeviceId = (data: any) => {
|
||||||
return http({
|
return http({
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
url: '/api/device/selectDeviceId',
|
url: "/api/device/selectDeviceId",
|
||||||
data,
|
data,
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
// 设备信息根据id查询
|
// 设备信息根据id查询
|
||||||
export const getDeviceList = (data: any) => {
|
export const getDeviceList = (data: any) => {
|
||||||
return http({
|
return http({
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
url: '/api/device/getDeviceList',
|
url: "/api/device/getDeviceList",
|
||||||
data,
|
data,
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
|
// 打印
|
||||||
|
|
||||||
|
export const print = (data: any) => {
|
||||||
|
return http({
|
||||||
|
method: "POST",
|
||||||
|
url: "/api/machine/print",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue