123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320 |
- <!-- 购卡订单 -->
- <template>
- <div class="silent-expire-alarm">
- <!-- 搜索条件区 -->
- <div class="search-section">
- <Search />
- </div>
- <div class="audit-btn" v-if="userType == 2">
- <a-button @click="showAudit = true" type="text">
- <template #icon>
- <icon-plus-circle />
- </template>
- <template #default>购卡</template>
- </a-button>
- </div>
- <!-- 数据表格 -->
- <a-table :data="tableData" :pagination="pageData" :columns="columns" @page-change="evChangePage"
- :scroll="{ x: 'auto' }">
- <template #image="{ record }">
- <a-image width="60" height="60" :src="record.contractImg" :preview-props="{
- actionsLayout: ['rotateRight', 'zoomIn', 'zoomOut'],
- }">
- </a-image>
- </template>
- <template #id="{ record }">
- <div class="line_heis" @click="openDetail(record)">{{ record.id }}</div>
- </template>
- <template #statusType="{ record }">
- <a-tag color="#ff7d00" v-if="record.moderationStatus == 1">待审核</a-tag>
- <a-tag color="#00b42a" v-if="record.moderationStatus == 2">审核通过</a-tag>
- <a-tag color="#f53f3f" v-if="record.moderationStatus == 3">已驳回</a-tag>
- </template>
- <template #LogisticsStatus="{ record }">
- <a-tag color="#168cff" v-if="record.tmsStatus == 1">未发货</a-tag>
- <a-tag color="#00b42a" v-if="record.tmsStatus == 2">已发货</a-tag>
- </template>
- <template #operate="{ record }">
- <div class="setting">
- <div v-if="userType == 1">
- <a-button type="text" v-if="record.moderationStatus == 1 && record.status == 1"
- @click="statusOrder(record)">审核</a-button>
- <a-button @click="uploadModal(record)" type="text">{{ record.contractImg == '' ? '上传合同' : '查看合同'
- }}</a-button>
- </div>
- <div v-if="userType == 2">
- <a-button type="text" @click="adminCancel(record)"
- v-if="record.moderationStatus == 2 && userType !== 1">退订</a-button>
- </div>
- <a-button @click="openPriceing(record)" type="text" v-if="record.moderationStatus==2 && userType == 1">上传金额</a-button>
- <a-button @click="openDetail(record)" type="text">查看</a-button>
- </div>
- </template>
- </a-table>
- <a-modal v-model:visible="uploadContract" width="600px" title="上传合同"
- @cancel="closeModal(uploadContract, formContract)" @ok="handleBeforeOk" okText="保存" cancelText="关闭">
- <a-form :model="formContract" auto-label-width>
- <a-form-item field="customerName" label="客户名称">
- <div class="audit-txt" style="color:#418035;">{{ FormDataList.userName }}</div>
- </a-form-item>
- <a-form-item field="orderNumber" label="订单编号">
- <div class="audit-txt">{{ FormDataList.id }}</div>
- </a-form-item>
- <a-form-item field="contractImg" label="销售合同">
- <Upload v-model:model-value="formContract.contractImg" />
- </a-form-item>
- </a-form>
- </a-modal>
- <a-modal v-model:visible="showPrning" title="上传金额"
- @cancel="closeModal(showPrning, formPreing)" @ok="handelPriceing" okText="保存" cancelText="关闭">
- <a-form :model="formPreing" auto-label-width>
- <a-form-item label="采购金额">
- <a-input v-model="formPreing.amount" placeholder="请输入采购金额" />
- </a-form-item>
- </a-form>
- </a-modal>
- <Card v-model:modelValue="showAudit" @submit="intData()" />
- <Status v-model:modelValue="showStatus" @submit="intData()" :FormDataList="FormDataList" />
- <Detaile v-model:modelValue="showDetail" @submit="intData()" :FormDataList="FormDataList" />
- <returnCard v-model:modelValue="showReturn" :ReturnData="ReturnData" :id="id" @submit="intData()"></returnCard>
- </div>
- </template>
- <script setup>
- import { ref, onMounted, toRefs } from 'vue';
- import { Message } from '@arco-design/web-vue';
- import { purchaseOrderList, platformUpdate, adminUpdate } from '@/api/path/purchase';
- import { UploadOrderCardContract, TariffOrderCard,SettingPricing } from '@/api/path/order'
- import { Getdictionary } from '@/mixins/index.js'
- import Upload from "@/components/upload/index.vue";
- import Card from './Card.vue'
- import Status from './status.vue'
- import Detaile from './detaile.vue'
- import Search from '@/components/Search/index.vue'
- import returnCard from './returnCard.vue'
- // 数据层
- const state = ref({
- userName: localStorage.getItem('user_login_information')?.username,
- userType: JSON.parse(localStorage.getItem('user_login_information'))?.userType, // 1平台 2用户
- tableData: [],
- currentIndex: null,
- FormDataList: {},
- pageData: {
- total: 0,
- size: 10,
- current: 1,
- },
- showAudit: false,
- showStatus: false,
- formContract: {
- id: null,
- contractImg: []
- }, // 文件上传列表
- showDetail: false,
- uploadContract: false,
- showReturn: false,
- ReturnData: [],
- id: null,
- showPrning:false,
- formPreing:{
- id:'',
- amount:''
- }
- });
- const {
- userType,
- tableData,
- FormDataList,
- pageData,
- showAudit,
- showStatus,
- formContract,
- showDetail,
- uploadContract,
- showReturn,
- ReturnData,
- id,
- showPrning,
- formPreing
- } = toRefs(state.value);
- const columns = [
- { title: '序号', dataIndex: 'index', align: 'center', ellipsis: true },
- { title: '订单编号', slotName: 'id', align: 'center', ellipsis: true },
- { title: '审核状态', slotName: 'statusType', align: 'center', ellipsis: true },
- { title: '物流状态', slotName: 'LogisticsStatus', align: 'center', ellipsis: true },
- { title: '客户名称', dataIndex: 'userName', align: 'center', ellipsis: true },
- { title: '购卡数', dataIndex: 'quantity', align: 'center', ellipsis: true },
- { title: '静默期(月)', dataIndex: 'periodOfSilence', align: 'center', ellipsis: true },
- { title: '卡类型', dataIndex: 'cardType', align: 'center', ellipsis: true },
- { title: '运营商名称', dataIndex: 'sourceName', align: 'center', ellipsis: true },
- { title: '资费', dataIndex: 'trafficName', align: 'center', ellipsis: true },
- { title: '采购金额', dataIndex: 'amount', align: 'center', ellipsis: true },
- { title: '合同照片', slotName: 'image', align: 'center', ellipsis: true },
- { title: '下单时间', dataIndex: 'createdAt', align: 'center', ellipsis: true },
- { title: '操作', slotName: 'operate', align: 'center', ellipsis: true }
- ];
- // 订单列表
- const intData = async () => {
- const param = {
- current: pageData.value.current,
- size: pageData.value.size,
- }
- const simTypeList = await Getdictionary('cardType')
- let sourceList = await Getdictionary('source')
- purchaseOrderList(param).then(res => {
- tableData.value = (res.data.records || []).map((item, key) => {
- const sourceName = sourceList.find(val => val.value == item.source)?.label
- const cardType = simTypeList.find(val => val.value == item.simType)?.label
- return {
- ...item,
- index: key + 1,
- sourceName,
- cardType
- }
- });
- pageData.value.total = res.data.total;
- })
- }
- // 用户退订
- const adminCancel = (data) => {
- TariffOrderCard({ id: data.trafficId }).then(res => {
- ReturnData.value = res.data || []
- })
- id.value = data.id
- showReturn.value = true
- }
- // 分页
- const evChangePage = (page) => {
- pageData.value.current = page
- intData()
- }
- // 订单审核
- const statusOrder = (items) => {
- FormDataList.value = items
- showStatus.value = true
- }
- // 上传合同
- const uploadModal = (item) => {
- uploadContract.value = true;
- FormDataList.value = item
- formContract.value = {
- id: item.id,
- contractImg: item.contractImg
- }
- };
- // 查看订单详情
- const openDetail = async (item) => {
- FormDataList.value = item
- showDetail.value = true;
- }
- // 上传合同
- const handleBeforeOk = () => {
- new Promise((resolve, reject) => {
- formContract.value.id = FormDataList.value.id;
- UploadOrderCardContract(formContract.value).then(res => {
- resolve(res)
- Message.success(res.message)
- intData();
- }).catch(error => {
- reject(error)
- })
- })
- };
- // 模态框取消
- const closeModal = (items, obj) => {
- items = false
- Object.keys(obj).forEach(key => {
- if (obj.key) {
- obj[key] = '';
- }
- })
- }
- const openPriceing = (data)=>{
- showPrning.value = true;
- formPreing.value.id = data.id
- }
- const handelPriceing = async()=>{
- if(formPreing.value.amount=='' || formPreing.value.amount==0){
- return Message.error('输入有误')
- }
- formPreing.value.amount = Number(formPreing.value.amount)
- let res = await SettingPricing(formPreing.value)
- if(res.code===200){
- Message.success(res.message)
- closeModal(showPrning.value, formPreing.value)
- }
- }
- onMounted(() => {
- intData();
- })
- </script>
- <style scoped lang="less">
- .silent-expire-alarm {
- padding: 20px !important;
- // background: #fcf;
- }
- .setting {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .search-section {
- margin-bottom: 20px;
- }
- .arco-table-th {
- white-space: nowrap;
- }
- .audit-txt {
- display: flex;
- flex-wrap: wrap;
- .audit-tag {
- width: 180px;
- color: #b2b2b2;
- margin-right: 20px;
- span {
- color: #000;
- margin-left: 20px;
- }
- }
- }
- .audit-btn {
- margin-bottom: 10px;
- }
- .detail-table {
- margin-top: 20px;
- }
- .line_heis {
- color: #FF8839;
- cursor: pointer;
- display: inline-block;
- }
- .line_heis:hover {
- color: #168cff;
- }
- </style>
|