123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298 |
- <template>
- <view class="content">
- <view class="one">
- <view class="one_1">
- <text>
- <text class="iconfont icon-changshangguanli"></text>
- {{info.supplier_name}}
- </text>
- <text class="status">{{info.zhStatus}}</text>
- </view>
- <view class="one_2">
- <view class="left">
- <image v-if="info.spec_file" class="image"
- :src="info.spec_file&&info.spec_file.length>0?info.spec_file[0].url:''" mode="">
- </image>
- <image v-else class="image" :src="info.good_file&&info.good_file.length>0?info.good_file[0].url:''"
- mode="">
- </image>
- </view>
- <view class="right">
- <view class="name textOver">
- <text>{{info.zhType||'暂无'}}</text>
- <text>{{info.good_name||'暂无'}}</text>
- </view>
- <view class="spec textOver">
- <text>规格:{{info.spec_name||'暂无'}}</text>
- </view>
- <view class="num">
- <text>数量:{{info.num||'暂无'}}</text>
- </view>
- <view class="money">
- <text>¥{{info.money||'暂无'}}</text>
- </view>
- </view>
- </view>
- </view>
- <view class="two">
- <view class="two_1">
- <text>订单号:</text>
- <text>{{info.order_id||'暂无'}}</text>
- </view>
- <view class="two_1">
- <text>下单时间:</text>
- <text>{{info.buy_time||'暂无'}}</text>
- </view>
- <view class="two_1" v-if="info.leader_name">
- <text>采购审批领导:</text>
- <text>{{info.leader_name||'暂无'}}</text>
- </view>
- <view class="two_1" v-if="info.accounting_name">
- <text>采购审批会计:</text>
- <text>{{info.accounting_name||'暂无'}}</text>
- </view>
- </view>
- <view class="thr">
- <view class="thr_1">
- <text>下单人员:</text>
- <text>{{info.user_name||'暂无'}}</text>
- </view>
- <view class="thr_1">
- <text>下单角色:</text>
- <text>{{info.zhRole||'暂无'}}</text>
- </view>
- <view class="thr_1">
- <text>下单人员电话:</text>
- <text>{{info.user_tel||'暂无'}}</text>
- </view>
- <view class="thr_1">
- <text>收货地址:</text>
- <text>{{info.address||'暂无'}}</text>
- </view>
- </view>
- <view class="four">
- <view class="left">
- <text>商品总价</text>
- </view>
- <view class="right">
- <text>¥{{info.total_money||'暂无'}}</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- id: '',
- user: {},
- info: {},
- // 字典表
- statusList: [],
- typeList: [],
- roleList: []
- }
- },
- onLoad: async function(e) {
- const that = this;
- that.$set(that, `id`, e && e.id || '');
- that.searchToken();
- await that.searchOther();
- await that.search();
- },
- methods: {
- searchToken() {
- const that = this;
- try {
- const res = uni.getStorageSync('token');
- if (res) that.$set(that, `user`, res);
- } catch (e) {
- uni.showToast({
- title: err.errmsg,
- icon: 'error',
- duration: 2000
- });
- }
- },
- async search() {
- const that = this;
- if (that.id) {
- const res = await that.$api(`/OrderDetail/detail/${that.id}`, 'GET', {})
- if (res.errcode == '0') {
- res.data.zhStatus = that.searchDict(res.data.status, 'status')
- res.data.zhType = that.searchDict(res.data.good_type, 'type')
- res.data.zhRole = that.searchDict(res.data.user_role, 'role')
- that.$set(that, `info`, res.data)
- } else {
- uni.showToast({
- title: res.errmsg,
- });
- }
- }
- },
- // 查询字典表
- searchDict(e, model) {
- const that = this;
- let data
- if (model == 'status') {
- data = that.statusList.find((i) => i.value == e);
- if (data) return data.label
- else return '暂无'
- } else if (model == 'type') {
- data = that.typeList.find((i) => i.value == e);
- if (data) return data.label
- else return '暂无'
- } else {
- data = that.roleList.find((i) => i.code == e);
- if (data) return data.name
- else return '暂无'
- }
- },
- // 查询其他信息
- async searchOther() {
- const that = this;
- let res;
- // 查询状态
- res = await that.$api(`/DictData`, 'GET', {
- type: 'order_status',
- is_use: '0',
- })
- if (res.errcode == '0') that.$set(that, `statusList`, res.data);
- // 查询类型
- res = await that.$api(`/DictData`, 'GET', {
- type: 'goods_type',
- is_use: '0',
- })
- if (res.errcode == '0') that.$set(that, `typeList`, res.data);
- // 查询角色
- res = await that.$api(`/Role`, 'GET', {
- is_use: '0',
- })
- if (res.errcode == '0') that.$set(that, `roleList`, res.data);
- },
- }
- }
- </script>
- <style lang="scss">
- .content {
- display: flex;
- flex-direction: column;
- width: 100vw;
- height: 100vh;
- background-color: var(--f9Color);
- .one {
- margin: 2vw 2vw 0 2vw;
- padding: 0 2vw;
- border-radius: 10px;
- background-color: var(--mainColor);
- .one_1 {
- display: flex;
- justify-content: space-between;
- padding: 2vw 0;
- font-size: var(--font16Size);
- border-bottom: 1px solid var(--f9Color);
- .status {
- font-size: var(--font14Size);
- color: var(--fF0Color);
- }
- }
- .one_2 {
- display: flex;
- padding: 2vw 0;
- .left {
- .image {
- width: 25vw;
- height: 25vw;
- border-radius: 5px;
- }
- }
- .right {
- width: 65vw;
- margin: 0 0 0 2vw;
- .name {
- padding: 1vw 0 0 0;
- font-size: var(--font14Size);
- text:first-child {
- font-size: var(--font12Size);
- color: var(--mainColor);
- background-color: var(--f3CColor);
- border-radius: 5px;
- padding: 2px 5px;
- }
- }
- .spec {
- font-size: var(--font12Size);
- }
- .num {
- font-size: var(--font12Size);
- color: var(--f85Color);
- }
- .money {
- font-size: var(--font14Size);
- font-weight: bold;
- }
- }
- }
- }
- .two {
- margin: 2vw 2vw 0 2vw;
- padding: 2vw;
- border-radius: 10px;
- background-color: var(--mainColor);
- .two_1 {
- padding: 2vw 0;
- font-size: var(--font14Size);
- text:first-child {
- color: var(--f85Color);
- }
- }
- }
- .thr {
- margin: 2vw 2vw 0 2vw;
- padding: 0 2vw;
- border-radius: 10px;
- background-color: var(--mainColor);
- .thr_1 {
- padding: 2vw 0;
- font-size: var(--font14Size);
- text:first-child {
- color: var(--f85Color);
- }
- }
- }
- .four {
- display: flex;
- justify-content: space-between;
- margin: 2vw 2vw 0 2vw;
- padding: 2vw;
- border-radius: 10px;
- background-color: var(--mainColor);
- font-size: var(--font14Size);
- .left {
- color: var(--f85Color);
- }
- }
- }
- </style>
|