123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
- <template>
- <view style="width: 100%;">
- <view class="card_ordermang" v-for="(item,index) in orderList" :key="index" @click="goOrderDetails(item)">
- <view class="head_ordermang space_between">
- <view class="waybill_title">运单号:<span>{{item.waybillNo}}</span></view>
- <span class="card_state" :style="{color:getState(item.status)}">{{orderStatus(item.status)}}</span>
- </view>
- <view class="space_between">
- <view class="card_specification">
- <view class="specification_title">
- <u-tag :text="item.temperatureInterval" plain size="mini" type="success"
- @click="goOrderDetails(item)"></u-tag>
- </view>
- <view class="specification_title">
- <u-tag :text="item.deliveryCondition" plain size="mini" type="primary"
- @click="goOrderDetails(item)"></u-tag>
- </view>
- <view class="specification_title">
- <u-tag :text="item.cargoType" plain size="mini" type="warning"
- @click="goOrderDetails(item)"></u-tag>
- </view>
- </view>
- <view style="font-size: 28rpx;">x{{item.quantity}}</view>
- </view>
- <view class="title_ordermang"><span>收货地址:</span>{{item.consigneeAddressDetails}}</view>
- <view class="title_ordermang"><span>收货电话:</span>{{item.consigneeAddressPhone}}</view>
- <view class="title_ordermang"><span>下单时间:</span>{{item.orderTime}}</view>
- <view style="display: flex;">
- <view class="btn_printil markd10"
- v-if="item.status == 1 || item.status == 2 || item.status == 3 || item.status == 9"
- @click.stop="modifyOrder(item)">
- <u-button size="small" type="warning" text="修改订单"></u-button>
- </view>
- <view class="btn_printil markd10" v-if="printbarCode(item.status)" @click.stop="printBarCode(item)">
- <u-button size="small" type="primary" text="打印条码"></u-button>
- </view>
- </view>
- <view style="display: flex;">
- <view class="btn_printil markd10" v-if="item.status == 8 && userInfo.userType == 'sys'"
- @click.stop="sendmail(item)">
- <u-button size="small" type="primary" text="发送温湿度记录PDF"></u-button>
- </view>
- <view class="btn_printil markd10" v-if="item.status == 8 && userInfo.userType == 'sys'"
- @click.stop="humidityRecording(item)">
- <u-button size="small" type="success" text="打印温湿度记录"></u-button>
- </view>
- </view>
- </view>
- <u-popup :show="shareShow" mode="center" round="5" closeable @close="shareShow = false">
- <view style="padding: 0rpx 30rpx 30rpx 30rpx;margin-top: 50rpx; width: 400rpx;">
- <u-button style="margin: 20rpx 0rpx;" type="success" text="发送邮箱" @click="sendingMailbox"></u-button>
- <u-button type="primary" text="分享微信好友" @click="shareWechatFriends"></u-button>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- const FileShare = uni.requireNativePlugin('life-FileShare');
- export default {
- name: 'xOrderManagement',
- props: {
- // 订单列表
- orderList: {
- type: Array,
- default: () => [],
- },
- userInfo: {
- type: Object,
- default: () => {},
- }
- },
- data() {
- return {
- shareShow: false,
- optionList: {},
- }
- },
- mounted() {
- // console.log(this.userInfo, 26)
- },
- methods: {
- // 打印条码
- printBarCode(value) {
- this.$cache.setCache('commodity', JSON.stringify(value))
- uni.navigateTo({
- url: '/pages/order/quantum?waybillNo=' + value.waybillNo + '&printType=barCode'
- });
- },
- // 打印温湿度记录
- humidityRecording(value) {
- this.$cache.setCache('commodity', JSON.stringify(value))
- uni.navigateTo({
- url: '/pages/order/quantum?waybillNo=' + value.waybillNo + '&printType=record'
- });
- },
- // 发送邮件
- sendmail(value) {
- this.shareShow = true
- this.optionList = value
- },
- // 发送邮箱
- sendingMailbox() {
- this.shareShow = false
- this.$emit('sendmail', this.optionList)
- },
- // 分享微信好友
- shareWechatFriends() {
- uni.showLoading({
- title: '获取温湿度记录中,请稍等',
- mask: true,
- });
- this.$api.post('/api/waybill/temperature-pdf-url', {
- waybillNo: this.optionList.waybillNo,
- }).then(res => {
- if (res.code == 200) {
- let arrData = res.data.split("/");
- var dtask = plus.downloader.createDownload(res.data, {
- filename: "_doc/pdf/" + arrData[3]
- }, function(d, status) {
- // 下载完成
- if (status == 200) {
- FileShare.render({
- type: "WX", //QQ为QQ,微信为WX,系统默认是SYSTEM,不填写默认SYSTEM
- filePath: plus.io.convertLocalFileSystemURL(d.filename),
- }, result => {
- uni.hideLoading()
- });
- } else {
- console.log("Download failed: " + status);
- }
- });
- dtask.start();
- }
- uni.hideLoading()
- }).catch(() => {
- uni.hideLoading()
- })
- return
- },
- // 修改订单
- modifyOrder(value) {
- this.$cache.setCache('orderDetails', value)
- uni.redirectTo({
- url: '/pages/order/addWaybill?title=修改订单&type=2'
- });
- },
- // 订单详情
- goOrderDetails(value) {
- this.$cache.setCache('orderDetails', value)
- uni.navigateTo({
- url: '/pages/order/orderDetails?type=details'
- });
- },
- // 订单状态
- orderStatus(value) {
- if (this.userInfo.userType == 'sys') {
- if (this.userInfo.type == 2) {
- // 仓管
- if (value == 3) {
- return '未入库'
- } else if (value == 5) {
- return '已入库'
- } else if (value == 9) {
- return '待装箱'
- } else if (value == 10) {
- return '已装箱'
- } else if (value == 11) {
- return '已出箱'
- } else if (value == 7) {
- return '已出库'
- }
- } else if (this.userInfo.type == 3) {
- // 司机
- if (value == 2) {
- return '未装车'
- } else if (value == 9) {
- return '待装箱'
- } else if (value == 10) {
- return '已装箱'
- } else if (value == 4) {
- return '已装车'
- } else if (value == 6) {
- return '已下车'
- } else if (value == 8) {
- return '已签收'
- }
- }
- } else {
- if (value == 1 || value == 2 || value == 3) {
- return '未发货'
- } else if (value == 4 || value == 5 || value == 6 || value == 7) {
- return '已发货'
- } else if (value == 8) {
- return '已签收'
- }
- }
- },
- // 订单文字颜色
- getState(value) {
- if (this.userInfo.userType == 'sys') {
- if (this.userInfo.type == 2) {
- // 仓管
- if (value == 3) {
- return '#ff9900'
- } else if (value == 9) {
- return '#ff9900'
- } else if (value == 10) {
- return '#19be6b'
- } else if (value == 5) {
- return '#19be6b'
- } else {
- return '#606266'
- }
- } else if (this.userInfo.type == 3) {
- // 司机
- if (value == 2) {
- return '#ff9900'
- } else if (value == 9) {
- return '#ff9900'
- } else if (value == 10) {
- return '#19be6b'
- } else if (value == 4) {
- return '#19be6b'
- } else if (value == 6) {
- return '#19be6b'
- } else {
- return '#606266'
- }
- }
- } else {
- if (value == 1 || value == 2 || value == 3) {
- return '#ff9900'
- } else if (value == 4 || value == 5 || value == 6 || value == 7) {
- return '#19be6b'
- } else {
- return '#606266'
- }
- }
- },
- // 打印运单
- printbarCode(type) {
- if (this.userInfo.userType === 'sys' && [2, 3, 9, 10].includes(type)) {
- return true
- } else {
- return false
- }
- }
- }
- }
- </script>
- <style lang="scss">
- .card_ordermang {
- background-color: #fff;
- padding: 20rpx;
- border-radius: 20rpx;
- margin: 20rpx;
- }
- .head_ordermang {
- margin-bottom: 10rpx;
- }
- .title_ordermang {
- margin-top: 10rpx;
- font-size: 26rpx;
- color: #909399;
- span {
- font-size: 26rpx;
- color: #909399;
- margin-right: 10rpx;
- }
- }
- .waybill_title {
- font-size: 32rpx;
- span {
- margin-left: 10rpx;
- }
- }
- .card_state {
- color: #606266;
- font-size: 32rpx;
- }
- .card_specification {
- display: flex;
- align-items: center;
- }
- .specification_title {
- margin-right: 20rpx;
- }
- .btn_printil {
- flex: 1;
- margin-top: 10px;
- }
- .markd10:nth-child(1) {
- margin: 10px 10rpx 0px 0rpx;
- }
- .markd10:nth-child(2) {
- margin: 10px 0rpx 0px 10rpx;
- }
- </style>
|