diff --git a/src/api/lease/apply.js b/src/api/lease/apply.js index 622b7599..19789ae6 100644 --- a/src/api/lease/apply.js +++ b/src/api/lease/apply.js @@ -153,3 +153,11 @@ export function getCheckInfo(data) { }) } +// 提交 +export function submitLeaseOutApi(data) { + return request({ + url: '/material/lease_apply_info/submitLeaseOut', + method: 'post', + data + }) +} \ No newline at end of file diff --git a/src/views/material/lease/apply/component/homeApply.vue b/src/views/material/lease/apply/component/homeApply.vue index fc388460..82db1716 100644 --- a/src/views/material/lease/apply/component/homeApply.vue +++ b/src/views/material/lease/apply/component/homeApply.vue @@ -10,8 +10,7 @@ start-placeholder="开始日期" end-placeholder="结束日期" style="width: 240px" - > - + > @@ -26,13 +25,7 @@ - + - 搜索 - - 重置 - + 搜索 + 重置 - 领料申请 - + 领料申请 - + - - + + - - - + + + - + - - + + - + @@ -143,119 +137,130 @@ -
- +
+
施工机具设备出库检验记录表
-
-
+
+
领用工程: {{ checkDataInfo.leaseProject }} -
-
+
+
使用单位: {{ checkDataInfo.leaseUnit }}
- - + + - - - - - - - - + + + + + + + + - + -
-
-
- 检验单位: +
+
+
+ 检验单位: +
+
+ +
-
- -
-
+
+
- -
- +
-
-
- 领料单 -
-
-
+
+
领料单
+
+
领料班组: {{ leaseApplyData.teamName }}
-
+
工程名称: {{ leaseApplyData.projectName }}
-
+ +
时间: - {{ leaseApplyData.createTime.split(" ")[0] }} + {{ leaseApplyData.createTime.split(' ')[0] }}
-
+
编号: {{ leaseApplyData.code }}
- - - - - - - - - - - + + + + + + + + + + + -
-
-
审核:
-
+
+
+
发料:
+
-
- 领料: -
-
+
+ +
+ 领料: + +
+
+
@@ -281,24 +286,22 @@
-
- 领料单编号明细 +
+ 领料单编号明细
- + - - - + + +
- -
@@ -314,21 +317,21 @@ import { applySend, applySendAll, getCheckInfo -} from "@/api/lease/apply"; +} from '@/api/lease/apply' -import vueEasyPrint from "vue-easy-print"; -import printJS from 'print-js'; +import vueEasyPrint from 'vue-easy-print' +import printJS from 'print-js' export default { - name: "Home", - dicts: ["lease_task_status", "ma_type_manage_type"], + name: 'Home', + dicts: ['lease_task_status', 'ma_type_manage_type'], components: { vueEasyPrint }, data() { return { // 遮罩层 loading: true, loadingTwo: true, - updateTime: "", + updateTime: '', // 选中数组 ids: [], // 非单个禁用 @@ -354,7 +357,7 @@ export default { chosenUserList: [], userList: [], // 弹出层标题 - title: "", + title: '', // 日期范围 dateRange: [], statusDataRange: [], @@ -362,18 +365,16 @@ export default { queryParams: { pageNum: 1, pageSize: 10, - time: null, //申请时间 - keyWord: "", - taskStatus: null, //申请时间 + time: null, //申请时间 + keyWord: '', + taskStatus: null //申请时间 }, form: { - remark: "", + remark: '' }, // 表单校验 rules: { - remark: [ - { required: true, message: "通知内容不能为空", trigger: "blur" }, - ], + remark: [{ required: true, message: '通知内容不能为空', trigger: 'blur' }] }, openPrint: false, open: false, @@ -381,7 +382,7 @@ export default { printTableData: [], checkDataInfo: {}, // 供应商 - supplierStr: "", + supplierStr: '', //领料单 leaseApplyDetails: [], @@ -390,15 +391,15 @@ export default { sendTemp: [], // 编码管理查看弹窗 showView: false, - titleView: "", - getListViewInfo: [], - }; + titleView: '', + getListViewInfo: [] + } }, created() { // this.getStatusList(); - this.getList(); + this.getList() // this.getTypeList() - }, + }, methods: { // getTypeList() { // getTypeList({ level: '3' }).then((response) => { @@ -411,131 +412,131 @@ export default { // 多选框选中数据 handleSelectionChange(selection) { - this.sendTemp = []; - this.ids = selection.map((item) => item.id); - selection.forEach((item) => { - this.sendTemp.push({ id: item.id, taskId: item.taskId }); - }); - this.single = selection.length != 1; - this.multiple = !selection.length; + this.sendTemp = [] + this.ids = selection.map(item => item.id) + selection.forEach(item => { + this.sendTemp.push({ id: item.id, taskId: item.taskId }) + }) + this.single = selection.length != 1 + this.multiple = !selection.length }, //是否可用勾选框 selectable(row) { if (row.taskStatus == 1) { - return true; + return true } else { - return false; + return false } }, getList() { - this.loading = true; + this.loading = true const params = { keyWord: this.queryParams.keyWord, taskStatus: this.queryParams.taskStatus, startTime: this.queryParams.time && this.queryParams.time[0], - endTime: this.queryParams.time && this.queryParams.time[1], + endTime: this.queryParams.time && this.queryParams.time[1], pageSize: this.queryParams.pageSize, - pageNum: this.queryParams.pageNum, + pageNum: this.queryParams.pageNum // statusList: this.queryParams.taskStatus ? [this.queryParams.taskStatus]:[1,2,3,4] - }; - getListLeaseApply(params).then((response) => { - this.typeList = response.data.rows; - this.total = response.data.total; - this.loading = false; - }); + } + getListLeaseApply(params).then(response => { + this.typeList = response.data.rows + this.total = response.data.total + this.loading = false + }) }, /** 搜索按钮操作 */ handleQuery() { - this.queryParams.pageNum = 1; - this.getList(); + this.queryParams.pageNum = 1 + this.getList() }, /** 重置按钮操作 */ resetQuery() { - this.queryParams.time = []; - this.resetForm("queryForm"); - this.queryParams.keyWord = ""; - this.handleQuery(); + this.queryParams.time = [] + this.resetForm('queryForm') + this.queryParams.keyWord = '' + this.handleQuery() }, /** 新增按钮操作 */ handleAdd() { - this.$emit("addTools"); + this.$emit('addTools') }, /** 查看按钮操作 */ handleView(row) { - this.$emit("queryTools", row.taskId, row.id); + this.$emit('queryTools', row.taskId, row.id) }, /** 修改按钮操作 */ handleUpdate(row) { - this.$emit("editTools", row.taskId, row.id); + this.$emit('editTools', row.taskId, row.id) }, //----消息通知 getNowTime() { - var today = new Date(); - var year = today.getFullYear(); //获取年份 - var month = today.getMonth() + 1; //获取月份 - var day = today.getDate(); //获取日期 - return year + "-" + month + "-" + day; + var today = new Date() + var year = today.getFullYear() //获取年份 + var month = today.getMonth() + 1 //获取月份 + var day = today.getDate() //获取日期 + return year + '-' + month + '-' + day }, // 表单重置 reset() { this.form = { - taskId: "", - remark: "", - }; - this.resetForm("form"); + taskId: '', + remark: '' + } + this.resetForm('form') }, //获取验收单数据 getPrintTable(taskId) { - getAcceptanceForm({ taskId: taskId }).then((response) => { - this.printData = response.data; - this.printTableData = response.data.checkDetailsList; + getAcceptanceForm({ taskId: taskId }).then(response => { + this.printData = response.data + this.printTableData = response.data.checkDetailsList - let supplierList = []; - this.printTableData.forEach((e) => { + let supplierList = [] + this.printTableData.forEach(e => { if (e.supplier) { - supplierList.push(e.supplier); + supplierList.push(e.supplier) } - }); - supplierList = [...new Set(supplierList)]; + }) + supplierList = [...new Set(supplierList)] - this.supplierStr = supplierList.join(","); - }); + this.supplierStr = supplierList.join(',') + }) }, //查看验收单 async handlePrint(row) { - const res = await getCheckInfo({id:row.id}); - this.idTemp = row.id; - this.checkDataInfo = res.data.leaseApplyInfo; + const res = await getCheckInfo({ id: row.id }) + this.idTemp = row.id + this.checkDataInfo = res.data.leaseApplyInfo - this.printTableData = res.data.leaseOutVoList; + this.printTableData = res.data.leaseOutVoList setTimeout(() => { this.chapter('机具检验专用章', '安徽送变电工程有限公司机具(物流)分公司') - }, 500); - this.openPrint = true; - this.title = "出库检验单"; + }, 500) + this.openPrint = true + this.title = '出库检验单' }, /** 导出按钮操作 */ - handleExportCheck() { + handleExportCheck() { this.download( - "/material/lease_apply_info/exportInfo", - { id:this.idTemp }, + '/material/lease_apply_info/exportInfo', + { id: this.idTemp }, `出库检验单_${new Date().getTime()}.xlsx` - ); + ) }, //打开领料单 async handleLld(row) { - this.title = "领料单"; - this.open = true; - var ids = row.id; - const res = await getApplyInfo(ids); - this.leaseApplyDetails = res.data.leaseApplyDetailsList; - this.leaseApplyData = res.data.leaseApplyInfo; + this.title = '领料单' + this.open = true + var ids = row.id + const res = await getApplyInfo(ids) + this.leaseApplyDetails = res.data.leaseOutDetailsList + this.leaseApplyData = res.data.leaseApplyInfo }, //出库检验单打印 @@ -544,25 +545,25 @@ export default { printable: 'checkId', type: 'html', targetStyles: ['*'], - maxWidth:'1400' + maxWidth: '1400' // 其他配置选项 - }); + }) }, // 关闭弹窗并刷新页面 closeDialogAndRefresh() { - this.openPrint = false; + this.openPrint = false }, codeInfo(row) { - this.showView = true; - this.titleView = "查看"; - this.getListViewInfo = row.maCodeVoList; + this.showView = true + this.titleView = '查看' + this.getListViewInfo = row.maCodeVoList }, //打印 printView() { - this.$refs.remarksPrintRefView.print(); + this.$refs.remarksPrintRefView.print() }, //打印 @@ -572,27 +573,27 @@ export default { printable: 'checkIdTwo', type: 'html', targetStyles: ['*'], - maxWidth:'1400' + maxWidth: '1400' // 其他配置选项 - }); + }) }, /** 删除按钮操作 */ handleDeletePurchase(row) { // console.log(row) - let ids = []; - ids.push(row.id); - console.log("ids", ids); + let ids = [] + ids.push(row.id) + console.log('ids', ids) this.$modal - .confirm("是否确认删除所选择的数据项?") + .confirm('是否确认删除所选择的数据项?') .then(function () { - return applyRemove(ids); + return applyRemove(ids) }) .then(() => { - this.getList(); - this.$modal.msgSuccess("删除成功"); + this.getList() + this.$modal.msgSuccess('删除成功') }) - .catch(() => {}); + .catch(() => {}) }, /** 导出按钮操作 */ @@ -601,124 +602,120 @@ export default { keyWord: this.queryParams.keyWord, taskStatus: this.queryParams.taskStatus, startTime: this.queryParams.time && this.queryParams.time[0], - endTime: this.queryParams.time && this.queryParams.time[1], + endTime: this.queryParams.time && this.queryParams.time[1], pageSize: this.queryParams.pageSize, pageNum: this.queryParams.pageNum, - statusList: this.queryParams.taskStatus ? [this.queryParams.taskStatus]:[1,2,3,4] - }; - this.download( - "/material/lease_apply_info/export", - { ...params }, - `领料申请_${new Date().getTime()}.xlsx` - ); + statusList: this.queryParams.taskStatus ? [this.queryParams.taskStatus] : [1, 2, 3, 4] + } + this.download('/material/lease_apply_info/export', { ...params }, `领料申请_${new Date().getTime()}.xlsx`) }, //发布按钮 handleSend(row) { - const param = { id: row.id, taskId: row.taskId }; + const param = { id: row.id, taskId: row.taskId } this.$modal - .confirm("是否确认发布所选择的数据项?") + .confirm('是否确认发布所选择的数据项?') .then(function () { - return applySend(param); + return applySend(param) }) .then(() => { - this.getList(); - this.$modal.msgSuccess("发布成功"); + this.getList() + this.$modal.msgSuccess('发布成功') }) - .catch(() => {}); + .catch(() => {}) }, handleSendAll() { if (this.ids.length == 0) { - this.$alert("请至少勾选一个领料申请", "提示", { - type: "warning", - confirmButtonText: "确定", - }); - return; + this.$alert('请至少勾选一个领料申请', '提示', { + type: 'warning', + confirmButtonText: '确定' + }) + return } else { - applySendAll(this.sendTemp).then((response) => { + applySendAll(this.sendTemp).then(response => { if (response.code == 200) { - this.$modal.msgSuccess("发布成功"); + this.$modal.msgSuccess('发布成功') } - this.getList(); - }); + this.getList() + }) } }, chapter(text, companyName) { - let canvas = document.getElementById("canvas"); - let context = canvas.getContext("2d"); - canvas.width = canvas.width; - context.height = canvas.height; - // // 清除画布内容 - // context.clearRect(0, 0, canvas.width, canvas.height); - //let text = "XXX专用章"; - //let companyName = "XXX科技股份有限公司"; - - // 绘制印章边框 - let width = canvas.width / 2; - let height = canvas.height / 2; - context.lineWidth = 3; - context.strokeStyle = "#f00"; - context.beginPath(); - context.arc(width, height, 80, 0, Math.PI * 2); //宽、高、半径 - context.stroke(); - - //画五角星 - this.create5star(context, width, height, 20, "#f00", 0); - - // 绘制印章名称 - context.font = "100 13px 宋体"; - context.textBaseline = "middle"; //设置文本的垂直对齐方式 - context.textAlign = "center"; //设置文本的水平对对齐方式 - context.lineWidth = 0.7; - context.strokeStyle = "#ff2323"; - context.strokeText(text, width, height + 50); - - // 绘制印章单位 - context.translate(width, height); // 平移到此位置, - context.font = "100 13px 宋体"; - let count = companyName.length; // 字数 - let angle = (4 * Math.PI) / (3 * (count - 1)); // 字间角度 - let chars = companyName.split(""); - let c; - for (let i = 0; i < count; i++) { - c = chars[i]; // 需要绘制的字符 - if (i == 0) { - context.rotate((5 * Math.PI) / 6); - } else { - context.rotate(angle); + let canvas = document.getElementById('canvas') + let context = canvas.getContext('2d') + canvas.width = canvas.width + context.height = canvas.height + // // 清除画布内容 + // context.clearRect(0, 0, canvas.width, canvas.height); + //let text = "XXX专用章"; + //let companyName = "XXX科技股份有限公司"; + + // 绘制印章边框 + let width = canvas.width / 2 + let height = canvas.height / 2 + context.lineWidth = 3 + context.strokeStyle = '#f00' + context.beginPath() + context.arc(width, height, 80, 0, Math.PI * 2) //宽、高、半径 + context.stroke() + + //画五角星 + this.create5star(context, width, height, 20, '#f00', 0) + + // 绘制印章名称 + context.font = '100 13px 宋体' + context.textBaseline = 'middle' //设置文本的垂直对齐方式 + context.textAlign = 'center' //设置文本的水平对对齐方式 + context.lineWidth = 0.7 + context.strokeStyle = '#ff2323' + context.strokeText(text, width, height + 50) + + // 绘制印章单位 + context.translate(width, height) // 平移到此位置, + context.font = '100 13px 宋体' + let count = companyName.length // 字数 + let angle = (4 * Math.PI) / (3 * (count - 1)) // 字间角度 + let chars = companyName.split('') + let c + for (let i = 0; i < count; i++) { + c = chars[i] // 需要绘制的字符 + if (i == 0) { + context.rotate((5 * Math.PI) / 6) + } else { + context.rotate(angle) + } + + context.save() + context.translate(65, 0) // 平移到此位置,此时字和x轴垂直,公司名称和最外圈的距离 + context.rotate(Math.PI / 2) // 旋转90度,让字平行于x轴 + context.strokeStyle = '#ff2323' // 设置印章单位字体颜色为较浅的红色 + context.strokeText(c, 0, 0) // 此点为字的中心点 + context.restore() } - - context.save(); - context.translate(65, 0); // 平移到此位置,此时字和x轴垂直,公司名称和最外圈的距离 - context.rotate(Math.PI / 2); // 旋转90度,让字平行于x轴 - context.strokeStyle = "#ff2323"; // 设置印章单位字体颜色为较浅的红色 - context.strokeText(c, 0, 0); // 此点为字的中心点 - context.restore(); - } }, - + //绘制五角星 create5star(context, sx, sy, radius, color, rotato) { - context.save(); - context.fillStyle = color; - context.translate(sx, sy); //移动坐标原点 - context.rotate(Math.PI + rotato); //旋转 - context.beginPath(); //创建路径 + context.save() + context.fillStyle = color + context.translate(sx, sy) //移动坐标原点 + context.rotate(Math.PI + rotato) //旋转 + context.beginPath() //创建路径 // let x = Math.sin(0); // let y = Math.cos(0); - let dig = (Math.PI / 5) * 4; + let dig = (Math.PI / 5) * 4 for (let i = 0; i < 5; i++) { //画五角星的五条边 - let x = Math.sin(i * dig); - let y = Math.cos(i * dig); - context.lineTo(x * radius, y * radius); + let x = Math.sin(i * dig) + let y = Math.cos(i * dig) + context.lineTo(x * radius, y * radius) } - context.closePath(); - context.stroke(); - context.fill(); - context.restore(); + context.closePath() + context.stroke() + context.fill() + context.restore() } }, @@ -726,14 +723,14 @@ export default { $route: { handler(to) { if (to.query.keyWord) { - this.queryParams.keyWord = to.query.keyWord; + this.queryParams.keyWord = to.query.keyWord } }, deep: true, - immediate: true, - }, - }, -}; + immediate: true + } + } +} diff --git a/src/views/material/lease/outBound/component/homeApply.vue b/src/views/material/lease/outBound/component/homeApply.vue index 3a84517a..2379d1af 100644 --- a/src/views/material/lease/outBound/component/homeApply.vue +++ b/src/views/material/lease/outBound/component/homeApply.vue @@ -10,8 +10,7 @@ start-placeholder="开始日期" end-placeholder="结束日期" style="width: 240px" - > - + > @@ -26,13 +25,7 @@ - + - 搜索 - - 重置 - + 搜索 + 重置 - 导出 - + 导出 - + - - + + - - - + + + - + - - + + - + @@ -130,119 +127,130 @@ -
- +
+
施工机具设备出库检验记录表
-
-
+
+
领用工程: {{ checkDataInfo.leaseProject }} -
-
+
+
使用单位: {{ checkDataInfo.leaseUnit }}
- - + + - - - - - - - - + + + + + + + + - + -
-
-
- 检验单位: +
+
+
+ 检验单位: +
+
+ +
-
- -
-
+
+
- -
- +
-
-
- 领料单 -
-
-
+
+
领料单
+
+
领料班组: {{ leaseApplyData.teamName }}
-
+
工程名称: {{ leaseApplyData.projectName }}
-
+ +
时间: - {{ leaseApplyData.createTime.split(" ")[0] }} + {{ leaseApplyData.createTime.split(' ')[0] }}
-
+
编号: {{ leaseApplyData.code }}
- - - - - - - - - - - + + + + + + + + + + + -
-
-
审核:
-
+
+
+
发料:
+
-
- 领料: -
-
+
+ +
+ 领料: + +
+
+
@@ -268,24 +276,22 @@
-
- 领料单编号明细 +
+ 领料单编号明细
- + - - - + + +
- -
@@ -300,22 +306,23 @@ import { applyRemove, applySend, applySendAll, - getCheckInfo -} from "@/api/lease/apply"; + getCheckInfo, + submitLeaseOutApi +} from '@/api/lease/apply' -import vueEasyPrint from "vue-easy-print"; -import printJS from 'print-js'; +import vueEasyPrint from 'vue-easy-print' +import printJS from 'print-js' export default { - name: "Home", - dicts: ["lease_task_status", "ma_type_manage_type"], + name: 'Home', + dicts: ['lease_task_status', 'ma_type_manage_type'], components: { vueEasyPrint }, data() { return { // 遮罩层 loading: true, loadingTwo: true, - updateTime: "", + updateTime: '', // 选中数组 ids: [], // 非单个禁用 @@ -341,7 +348,7 @@ export default { chosenUserList: [], userList: [], // 弹出层标题 - title: "", + title: '', // 日期范围 dateRange: [], statusDataRange: [], @@ -349,18 +356,16 @@ export default { queryParams: { pageNum: 1, pageSize: 10, - time: null, //申请时间 - keyWord: "", - taskStatus: null, //申请时间 + time: null, //申请时间 + keyWord: '', + taskStatus: null //申请时间 }, form: { - remark: "", + remark: '' }, // 表单校验 rules: { - remark: [ - { required: true, message: "通知内容不能为空", trigger: "blur" }, - ], + remark: [{ required: true, message: '通知内容不能为空', trigger: 'blur' }] }, openPrint: false, open: false, @@ -368,7 +373,7 @@ export default { printTableData: [], checkDataInfo: {}, // 供应商 - supplierStr: "", + supplierStr: '', //领料单 leaseApplyDetails: [], @@ -377,15 +382,15 @@ export default { sendTemp: [], // 编码管理查看弹窗 showView: false, - titleView: "", - getListViewInfo: [], - }; + titleView: '', + getListViewInfo: [] + } }, created() { // this.getStatusList(); - this.getList(); + this.getList() // this.getTypeList() - }, + }, methods: { // getTypeList() { // getTypeList({ level: '3' }).then((response) => { @@ -396,139 +401,161 @@ export default { // }) // }, + handleSubmit(row) { + console.log('🚀 ~ handleSubmit ~ row:', row) + const params = { + id: row.id, + isSubmit: 0 + } + // 弹框提示 + this.$modal.confirm('是否确定提交?').then(async () => { + try { + const res = await submitLeaseOutApi(params) + if (res.code == 200 && res.msg == '该领料单无未出库领料数据,请确认是否提交') { + await submitLeaseOutApi({ id: row.id }) + this.getList() + this.$message.success('操作成功!') + } else if (res.code == 200 && res.msg == '该领料单有未出库领料数据,请确认是否提交') { + this.$modal.confirm(res.msg).then(async () => { + await submitLeaseOutApi({ id: row.id }) + this.getList() + this.$message.success('操作成功!') + }) + } + } catch (error) { + console.log('🚀 ~ handleSubmit ~ error:', error) + } + }) + }, // 多选框选中数据 handleSelectionChange(selection) { - this.sendTemp = []; - this.ids = selection.map((item) => item.id); - selection.forEach((item) => { - this.sendTemp.push({ id: item.id, taskId: item.taskId }); - }); - this.single = selection.length != 1; - this.multiple = !selection.length; + this.sendTemp = [] + this.ids = selection.map(item => item.id) + selection.forEach(item => { + this.sendTemp.push({ id: item.id, taskId: item.taskId }) + }) + this.single = selection.length != 1 + this.multiple = !selection.length }, //是否可用勾选框 selectable(row) { if (row.taskStatus == 1) { - return true; + return true } else { - return false; + return false } }, getList() { - this.loading = true; + this.loading = true const params = { keyWord: this.queryParams.keyWord, taskStatus: this.queryParams.taskStatus, startTime: this.queryParams.time && this.queryParams.time[0], - endTime: this.queryParams.time && this.queryParams.time[1], + endTime: this.queryParams.time && this.queryParams.time[1], pageSize: this.queryParams.pageSize, - pageNum: this.queryParams.pageNum, + pageNum: this.queryParams.pageNum // statusList: this.queryParams.taskStatus ? [this.queryParams.taskStatus]:[1,2,3,4] - }; - getListLeaseApply(params).then((response) => { - this.typeList = response.data.rows; - this.total = response.data.total; - this.loading = false; - }); + } + getListLeaseApply(params).then(response => { + this.typeList = response.data.rows + this.total = response.data.total + this.loading = false + }) }, /** 搜索按钮操作 */ handleQuery() { - this.queryParams.pageNum = 1; - this.getList(); + this.queryParams.pageNum = 1 + this.getList() }, /** 重置按钮操作 */ resetQuery() { - this.queryParams.time = []; - this.resetForm("queryForm"); - this.queryParams.keyWord = ""; - this.handleQuery(); + this.queryParams.time = [] + this.resetForm('queryForm') + this.queryParams.keyWord = '' + this.handleQuery() }, /** 新增按钮操作 */ handleAdd() { - this.$emit("addTools"); + this.$emit('addTools') }, /** 查看按钮操作 */ handleView(row) { - this.$emit("queryTools", row.taskId, row.id); + this.$emit('queryTools', row.taskId, row.id) }, /** 修改按钮操作 */ handleUpdate(row) { - this.$emit("editTools", row.taskId, row.id); + this.$emit('editTools', row.taskId, row.id) }, //----消息通知 getNowTime() { - var today = new Date(); - var year = today.getFullYear(); //获取年份 - var month = today.getMonth() + 1; //获取月份 - var day = today.getDate(); //获取日期 - return year + "-" + month + "-" + day; + var today = new Date() + var year = today.getFullYear() //获取年份 + var month = today.getMonth() + 1 //获取月份 + var day = today.getDate() //获取日期 + return year + '-' + month + '-' + day }, // 表单重置 reset() { this.form = { - taskId: "", - remark: "", - }; - this.resetForm("form"); + taskId: '', + remark: '' + } + this.resetForm('form') }, //获取验收单数据 getPrintTable(taskId) { - getAcceptanceForm({ taskId: taskId }).then((response) => { - this.printData = response.data; - this.printTableData = response.data.checkDetailsList; + getAcceptanceForm({ taskId: taskId }).then(response => { + this.printData = response.data + this.printTableData = response.data.checkDetailsList - let supplierList = []; - this.printTableData.forEach((e) => { + let supplierList = [] + this.printTableData.forEach(e => { if (e.supplier) { - supplierList.push(e.supplier); + supplierList.push(e.supplier) } - }); - supplierList = [...new Set(supplierList)]; + }) + supplierList = [...new Set(supplierList)] - this.supplierStr = supplierList.join(","); - }); + this.supplierStr = supplierList.join(',') + }) }, //查看验收单 async handlePrint(row) { this.$message.warning('功能开发中...') return - const res = await getCheckInfo({id:row.id}); - this.idTemp = row.id; - this.checkDataInfo = res.data.leaseApplyInfo; + const res = await getCheckInfo({ id: row.id }) + this.idTemp = row.id + this.checkDataInfo = res.data.leaseApplyInfo - this.printTableData = res.data.leaseOutVoList; + this.printTableData = res.data.leaseOutVoList setTimeout(() => { this.chapter('机具检验专用章', '安徽送变电工程有限公司机具(物流)分公司') - }, 500); - this.openPrint = true; - this.title = "出库检验单"; + }, 500) + this.openPrint = true + this.title = '出库检验单' }, /** 导出按钮操作 */ - handleExportCheck() { + handleExportCheck() { this.download( - "/material/lease_apply_info/exportInfo", - { id:this.idTemp }, + '/material/lease_apply_info/exportInfo', + { id: this.idTemp }, `出库检验单_${new Date().getTime()}.xlsx` - ); + ) }, //打开领料单 async handleLld(row) { - // 提示开发中 - this.$message.warning('功能开发中...') - return - - this.title = "领料单"; - this.open = true; - var ids = row.id; - const res = await getApplyInfo(ids); - this.leaseApplyDetails = res.data.leaseApplyDetailsList; - this.leaseApplyData = res.data.leaseApplyInfo; + this.title = '领料单' + this.open = true + var ids = row.id + const res = await getApplyInfo(ids) + this.leaseApplyDetails = res.data.leaseOutDetailsList + this.leaseApplyData = res.data.leaseApplyInfo }, //出库检验单打印 @@ -537,25 +564,25 @@ export default { printable: 'checkId', type: 'html', targetStyles: ['*'], - maxWidth:'1400' + maxWidth: '1400' // 其他配置选项 - }); + }) }, // 关闭弹窗并刷新页面 closeDialogAndRefresh() { - this.openPrint = false; + this.openPrint = false }, codeInfo(row) { - this.showView = true; - this.titleView = "查看"; - this.getListViewInfo = row.maCodeVoList; + this.showView = true + this.titleView = '查看' + this.getListViewInfo = row.maCodeVoList }, //打印 printView() { - this.$refs.remarksPrintRefView.print(); + this.$refs.remarksPrintRefView.print() }, //打印 @@ -565,27 +592,27 @@ export default { printable: 'checkIdTwo', type: 'html', targetStyles: ['*'], - maxWidth:'1400' + maxWidth: '1400' // 其他配置选项 - }); + }) }, /** 删除按钮操作 */ handleDeletePurchase(row) { // console.log(row) - let ids = []; - ids.push(row.id); - console.log("ids", ids); + let ids = [] + ids.push(row.id) + console.log('ids', ids) this.$modal - .confirm("是否确认删除所选择的数据项?") + .confirm('是否确认删除所选择的数据项?') .then(function () { - return applyRemove(ids); + return applyRemove(ids) }) .then(() => { - this.getList(); - this.$modal.msgSuccess("删除成功"); + this.getList() + this.$modal.msgSuccess('删除成功') }) - .catch(() => {}); + .catch(() => {}) }, /** 导出按钮操作 */ @@ -594,124 +621,120 @@ export default { keyWord: this.queryParams.keyWord, taskStatus: this.queryParams.taskStatus, startTime: this.queryParams.time && this.queryParams.time[0], - endTime: this.queryParams.time && this.queryParams.time[1], + endTime: this.queryParams.time && this.queryParams.time[1], pageSize: this.queryParams.pageSize, pageNum: this.queryParams.pageNum, - statusList: this.queryParams.taskStatus ? [this.queryParams.taskStatus]:[1,2,3,4] - }; - this.download( - "/material/lease_apply_info/export", - { ...params }, - `领料申请_${new Date().getTime()}.xlsx` - ); + statusList: this.queryParams.taskStatus ? [this.queryParams.taskStatus] : [1, 2, 3, 4] + } + this.download('/material/lease_apply_info/export', { ...params }, `领料申请_${new Date().getTime()}.xlsx`) }, //发布按钮 handleSend(row) { - const param = { id: row.id, taskId: row.taskId }; + const param = { id: row.id, taskId: row.taskId } this.$modal - .confirm("是否确认发布所选择的数据项?") + .confirm('是否确认发布所选择的数据项?') .then(function () { - return applySend(param); + return applySend(param) }) .then(() => { - this.getList(); - this.$modal.msgSuccess("发布成功"); + this.getList() + this.$modal.msgSuccess('发布成功') }) - .catch(() => {}); + .catch(() => {}) }, handleSendAll() { if (this.ids.length == 0) { - this.$alert("请至少勾选一个领料申请", "提示", { - type: "warning", - confirmButtonText: "确定", - }); - return; + this.$alert('请至少勾选一个领料申请', '提示', { + type: 'warning', + confirmButtonText: '确定' + }) + return } else { - applySendAll(this.sendTemp).then((response) => { + applySendAll(this.sendTemp).then(response => { if (response.code == 200) { - this.$modal.msgSuccess("发布成功"); + this.$modal.msgSuccess('发布成功') } - this.getList(); - }); + this.getList() + }) } }, chapter(text, companyName) { - let canvas = document.getElementById("canvas"); - let context = canvas.getContext("2d"); - canvas.width = canvas.width; - context.height = canvas.height; - // // 清除画布内容 - // context.clearRect(0, 0, canvas.width, canvas.height); - //let text = "XXX专用章"; - //let companyName = "XXX科技股份有限公司"; - - // 绘制印章边框 - let width = canvas.width / 2; - let height = canvas.height / 2; - context.lineWidth = 3; - context.strokeStyle = "#f00"; - context.beginPath(); - context.arc(width, height, 80, 0, Math.PI * 2); //宽、高、半径 - context.stroke(); - - //画五角星 - this.create5star(context, width, height, 20, "#f00", 0); - - // 绘制印章名称 - context.font = "100 13px 宋体"; - context.textBaseline = "middle"; //设置文本的垂直对齐方式 - context.textAlign = "center"; //设置文本的水平对对齐方式 - context.lineWidth = 0.7; - context.strokeStyle = "#ff2323"; - context.strokeText(text, width, height + 50); - - // 绘制印章单位 - context.translate(width, height); // 平移到此位置, - context.font = "100 13px 宋体"; - let count = companyName.length; // 字数 - let angle = (4 * Math.PI) / (3 * (count - 1)); // 字间角度 - let chars = companyName.split(""); - let c; - for (let i = 0; i < count; i++) { - c = chars[i]; // 需要绘制的字符 - if (i == 0) { - context.rotate((5 * Math.PI) / 6); - } else { - context.rotate(angle); + let canvas = document.getElementById('canvas') + let context = canvas.getContext('2d') + canvas.width = canvas.width + context.height = canvas.height + // // 清除画布内容 + // context.clearRect(0, 0, canvas.width, canvas.height); + //let text = "XXX专用章"; + //let companyName = "XXX科技股份有限公司"; + + // 绘制印章边框 + let width = canvas.width / 2 + let height = canvas.height / 2 + context.lineWidth = 3 + context.strokeStyle = '#f00' + context.beginPath() + context.arc(width, height, 80, 0, Math.PI * 2) //宽、高、半径 + context.stroke() + + //画五角星 + this.create5star(context, width, height, 20, '#f00', 0) + + // 绘制印章名称 + context.font = '100 13px 宋体' + context.textBaseline = 'middle' //设置文本的垂直对齐方式 + context.textAlign = 'center' //设置文本的水平对对齐方式 + context.lineWidth = 0.7 + context.strokeStyle = '#ff2323' + context.strokeText(text, width, height + 50) + + // 绘制印章单位 + context.translate(width, height) // 平移到此位置, + context.font = '100 13px 宋体' + let count = companyName.length // 字数 + let angle = (4 * Math.PI) / (3 * (count - 1)) // 字间角度 + let chars = companyName.split('') + let c + for (let i = 0; i < count; i++) { + c = chars[i] // 需要绘制的字符 + if (i == 0) { + context.rotate((5 * Math.PI) / 6) + } else { + context.rotate(angle) + } + + context.save() + context.translate(65, 0) // 平移到此位置,此时字和x轴垂直,公司名称和最外圈的距离 + context.rotate(Math.PI / 2) // 旋转90度,让字平行于x轴 + context.strokeStyle = '#ff2323' // 设置印章单位字体颜色为较浅的红色 + context.strokeText(c, 0, 0) // 此点为字的中心点 + context.restore() } - - context.save(); - context.translate(65, 0); // 平移到此位置,此时字和x轴垂直,公司名称和最外圈的距离 - context.rotate(Math.PI / 2); // 旋转90度,让字平行于x轴 - context.strokeStyle = "#ff2323"; // 设置印章单位字体颜色为较浅的红色 - context.strokeText(c, 0, 0); // 此点为字的中心点 - context.restore(); - } }, - + //绘制五角星 create5star(context, sx, sy, radius, color, rotato) { - context.save(); - context.fillStyle = color; - context.translate(sx, sy); //移动坐标原点 - context.rotate(Math.PI + rotato); //旋转 - context.beginPath(); //创建路径 + context.save() + context.fillStyle = color + context.translate(sx, sy) //移动坐标原点 + context.rotate(Math.PI + rotato) //旋转 + context.beginPath() //创建路径 // let x = Math.sin(0); // let y = Math.cos(0); - let dig = (Math.PI / 5) * 4; + let dig = (Math.PI / 5) * 4 for (let i = 0; i < 5; i++) { //画五角星的五条边 - let x = Math.sin(i * dig); - let y = Math.cos(i * dig); - context.lineTo(x * radius, y * radius); + let x = Math.sin(i * dig) + let y = Math.cos(i * dig) + context.lineTo(x * radius, y * radius) } - context.closePath(); - context.stroke(); - context.fill(); - context.restore(); + context.closePath() + context.stroke() + context.fill() + context.restore() } }, @@ -719,14 +742,14 @@ export default { $route: { handler(to) { if (to.query.keyWord) { - this.queryParams.keyWord = to.query.keyWord; + this.queryParams.keyWord = to.query.keyWord } }, deep: true, - immediate: true, - }, - }, -}; + immediate: true + } + } +} diff --git a/vue.config.js b/vue.config.js index c91ddfd5..e64a1371 100644 --- a/vue.config.js +++ b/vue.config.js @@ -36,7 +36,7 @@ module.exports = { // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { // target: `http://36.33.26.201:19988/prod-api`, - target: `http://192.168.1.117:18080`,//马 + target: `http://192.168.0.96:18080`,//马 // target: `http://192.168.0.244:18580`,//测试 // target: `http://192.168.2.223:18080`,//山 // target: `http://192.168.2.23:18080`,//洪