diff --git a/package.json b/package.json index b49a869..9447e43 100644 --- a/package.json +++ b/package.json @@ -43,13 +43,16 @@ "crypto-js": "^4.2.0", "echarts": "5.4.0", "element-ui": "2.15.14", - "file-saver": "2.0.5", + "file-saver": "^2.0.5", "fuse.js": "6.4.3", "highlight.js": "9.18.5", + "html2canvas": "^1.4.1", "js-beautify": "1.13.0", "js-cookie": "3.0.1", "jsencrypt": "3.0.0-rc.1", + "jszip": "^3.10.1", "nprogress": "0.2.0", + "qrcodejs2": "^0.0.2", "quill": "1.3.7", "screenfull": "5.0.2", "sm-crypto": "^0.3.13", diff --git a/src/api/baseGround/newBuy.js b/src/api/baseGround/newBuy.js index be77ba0..3b68370 100644 --- a/src/api/baseGround/newBuy.js +++ b/src/api/baseGround/newBuy.js @@ -17,6 +17,15 @@ export function getPurchaseCheckInfo(id) { }) } +// 保存--新增 +export function addPurchaseCheckInfo(data) { + return request({ + url: '/material/purchase_check_info', + method: 'post', + data: data, + }) +} + //人员 详情 export function getNoticePeople(query) { return request({ @@ -34,6 +43,8 @@ export function delPeople(ids) { }) } + + // 人员管理--新增 export function addNoticeUser(data) { return request({ @@ -88,6 +99,8 @@ export function queryKeeperNameApi(query) { }) } + + // 仓库管理--删除 export function delHouse(id) { return request({ diff --git a/src/api/baseGround/newBuyBind.js b/src/api/baseGround/newBuyBind.js index 3b634b6..b6fbb8a 100644 --- a/src/api/baseGround/newBuyBind.js +++ b/src/api/baseGround/newBuyBind.js @@ -18,6 +18,15 @@ export function getListDetail(query) { }) } +//任务 详情 +export function bindAllData(data) { + return request({ + url: '/material/purchase/bind/bind', + method: 'post', + data: data, + }) +} + //二级页面 详情 export function getListDetailById(query) { return request({ @@ -27,6 +36,18 @@ export function getListDetailById(query) { }) } +// 导出 +export function exportNewBuy(data) { + return request({ + url: '/material/purchase/bind/downloadQrCode', + method: 'post', + responseType: 'blob', + data: data + }) +} + + + //人员 详情 export function getNoticePeople(query) { return request({ diff --git a/src/main.js b/src/main.js index ae36024..2982591 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,7 @@ import VueMeta from 'vue-meta' // 字典数据组件 import DictData from '@/components/DictData' +import global_ from '@/utils/globalUrl' // 全局方法挂载 Vue.prototype.getDicts = getDicts Vue.prototype.getConfigKey = getConfigKey @@ -48,7 +49,7 @@ Vue.prototype.selectDictLabel = selectDictLabel Vue.prototype.selectDictLabels = selectDictLabels Vue.prototype.download = download Vue.prototype.handleTree = handleTree - +Vue.prototype.globalUrl = global_ // 全局组件挂载 Vue.component('DictTag', DictTag) Vue.component('Pagination', Pagination) diff --git a/src/permission.js b/src/permission.js index 5297df9..db6baf7 100644 --- a/src/permission.js +++ b/src/permission.js @@ -8,7 +8,10 @@ import { isRelogin } from '@/utils/request' NProgress.configure({ showSpinner: false }) -const whiteList = ['/login', '/register'] +const whiteList = [ + '/login', '/register', + '/qrCode/qrCodePage', +] router.beforeEach((to, from, next) => { NProgress.start() diff --git a/src/router/index.js b/src/router/index.js index 493b19f..7c7c95c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -74,6 +74,11 @@ export const constantRoutes = [ } ] }, + { + path: '/qrCode/qrCodePage', + component: () => import('@/views/qrCode/qrCode'), + hidden: true + }, { path: '/user', component: Layout, diff --git a/src/utils/chapter.js b/src/utils/chapter.js new file mode 100644 index 0000000..69871a3 --- /dev/null +++ b/src/utils/chapter.js @@ -0,0 +1,76 @@ +let chapter = (text, companyName) => { + let canvas = document.getElementById("canvas"); + let context = canvas.getContext("2d"); + + //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(); + + //画五角星 + create5star(context, width, height, 20, "#f00", 0); + + // 绘制印章名称 + context.font = "14px 宋体"; + context.textBaseline = "middle"; //设置文本的垂直对齐方式 + context.textAlign = "center"; //设置文本的水平对对齐方式 + context.lineWidth = 1; + context.strokeStyle = "#f00"; + context.strokeText(text, width, height + 50); + + // 绘制印章单位 + context.translate(width, height); // 平移到此位置, + context.font = "14px 宋体"; + 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.strokeText(c, 0, 0); // 此点为字的中心点 + context.restore(); + } + + //绘制五角星 + function create5star(context, sx, sy, radius, color, rotato) { + 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; + 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); + } + context.closePath(); + context.stroke(); + context.fill(); + context.restore(); + } + }; + + export default chapter; + + + \ No newline at end of file diff --git a/src/utils/globalUrl.js b/src/utils/globalUrl.js new file mode 100644 index 0000000..c4872da --- /dev/null +++ b/src/utils/globalUrl.js @@ -0,0 +1,19 @@ +// const qrUrl = 'http://192.168.0.14:21624/qrCode/qrCodePage?qrCode='; //测试 +// const qrUrl = 'http://112.29.103.165:21626/qrCode/qrCodePage?qrCode='; //重庆 +// const qrUrl = 'http://112.29.103.165:21624/qrCode/qrCodePage?qrCode='; //宁夏 +// const qrUrl = 'https://z.csgmall.com.cn/gl/qrCode/qrCodePage?qrCode='; //南网 +const qrUrl = 'http://192.168.0.110:80/qrCode/qrCodePage?qrCode='; //本地 +// const qrUrl = process.env.NODE_ENV === 'production' ? 'http://192.168.0.14:18866/qrCode/qrCodePage?qrCode=' : 'http://192.168.0.14:21624/qrCode/qrCodePage?qrCode=' +// let qrUrl = '' +const origin = window.location.origin + +// qrUrl = origin + '/qrCode/qrCodePage?qrCode=' +// if (origin == 'http://112.29.103.165:21626') { +// qrUrl = 'http://112.29.103.165:21626/qrCode/qrCodePage?qrCode=' +// } else { +// qrUrl = 'http://192.168.0.14:18866/qrCode/qrCodePage?qrCode=' +// } + +export default { + qrUrl, +} diff --git a/src/views/material/newBuy/goodsArrived/component/addTools.vue b/src/views/material/newBuy/goodsArrived/component/addTools.vue index d827ae3..f4eaaa4 100644 --- a/src/views/material/newBuy/goodsArrived/component/addTools.vue +++ b/src/views/material/newBuy/goodsArrived/component/addTools.vue @@ -5,6 +5,7 @@ :model="maForm" ref="maForm" size="small" + :rules="rules" :inline="true" label-width="120px" > @@ -18,35 +19,21 @@ placeholder="请选择到货日期" > - - - - - - + + - + - + - + + @@ -354,6 +337,7 @@ export default { pageNum: 1, pageSize: 10, id:undefined, + typesList:[], }, // 数据范围选项 dataScopeOptions: [ @@ -403,24 +387,17 @@ export default { }, // 表单校验 rules: { - purchaseNumber: [ - { - required: true, - message: '请输入线下采购单编号', - trigger: 'blur', - }, - ], - purchaseTime: [ - { - required: true, - message: '采购日期不能为空', - trigger: 'blur', - }, - ], + // deviceType: [ + // { + // required: true, + // message: '请选择类型规格', + // trigger: 'blur', + // }, + // ], arrivalTime: [ { required: true, - message: '到货日期不能为空', + message: '请选择到货日期', trigger: 'blur', }, ], @@ -480,45 +457,6 @@ export default { }, methods: { - /** 机具类型 */ - equipmentType() { - console.log('11111111') - equipmentTypeTree().then((response) => { - this.equipmentTypeList = response.data - console.log('22221111',this.equipmentTypeList) - this.equipmentTypeList.forEach((item, index) => { - if (item.children && item.children.length > 0) { - item.children.forEach((item2, index2) => { - if (item2.children && item2.children.length > 0) { - item2.children.forEach((item3) => { - if ( - item3.children && - item3.children.length > 0 - ) { - item3.children.forEach((item4) => { - item4.machineTypeName = - item3.typeName - item4.specificationType = - item4.typeName - this.$set(item4, 'purchasePrice', 0) - this.$set(item4, 'purchaseNum', 1) - }) - } - }) - } - }) - } - }) - - let selectList = [] - this.equipmentList.forEach((e) => { - selectList.push( - this.getParentsById(this.equipmentTypeList, e.typeId), - ) - }) - this.deviceType = selectList - }) - }, getParentsById(list, id) { for (let i in list) { @@ -537,82 +475,6 @@ export default { } }, - /** 新增按钮操作 */ - handleSave() { - if (this.equipmentList.length > 0) { - this.$refs['maForm'].validate((valid) => { - if (valid) { - // console.log(this.maForm,'maForm') - // console.log(this.equipmentList,'equipmentList') - this.equipmentList.forEach((item) => { - if (item.purchaseNum == '' || !item.purchaseNum) { - isEmpty = false - } - }) - - this.maForm.taskId = this.taskId - this.maForm.checkDetailsList = this.equipmentList - // console.log(this.maForm) - if (this.equipmentList.length > 0) { - this.$modal - .confirm('是否确认保存当前页面') - .then(function () {}) - .then(() => { - if (this.isEdit) { - console.log('编辑') - this.loading = true - updatePurchaseCheckInfo( - this.maForm, - ).then((response) => { - if (response.code == 200) { - this.$modal.msgSuccess( - '编辑成功', - ) - // this.$tab.closeOpenPage({ - // path: '/store/newBuy/newDevicesList', - // }) - - this.$emit( - 'addToolsSuccess', - ) - } - this.loading = false - }) - } else if (!this.isEdit) { - console.log('新增') - this.loading = true - addPurchaseCheckInfo( - this.maForm, - ).then((response) => { - if (response.code == 200) { - this.$modal.msgSuccess( - '新增成功', - ) - // this.$tab.closeOpenPage({ - // path: '/store/newBuy/newDevicesList', - // }) - - this.$emit( - 'addToolsSuccess', - ) - } - this.loading = false - }) - } - }) - .catch(() => {}) - } else { - this.$modal.msgError( - '请先选择并添加机具类型!!!', - ) - } - - } - }) - } else { - this.$modal.msgError('请先添加机具类型') - } - }, /** 查询用户列表--采购员 */ getUserList() { getUserByRoleList({ roleIds: [152] }).then((response) => { @@ -639,7 +501,7 @@ export default { item3.children.length > 0 ) { item3.children.forEach((item4) => { - item4.machineTypeName = + item4.maTypeName = item3.typeName item4.specificationType = item4.typeName @@ -807,23 +669,14 @@ export default { /** 新增按钮操作 */ handleSave() { + console.log(this.equipmentList) if (this.equipmentList.length > 0) { this.$refs['maForm'].validate((valid) => { if (valid) { - // console.log(this.maForm,'maForm') - // console.log(this.equipmentList,'equipmentList') - let isEmpty = true - this.equipmentList.forEach((item) => { - if (item.purchaseNum == '' || !item.purchaseNum) { - isEmpty = false - } - }) - // console.log(this.taskId) this.maForm.taskId = this.taskId this.maForm.checkDetailsList = this.equipmentList // console.log(this.maForm) - if (isEmpty) { if (this.equipmentList.length > 0) { this.$modal .confirm('是否确认保存当前页面') @@ -853,7 +706,7 @@ export default { console.log('新增') this.loading = true addPurchaseCheckInfo( - this.maForm, + // {purchaseCheckDetailsList: this.maForm.checkDetailsList,purchaseCheckInfo:} ).then((response) => { if (response.code == 200) { this.$modal.msgSuccess( @@ -877,19 +730,12 @@ export default { '请先选择并添加机具类型!!!', ) } - } else { - this.$modal.msgError('请填写采购数量!!!') - } + } }) - } else { - this.$modal.msgError('请先添加机具类型') } }, - jumpList() { - const obj = { path: '/store/newBuy/newDevicesList' } - this.$tab.closeOpenPage(obj) - }, + /** 修改按钮操作 */ handleUpdate(row) { // this.reset(); @@ -940,6 +786,11 @@ export default { // ...this.queryParams // }, `role_${new Date().getTime()}.xlsx`) }, + productionTimeChange(val){ + this.equipmentList.forEach(item=>{ + item.productionTime=val + }) + }, deviceTypeChange(val) { const deviceTypeList = this.$refs.deviceTypeCascader.getCheckedNodes() diff --git a/src/views/material/newBuy/goodsArrived/component/home.vue b/src/views/material/newBuy/goodsArrived/component/home.vue index 7c1d484..c6dd2d4 100644 --- a/src/views/material/newBuy/goodsArrived/component/home.vue +++ b/src/views/material/newBuy/goodsArrived/component/home.vue @@ -395,8 +395,8 @@ - - + + diff --git a/src/views/material/newBuy/goodsBind/component/bindQrTools.vue b/src/views/material/newBuy/goodsBind/component/bindQrTools.vue index d7b3c90..dfbad01 100644 --- a/src/views/material/newBuy/goodsBind/component/bindQrTools.vue +++ b/src/views/material/newBuy/goodsBind/component/bindQrTools.vue @@ -1,256 +1,393 @@