|
@@ -22,210 +22,251 @@
|
|
</div> -->
|
|
</div> -->
|
|
<div class="m-core">
|
|
<div class="m-core">
|
|
<div class="tableWrap">
|
|
<div class="tableWrap">
|
|
- <el-table :header-cell-style="{background:'#EDEEF0',color:'#444'}"
|
|
|
|
- :data='tableList'>
|
|
|
|
- <el-table-column label="商品编号"
|
|
|
|
- prop='sn'
|
|
|
|
- align="center">
|
|
|
|
|
|
+ <el-table
|
|
|
|
+ :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
|
|
|
|
+ :data="tableList"
|
|
|
|
+ >
|
|
|
|
+ <el-table-column label="商品编号" prop="sn" align="center">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="商品名称"
|
|
|
|
- align="center"
|
|
|
|
- prop='name'>
|
|
|
|
|
|
+ <el-table-column label="商品名称" align="center" prop="name">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="商品类型"
|
|
|
|
- align="center"
|
|
|
|
- prop='type'>
|
|
|
|
|
|
+ <el-table-column label="商品类型" align="center" prop="type">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<div>
|
|
<div>
|
|
{{ scope.row.type | shopType }}
|
|
{{ scope.row.type | shopType }}
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="具体型号"
|
|
|
|
- align="center"
|
|
|
|
- prop='specification'>
|
|
|
|
|
|
+ <el-table-column label="具体型号" align="center" prop="specification">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="数量统计"
|
|
|
|
- align="center"
|
|
|
|
- prop='sellCount'>
|
|
|
|
|
|
+ <el-table-column label="数量统计" align="center" prop="sellCount">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div class="btnWrap"
|
|
|
|
- style="margin-top:20px;">
|
|
|
|
- <el-button type="primary"
|
|
|
|
- v-if="tableList.length > 0"
|
|
|
|
- v-permission="'order/musicalListExport'"
|
|
|
|
- @click="musicalListExport">订货清单导出</el-button>
|
|
|
|
- <el-button type="primary"
|
|
|
|
- v-if="tableList.length > 0"
|
|
|
|
- v-permission="'order/musicalListDetailExport'"
|
|
|
|
- @click="musicalListDetailExport">分发清单导出</el-button>
|
|
|
|
- <el-button type="warning okBtn"
|
|
|
|
- v-if="team_status =='PREPARE'"
|
|
|
|
- v-permission="'order/verifyMusicalList'"
|
|
|
|
- @click="okDetailList">确认</el-button>
|
|
|
|
|
|
+ <div class="btnWrap" style="margin-top: 20px">
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ v-if="tableList.length > 0"
|
|
|
|
+ v-permission="'order/musicalListExport'"
|
|
|
|
+ @click="musicalListExport"
|
|
|
|
+ >订货清单导出</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ v-if="tableList.length > 0"
|
|
|
|
+ v-permission="'order/musicalListDetailExport'"
|
|
|
|
+ @click="musicalListDetailExport"
|
|
|
|
+ >分发清单导出</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ type="warning okBtn"
|
|
|
|
+ v-if="team_status == 'PREPARE'&&!hasVerifyMusicalList"
|
|
|
|
+ v-permission="'order/verifyMusicalList'"
|
|
|
|
+ @click="okDetailList"
|
|
|
|
+ >确认</el-button
|
|
|
|
+ >
|
|
<!-- <div class="okBtn" v-permission="'order/verifyMusicalList'"
|
|
<!-- <div class="okBtn" v-permission="'order/verifyMusicalList'"
|
|
@click="okDetailList">确认</div> -->
|
|
@click="okDetailList">确认</div> -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
-import { getTeamDetailList } from '@/api/buildTeam'
|
|
|
|
-import { verifyMusicalList } from '@/api/orderManager'
|
|
|
|
-import axios from 'axios'
|
|
|
|
-import qs from 'qs'
|
|
|
|
-import { getToken } from '@/utils/auth'
|
|
|
|
-import load from '@/utils/loading'
|
|
|
|
|
|
+import { getTeamDetailList } from "@/api/buildTeam";
|
|
|
|
+import { getTeamList } from "@/api/teamServer";
|
|
|
|
+import { verifyMusicalList } from "@/api/orderManager";
|
|
|
|
+import axios from "axios";
|
|
|
|
+import qs from "qs";
|
|
|
|
+import { getToken } from "@/utils/auth";
|
|
|
|
+import load from "@/utils/loading";
|
|
export default {
|
|
export default {
|
|
- data () {
|
|
|
|
|
|
+ data() {
|
|
return {
|
|
return {
|
|
- teamid: '',
|
|
|
|
|
|
+ teamid: "",
|
|
tableList: [],
|
|
tableList: [],
|
|
Fsearch: null,
|
|
Fsearch: null,
|
|
Frules: null,
|
|
Frules: null,
|
|
- team_status:''
|
|
|
|
- }
|
|
|
|
|
|
+ team_status: "",
|
|
|
|
+ hasVerifyMusicalList:true
|
|
|
|
+ };
|
|
},
|
|
},
|
|
- mounted () {
|
|
|
|
- this.init()
|
|
|
|
|
|
+ mounted() {
|
|
|
|
+ this.init();
|
|
},
|
|
},
|
|
- activated () {
|
|
|
|
- this.init()
|
|
|
|
|
|
+ activated() {
|
|
|
|
+ this.init();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- init () {
|
|
|
|
|
|
+ init() {
|
|
this.team_status = this.$route.query.team_status;
|
|
this.team_status = this.$route.query.team_status;
|
|
this.teamid = this.$route.query.id;
|
|
this.teamid = this.$route.query.id;
|
|
- getTeamDetailList({ musicGroupId: this.teamid }).then(res => {
|
|
|
|
- if (res.code == 200) {
|
|
|
|
- this.tableList = res.data ? res.data : [];
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- onCancel () {
|
|
|
|
- this.$store.dispatch('delVisitedViews', this.$route)
|
|
|
|
- this.$router.push({ path: '/teamList'})
|
|
|
|
- },
|
|
|
|
- okDetailList () {
|
|
|
|
- this.$confirm(`是否确认发放清单?`, '提示', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
- type: 'warning'
|
|
|
|
- }).then(() => {
|
|
|
|
- verifyMusicalList({ musicGroupId: this.teamid }).then(res => {
|
|
|
|
|
|
+ if (this.teamid) {
|
|
|
|
+ getTeamList({ musicGroupId: this.teamid }).then(res=>{
|
|
|
|
+ if(res.code == 200){
|
|
|
|
+ this.hasVerifyMusicalList = res?.data?.rows[0]?.hasVerifyMusicalList
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ getTeamDetailList({ musicGroupId: this.teamid }).then((res) => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
- this.$router.push({ path: '/teamList', query: { search: this.Fsearch, rules: this.Frules } })
|
|
|
|
|
|
+ this.tableList = res.data ? res.data : [];
|
|
}
|
|
}
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ onCancel() {
|
|
|
|
+ this.$store.dispatch("delVisitedViews", this.$route);
|
|
|
|
+ this.$router.push({ path: "/teamList" });
|
|
|
|
+ },
|
|
|
|
+ okDetailList() {
|
|
|
|
+ this.$confirm(`是否确认发放清单?`, "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ verifyMusicalList({ musicGroupId: this.teamid }).then((res) => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ path: "/teamList",
|
|
|
|
+ query: { search: this.Fsearch, rules: this.Frules },
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
})
|
|
})
|
|
- }).catch(() => { })
|
|
|
|
-
|
|
|
|
|
|
+ .catch(() => {});
|
|
},
|
|
},
|
|
- musicalListExport () { // 报表导出
|
|
|
|
- let url = '/api-web/order/musicalListExport'
|
|
|
|
|
|
+ musicalListExport() {
|
|
|
|
+ // 报表导出
|
|
|
|
+ let url = "/api-web/order/musicalListExport";
|
|
let data = {
|
|
let data = {
|
|
musicGroupId: this.$route.query.id,
|
|
musicGroupId: this.$route.query.id,
|
|
- }
|
|
|
|
|
|
+ };
|
|
const options = {
|
|
const options = {
|
|
- method: 'POST',
|
|
|
|
|
|
+ method: "POST",
|
|
headers: {
|
|
headers: {
|
|
- 'Authorization': getToken()
|
|
|
|
|
|
+ Authorization: getToken(),
|
|
},
|
|
},
|
|
data: qs.stringify(data),
|
|
data: qs.stringify(data),
|
|
url,
|
|
url,
|
|
- responseType: 'blob'
|
|
|
|
- }
|
|
|
|
- this.$confirm('您确定导出订货清单', '提示', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
- type: 'warning'
|
|
|
|
- }).then(() => {
|
|
|
|
- load.startLoading()
|
|
|
|
- axios(options).then(res => {
|
|
|
|
- let blob = new Blob([res.data], {
|
|
|
|
- // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
|
|
|
|
- type: 'application/vnd.ms-excel;charset=utf-8'
|
|
|
|
- //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
|
|
|
|
- })
|
|
|
|
- let text = (new Response(blob)).text()
|
|
|
|
- text.then(res => {
|
|
|
|
- // 判断是否报错
|
|
|
|
- if (res.indexOf('code') != -1) {
|
|
|
|
- let json = JSON.parse(res)
|
|
|
|
- this.$message.error(json.msg)
|
|
|
|
- } else {
|
|
|
|
- let objectUrl = URL.createObjectURL(blob)
|
|
|
|
- let link = document.createElement("a")
|
|
|
|
- let nowTime = new Date()
|
|
|
|
- let ymd = nowTime.getFullYear() + '' + (nowTime.getMonth() + 1) + '' + nowTime.getDate() + '' + nowTime.getHours() + '' + nowTime.getMinutes()
|
|
|
|
- let fname = this.$route.query.id + '-' + ymd + '订货清单.xls' //下载文件的名字
|
|
|
|
- link.href = objectUrl
|
|
|
|
- link.setAttribute("download", fname)
|
|
|
|
- document.body.appendChild(link)
|
|
|
|
- link.click()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- load.endLoading();
|
|
|
|
- }).catch(error => {
|
|
|
|
- this.$message.error('导出数据失败,请联系管理员');
|
|
|
|
- load.endLoading();
|
|
|
|
|
|
+ responseType: "blob",
|
|
|
|
+ };
|
|
|
|
+ this.$confirm("您确定导出订货清单", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ load.startLoading();
|
|
|
|
+ axios(options)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ let blob = new Blob([res.data], {
|
|
|
|
+ // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
|
|
|
|
+ type: "application/vnd.ms-excel;charset=utf-8",
|
|
|
|
+ //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
|
|
|
|
+ });
|
|
|
|
+ let text = new Response(blob).text();
|
|
|
|
+ text.then((res) => {
|
|
|
|
+ // 判断是否报错
|
|
|
|
+ if (res.indexOf("code") != -1) {
|
|
|
|
+ let json = JSON.parse(res);
|
|
|
|
+ this.$message.error(json.msg);
|
|
|
|
+ } else {
|
|
|
|
+ let objectUrl = URL.createObjectURL(blob);
|
|
|
|
+ let link = document.createElement("a");
|
|
|
|
+ let nowTime = new Date();
|
|
|
|
+ let ymd =
|
|
|
|
+ nowTime.getFullYear() +
|
|
|
|
+ "" +
|
|
|
|
+ (nowTime.getMonth() + 1) +
|
|
|
|
+ "" +
|
|
|
|
+ nowTime.getDate() +
|
|
|
|
+ "" +
|
|
|
|
+ nowTime.getHours() +
|
|
|
|
+ "" +
|
|
|
|
+ nowTime.getMinutes();
|
|
|
|
+ let fname = this.$route.query.id + "-" + ymd + "订货清单.xls"; //下载文件的名字
|
|
|
|
+ link.href = objectUrl;
|
|
|
|
+ link.setAttribute("download", fname);
|
|
|
|
+ document.body.appendChild(link);
|
|
|
|
+ link.click();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ load.endLoading();
|
|
|
|
+ })
|
|
|
|
+ .catch((error) => {
|
|
|
|
+ this.$message.error("导出数据失败,请联系管理员");
|
|
|
|
+ load.endLoading();
|
|
|
|
+ });
|
|
})
|
|
})
|
|
- }).catch(() => { })
|
|
|
|
|
|
+ .catch(() => {});
|
|
},
|
|
},
|
|
- musicalListDetailExport () { // 报表导出
|
|
|
|
- let url = '/api-web/order/musicalListDetailExport'
|
|
|
|
|
|
+ musicalListDetailExport() {
|
|
|
|
+ // 报表导出
|
|
|
|
+ let url = "/api-web/order/musicalListDetailExport";
|
|
let data = {
|
|
let data = {
|
|
- musicGroupId: this.$route.query.id
|
|
|
|
- }
|
|
|
|
|
|
+ musicGroupId: this.$route.query.id,
|
|
|
|
+ };
|
|
const options = {
|
|
const options = {
|
|
- method: 'POST',
|
|
|
|
|
|
+ method: "POST",
|
|
headers: {
|
|
headers: {
|
|
- 'Authorization': getToken()
|
|
|
|
|
|
+ Authorization: getToken(),
|
|
},
|
|
},
|
|
data: qs.stringify(data),
|
|
data: qs.stringify(data),
|
|
url,
|
|
url,
|
|
- responseType: 'blob'
|
|
|
|
- }
|
|
|
|
- this.$confirm('您确定导出分发清单', '提示', {
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
- type: 'warning'
|
|
|
|
- }).then(() => {
|
|
|
|
- load.startLoading()
|
|
|
|
- axios(options).then(res => {
|
|
|
|
- let blob = new Blob([res.data], {
|
|
|
|
- // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
|
|
|
|
- type: 'application/vnd.ms-excel;charset=utf-8'
|
|
|
|
- //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
|
|
|
|
- })
|
|
|
|
- let text = (new Response(blob)).text()
|
|
|
|
- text.then(res => {
|
|
|
|
- // 判断是否报错
|
|
|
|
- if (res.indexOf('code') != -1) {
|
|
|
|
- let json = JSON.parse(res)
|
|
|
|
- this.$message.error(json.msg)
|
|
|
|
- } else {
|
|
|
|
- let objectUrl = URL.createObjectURL(blob)
|
|
|
|
- let link = document.createElement("a")
|
|
|
|
- let nowTime = new Date()
|
|
|
|
- let ymd = nowTime.getFullYear() + '' + (nowTime.getMonth() + 1) + '' + nowTime.getDate() + '' + nowTime.getHours() + '' + nowTime.getMinutes()
|
|
|
|
- let fname = this.$route.query.id + '-' + ymd + '分发清单.xls' //下载文件的名字
|
|
|
|
- link.href = objectUrl
|
|
|
|
- link.setAttribute("download", fname)
|
|
|
|
- document.body.appendChild(link)
|
|
|
|
- link.click()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- load.endLoading();
|
|
|
|
- }).catch(error => {
|
|
|
|
- this.$message.error('导出数据失败,请联系管理员');
|
|
|
|
- load.endLoading();
|
|
|
|
|
|
+ responseType: "blob",
|
|
|
|
+ };
|
|
|
|
+ this.$confirm("您确定导出分发清单", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ load.startLoading();
|
|
|
|
+ axios(options)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ let blob = new Blob([res.data], {
|
|
|
|
+ // type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
|
|
|
|
+ type: "application/vnd.ms-excel;charset=utf-8",
|
|
|
|
+ //word文档为application/msword,pdf文档为application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8
|
|
|
|
+ });
|
|
|
|
+ let text = new Response(blob).text();
|
|
|
|
+ text.then((res) => {
|
|
|
|
+ // 判断是否报错
|
|
|
|
+ if (res.indexOf("code") != -1) {
|
|
|
|
+ let json = JSON.parse(res);
|
|
|
|
+ this.$message.error(json.msg);
|
|
|
|
+ } else {
|
|
|
|
+ let objectUrl = URL.createObjectURL(blob);
|
|
|
|
+ let link = document.createElement("a");
|
|
|
|
+ let nowTime = new Date();
|
|
|
|
+ let ymd =
|
|
|
|
+ nowTime.getFullYear() +
|
|
|
|
+ "" +
|
|
|
|
+ (nowTime.getMonth() + 1) +
|
|
|
|
+ "" +
|
|
|
|
+ nowTime.getDate() +
|
|
|
|
+ "" +
|
|
|
|
+ nowTime.getHours() +
|
|
|
|
+ "" +
|
|
|
|
+ nowTime.getMinutes();
|
|
|
|
+ let fname = this.$route.query.id + "-" + ymd + "分发清单.xls"; //下载文件的名字
|
|
|
|
+ link.href = objectUrl;
|
|
|
|
+ link.setAttribute("download", fname);
|
|
|
|
+ document.body.appendChild(link);
|
|
|
|
+ link.click();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ load.endLoading();
|
|
|
|
+ })
|
|
|
|
+ .catch((error) => {
|
|
|
|
+ this.$message.error("导出数据失败,请联系管理员");
|
|
|
|
+ load.endLoading();
|
|
|
|
+ });
|
|
})
|
|
})
|
|
- }).catch(() => { })
|
|
|
|
- }
|
|
|
|
|
|
+ .catch(() => {});
|
|
|
|
+ },
|
|
},
|
|
},
|
|
-}
|
|
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|