Commit c80f1e8d by 前端

版本功能代码提交

1 parent facdae94
......@@ -110,6 +110,7 @@ export function insertOrUpdatePrivacyAgreement(data) {
// 技师查询
export function getRoleTechnician(data) {
data.method = `${path2}roleTechnician.list`
return request(data, "post")
}
// 获取支付渠道列表
......
......@@ -184,3 +184,9 @@ export function carUploadRecordAdd(data) {
data.method = `${path2}carUploadRecord.add`
return request(data, "post")
}
/** 接车单、交车单上传记录删除 */
export function carUploadRecordDelete(data) {
data.method = `${path2}carUploadRecord.delete`
return request(data, "post")
}
......@@ -51,8 +51,6 @@
import storeList from './storeList'
import couponsDetail from './couponsDetail'
import editCouponsDialog from './editCouponsDialog'
// import { exportListApi, exportDetailListApi } from '@api/coupons'
// import { asyncExportExcel } from '@api/sys.base'
import { getDistinctColum } from '@api/coupons'
import { Util, deepClone } from '@/common/util'
import { BaseData, inviteStatusList } from '@/common/constants.js'
......
......@@ -53,9 +53,6 @@
<script>
import { inviteStatMerchantList, dateUpdate, cancelInvite } from '@api/invitation'
import { Util, deepClone } from "@/common/util"
import {
actionOpt
} from "@/common/constants.js"
export default {
name: "ReservationDialog",
components: {},
......
......@@ -100,8 +100,6 @@ import reservationDialog from './reservationDialog'
import remarkDialog from './remarkDialog'
import workSetDialog from './workSetDialog'
import { queryInviteRecord, inviteRecordCount, getInviteMerchant } from '@api/invitation'
import { getParkStore } from "@api/editCustomer"
import { getServiceStore } from "@api/order"
import { scheduling_inviteStatus } from '@/common/constants.js'
export default {
name: 'Scheduling',
......@@ -151,8 +149,8 @@ export default {
label: "到店时间",
name: "toShopDate",
type: "datePicker",
isClear: true,
pickerOptions: "rangePickerOptions"
isClear: true
// pickerOptions: "rangePickerOptions"
}, {
label: '门店名称',
name: 'merchantId',
......@@ -272,8 +270,6 @@ export default {
async getBaseData() {
this.getInviteMerchant()
// this.getParkStore()
// this.pointRule()
this.getOptionsList()
},
......@@ -311,8 +307,8 @@ export default {
delete params.inviteMode
inviteRecordCount(params).then((res) => {
this.tabPaneList[0].count = res.inviteCount
this.tabPaneList[1].count = res.notInvitedCount
this.tabPaneList[2].count = res.hadInvitedCount
this.tabPaneList[1].count = res.hadInvitedCount
this.tabPaneList[2].count = res.notInvitedCount
})
},
getInviteMerchant() {
......@@ -321,25 +317,6 @@ export default {
this.getOptionsList()
})
},
getParkStore() {
getParkStore({}).then((res) => {
res.forEach((item) => {
item.merchantId = item.merchantNo
})
this.baseData.storeIdList = res
this.getOptionsList()
})
},
getServiceStore(merchantIds) {
getServiceStore({
// yqMerchantId: merchantId
yqMerchantIds: merchantIds,
scene: 1
}).then((res) => {
this.baseData.parkServiceList = res || []
this.getOptionsList()
})
},
handleReset() {
this.searchForm = {
customerName: '',
......@@ -370,87 +347,6 @@ export default {
})
},
// 模板下载
exportTemplate() {
var params = {}
params.method = 'dj.api.smartcarlife.resident.point.import.template.export.async'
const list = [
...this.dowloadList,
{
name: '驻店积分记录模板',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
handleBatchImport() {
this.fileVisible = !this.fileVisible
this.$refs.fileRuleForm && this.$refs.fileRuleForm.resetFields()
},
// 上传文件,转码为base64
importFile(e) {
const size = e.target.files[0].size / 1024 / 1024
if (size < 9) {
this.$set(this.fileForm, 'fileName', e.target.files[0].name)
// // 转码base64
const reader = new FileReader()
reader.readAsDataURL(e.target.files[0])
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
this.fileInfo = e.target.files[0].name.split('.')[e.target.files[0].name.split('.')?.length - 1] + '@' + arrBase64[1]
document.getElementById('fileUpload').value = ''
}
} else {
this.notice.errorTips('上传文件不可超过9M')
}
},
handleConfirmImport() {
this.$refs.fileRuleForm.validate(valid => {
if (valid) {
var params = {
file: this.fileInfo
}
pointImport(params).then(res => {
if (res) {
// 异步处理文件上传 把id传入处理轮询
// const list = [...this.updateList, {
// name: this.fileForm.fileName,
// ifSuccess: false,
// uuid: res,
// type: 'upload'
// }]
// this.actionSetDownloadList({ list, type: 'updateList' })
this.notice.okTips(res)
this.handleBatchImport()
this.$refs.recordListTable.refreshTable()
}
})
}
})
},
findAllPersonRelations(sourceType) {
const params = { sourceType: sourceType }
findAllPersonRelations(params).then((res) => {
if (sourceType == 1) { // 督导
this.baseData.supervisorOpt = res
} else if (sourceType == 2) { // 销售
this.baseData.saleOpt = res
}
this.getOptionsList()
})
},
handleExport() {
var params = this.searchFormSearch
pointExport(params).then((res) => {
res && downLoadFile(res)
})
},
handleRamrk(row) {
this.recordInfo = row
this.remarkVisible = !this.remarkVisible
......
......@@ -66,11 +66,8 @@
</template>
<script>
import { Util, deepClone } from "@/common/util"
import { deepClone } from "@/common/util"
import { inviteStationSetGet, inviteStationSetUpdate, yqMerchantPage } from '@api/invitation'
import {
actionOpt
} from "@/common/constants.js"
export default {
name: "WorkSetDialog",
components: {},
......@@ -182,20 +179,6 @@ export default {
})
},
changeInvoiceSubject(val) {
this.infoForm.invoiceSubjectName = this.options.find(item => item.companyCode === val).companyName
},
changeSwitchSubject(val) {
this.infoForm.switchSubjectName = this.options.find(item => item.companyCode === val).companyName
},
changeEmails(val) {
if (val) {
this.infoForm.warningEmailsShow = val
} else {
this.infoForm.warningEmailsShow = '__________'
}
},
handleAddConfirm() {
this.$refs.editRef.validate((valid) => {
if (valid) {
......
......@@ -36,17 +36,17 @@
<img class="signRefundIcon"
src="./images/sign.png" /> 标记为已开票
</el-button>
</span>
<span v-if="[2,4].includes(detail.status) || detail.constructionFlag == 'Y'">
&nbsp;&nbsp;&nbsp;<el-button size="mini"
v-if="[2,4].includes(detail.status)"
class="signRefundBtn"
@click="Invoicing(detail.id)">
@click="handleCarFileExport(0)">
<img class="signRefundIcon"
src="./images/print.png" /> 打印接车单
</el-button>
&nbsp;&nbsp;&nbsp;<el-button size="mini"
v-if="[2,4].includes(detail.status)"
class="signRefundBtn"
@click="Invoicing(detail.id)">
@click="handleCarFileExport(1)">
<img class="signRefundIcon"
src="./images/print.png" /> 打印交车单
</el-button>
......@@ -143,20 +143,49 @@
</el-form-item>
<el-form-item class="photoItem"
label="接车单:">
<el-button type="text"
class="timesSle"
@click="handleUpload('0')">上传接车单扫描件</el-button>
<!-- <div class="picItem">
<div v-if="!pickUpOrder">
<el-button type="text"
@click="handleUpload('0')">上传接车单扫描件</el-button>
</div>
<div v-else
class="picItem">
<img class="icon"
src="./images/file-pdf.png" />
<span class="label">PDF</span>
<span class="label"
:title="pickUpOrder.fileName">
<el-button type="text"
@click="handleCarFileUpload(pickUpOrder)">{{ pickUpOrder.fileName ? (pickUpOrder.fileName.length > 5 ? (pickUpOrder.fileName.slice(0, 5) + '...') : pickUpOrder.fileName) : '' }}</el-button>
</span>
<span class="handle"
@click="handleEnlargeFile(detail.payOrder.zyVoucherUrl)">预览
@click="handleCarFilePreview(pickUpOrder.fileUrl)">预览
</span>
<span class="handle"
@click="handleEnlargeFile(detail.payOrder.zyVoucherUrl)">删除
@click="handleCarFileDelete(pickUpOrder.id)">删除
</span>
</div> -->
</div>
</el-form-item>
<el-form-item class="photoItem"
label="交车单:">
<div v-if="!deliveryNote">
<el-button type="text"
@click="handleUpload('1')">上传交车单扫描件</el-button>
</div>
<div v-else
class="picItem">
<img class="icon"
src="./images/file-pdf.png" />
<span class="label"
:title="deliveryNote.fileName">
<el-button type="text"
@click="handleCarFileUpload(deliveryNote)">{{ deliveryNote.fileName ? (deliveryNote.fileName.length > 5 ? (deliveryNote.fileName.slice(0, 5) + '...') : deliveryNote.fileName) : '' }}</el-button>
</span>
<span class="handle"
@click="handleCarFilePreview(deliveryNote.fileUrl)">预览
</span>
<span class="handle"
@click="handleCarFileDelete(deliveryNote.id)">删除
</span>
</div>
</el-form-item>
<el-form-item class="remarkItem"
label="备注:">
......@@ -457,7 +486,7 @@
<input type="file"
id="fileUpload"
class="import-input"
accept=".xls,.xlsx,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
accept="application/pdf"
@change="importFile($event)">
</el-button>
</el-col>
......@@ -470,14 +499,14 @@
<script>
import refundDetail from "./components/refundDetail.vue"
import { mapActions } from "vuex"
import { mapActions, mapState } from "vuex"
// import signRefundDialog from './signRefundDialog'
import remarkDialog from "./remarkDialog"
import technicianDialog from "./components/technicianDialog"
import { deepClone } from "@/common/util"
import { deepClone, downLoadFile } from "@/common/util"
import { payType, BaseData, invoiceTypeOpt, invalidFlagOpt } from "@/common/constants.js"
import dayjs from "dayjs"
import { goodsOrderDetail, markAsInvoiced, carUploadRecordAdd } from "@api/order"
import { goodsOrderDetail, markAsInvoiced, carUploadRecordAdd, carUploadRecordDelete } from "@api/order"
import newSignRefundDialog from "./components/newSignRefundDialog"
import alyOss from '@/common/oss.js'
export default {
......@@ -562,10 +591,15 @@ export default {
fileRules: {
fileName: [{ required: true, message: '请上传文件', trigger: 'change' }]
},
carFileType: "" // 0接车单1交车单
carFileType: "", // 0接车单1交车单
pickUpOrder: null, // 接车单信息
deliveryNote: null // 交车单信息
}
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
}),
specialAccout() {
return this.userInfo?.loginAccount?.loginAccout == "18123663366"
}
......@@ -586,6 +620,7 @@ export default {
methods: {
...mapActions({ close: "d2admin/page/close" }),
...mapActions("d2admin/base", ["get"]),
...mapActions('d2admin/user', ['actionSetDownloadList']),
async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList)
},
......@@ -834,6 +869,16 @@ export default {
vptInvoiceInfo.invoiceKindShow = this.invoiceTypeOpt.find(item => item.confId === vptInvoiceInfo.invoiceKind)?.confValue || '-'
vptInvoiceInfo.invalidFlagShow = this.invalidFlagOpt.find(item => item.confId === vptInvoiceInfo.invalidFlag)?.confValue || '-'
}
const carFiles = this.detail.carUploadRecordList
if (carFiles && carFiles.length > 0) {
carFiles.forEach(item => {
if (item.fileType == 0) { // 接车单
this.pickUpOrder = item
} else if (item.fileType == 1) { // 交车单
this.deliveryNote = item
}
})
}
})
},
......@@ -910,11 +955,9 @@ export default {
fileType: this.carFileType
}
carUploadRecordAdd(params).then(res => {
console.log('res', res)
if (res && res.data && res.data.length > 0) {
this.notice.okTips('上传成功')
this.handleImport()
}
this.notice.okTips('上传成功')
this.handleImport()
this.getGoodsOrderDetail()
})
},
(err) => {
......@@ -926,6 +969,94 @@ export default {
)
}
})
},
handleCarFileUpload(obj) {
// console.log('url', url)
// url && downLoadFile(url)
this.downloadPDF(obj)
},
handleCarFilePreview(url) {
window.open(url)
},
handleCarFileDelete(id) {
this.$confirm('请确认是否要执行当前操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
closeOnClickModal: false
}).then(() => {
var params = {}
params.id = id
carUploadRecordDelete(params).then(res => {
this.notice.okTips('操作成功')
this.pickUpOrder = null
this.deliveryNote = null
this.getGoodsOrderDetail()
})
}).catch(err => {
console.log(err)
})
},
handleCarFileExport(fileType) {
var params = {}
params.orderCode = this.detail.orderCode
params.fileType = fileType
params.method = 'dj.api.smartcarlife.carUploadRecord.export.Async'
const list = [
...this.dowloadList,
{
name: fileType == 0 ? '接车单' : '交车单',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
},
async downloadPDF(obj) {
const pdfUrl = obj.fileUrl // 你的 PDF URL
const fileName = obj.fileName // 你想要的文件名
try {
const response = await fetch(pdfUrl, {
// 如果 PDF 需要登录/Token,可以在这里加 headers
// headers: {
// 'Authorization': 'Bearer your-token-here'
// }
})
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`)
}
// 将响应转为 Blob(二进制数据)
const blob = await response.blob()
// 创建一个指向该 Blob 的 URL
const url = window.URL.createObjectURL(blob)
// 创建一个临时的 a 标签用于下载
const a = document.createElement('a')
a.href = url
a.download = fileName // 指定下载的文件名
a.style.display = 'none'
// 将 a 标签添加到页面并触发点击
document.body.appendChild(a)
a.click()
// 清理:移除 a 标签,释放 Blob URL
document.body.removeChild(a)
window.URL.revokeObjectURL(url)
} catch (error) {
console.error('下载失败:', error)
alert('下载失败,请检查网络或 URL 是否正确')
}
}
}
}
......
......@@ -96,6 +96,7 @@ export default {
},
data() {
return {
userInfo: this.$store.state.d2admin.user.info,
dialogConfig: {
config: {
title: "关联技师",
......@@ -135,8 +136,7 @@ export default {
// 查询领料技师
getRoleTechnicianList() {
const params = {}
// params.yqMerchantId = this.userInfo.merchant.merchantId
params.yqMerchantId = 44209813
params.yqMerchantId = this.userInfo.merchant.merchantId
getRoleTechnician(params).then(res => {
this.baseData.technicianList = res
this.loading = false
......
......@@ -446,8 +446,7 @@ export default {
// 查询领料技师
getRoleTechnicianList() {
const params = {}
// params.yqMerchantId = this.userInfo.merchant.merchantId
params.yqMerchantId = 44209813
params.yqMerchantId = this.userInfo.merchant.merchantId
getRoleTechnician(params).then(res => {
this.baseData.technicianList = res
this.getOptionsList()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!