1 line
23 KiB
JSON
1 line
23 KiB
JSON
{"remainingRequest":"E:\\hz-zhhq-web\\node_modules\\babel-loader\\lib\\index.js!E:\\hz-zhhq-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!E:\\hz-zhhq-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!E:\\hz-zhhq-web\\src\\views\\catering\\purchase\\index.vue?vue&type=script&lang=js","dependencies":[{"path":"E:\\hz-zhhq-web\\src\\views\\catering\\purchase\\index.vue","mtime":1737610069411},{"path":"E:\\hz-zhhq-web\\babel.config.js","mtime":1737610069371},{"path":"E:\\hz-zhhq-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1740463332762},{"path":"E:\\hz-zhhq-web\\node_modules\\babel-loader\\lib\\index.js","mtime":1740463332584},{"path":"E:\\hz-zhhq-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1740463332762},{"path":"E:\\hz-zhhq-web\\node_modules\\vue-loader\\lib\\index.js","mtime":1740463340941}],"contextDependencies":[],"result":["\"use strict\";\n\nvar _interopRequireDefault = require(\"E:/hz-zhhq-web/node_modules/@babel/runtime/helpers/interopRequireDefault.js\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nrequire(\"core-js/modules/es6.function.name\");\nrequire(\"core-js/modules/es6.regexp.constructor\");\nvar _popup = _interopRequireDefault(require(\"@/views/estate/examine/dialog/popup.vue\"));\nvar _paging = _interopRequireDefault(require(\"@/views/Public/paging.vue\"));\nvar _getdata = require(\"@/api/getdata\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nvar _default = exports.default = {\n components: {\n Paging: _paging.default,\n Popup: _popup.default\n },\n data: function data() {\n var _this2 = this;\n var priceVa = function priceVa(rule, value, callback) {\n // var reg =/^[0-9\\\\.]*$/\n var reg = /^\\d{1,}(\\.\\d{1,2})?$/;\n var reg2 = /[`~!@#$%^&*()_\\-+=<>?:\"{}|,;'\\\\[\\]·~!@#¥%……&*()——\\-+={}|《》?:“”【】、;‘’,。、]/g;\n if (reg.test(value) && !reg2.test(value)) {\n callback();\n } else {\n callback(new Error(\"请输入数字、且小数点后最多两位!\"));\n }\n };\n var purchaseAll = function purchaseAll(rule, value, callback) {\n // console.log(\n // this.ruleForm.purchaseStartDate,\n // this.ruleForm.purchaseEndDate\n // );\n if (_this2.ruleForm.purchaseStartDate && _this2.ruleForm.purchaseEndDate) {\n callback();\n } else {\n callback(new Error(\"请填写采购周期\"));\n }\n };\n //采购中心\n var valName = function valName(rule, value, callback) {\n // var reg = /^[0-9a-zA-Z_\\u4e00-\\u9fa5]+$/;\n var reg = /^\\S.*$/;\n var reg2 = /[`~!@#$%^&*()_\\-+=<>?:\"{}|,./;'\\\\[\\]·~!@#¥%……&*()——\\-+={}|《》?:“”【】、;‘’,。、]/g;\n if (reg.test(value) && !reg2.test(value)) {\n callback();\n } else {\n callback(new Error(\"请输入正确的格式 !\"));\n }\n };\n // let listerVa = (rule, value, callback) => {\n // // var reg = /^[0-9a-zA-Z_\\u4e00-\\u9fa5]+$/;\n // var reg = /^\\S.*$/;\n // var reg2 = /[`~!@#$%^&*()_\\-+=<>?:\"{}|,./;'\\\\[\\]·~!@#¥%……&*()——\\-+={}|《》?:“”【】、;‘’,。、]/g;\n // if (reg.test(value) && !reg2.test(value)) {\n // callback();\n // } else {\n // callback(new Error(\"请输入正确的格式 !\"));\n // }\n // };\n var priceVas = function priceVas(rule, value, callback) {\n var reg1 = new RegExp(/^[a-zA-Z]+$/);\n var reg2 = new RegExp(/^[\\u4e00-\\u9fa5]+$/);\n if (reg1.test(value) == false && reg2.test(value) == false && value != \"\") {\n callback(new Error(\"姓名格式只支持全中或全英文!\"));\n } else {\n callback();\n }\n };\n // let requisitionerVa = (rule, value, callback) => {\n // // var reg = /^[0-9a-zA-Z_\\u4e00-\\u9fa5]+$/;\n // var reg = /^\\S.*$/;\n // var reg2 = /[`~!@#$%^&*()_\\-+=<>?:\"{}|,./;'\\\\[\\]·~!@#¥%……&*()——\\-+={}|《》?:“”【】、;‘’,。、]/g;\n // if (reg.test(value) && !reg2.test(value)) {\n // callback();\n // } else {\n // callback(new Error(\"请输入正确的格式 !\"));\n // }\n // };\n // let approverVa = (rule, value, callback) => {\n // // var reg = /^[0-9a-zA-Z_\\u4e00-\\u9fa5]+$/;\n // var reg = /^\\S.*$/;\n // var reg2 = /[`~!@#$%^&*()_\\-+=<>?:\"{}|,./;'\\\\[\\]·~!@#¥%……&*()——\\-+={}|《》?:“”【】、;‘’,。、]/g;\n // if (reg.test(value) && !reg2.test(value)) {\n // callback();\n // } else {\n // callback(new Error(\"请输入正确的格式 !\"));\n // }\n // };\n var userPositionAll = function userPositionAll(rule, value, callback) {\n if (value) {\n callback();\n } else {\n callback(new Error(\"请选择上传附件\"));\n }\n };\n return {\n loading: false,\n //初始化loading\n loadingMsg: \"\",\n nav: \"\",\n btn: 3,\n row: {},\n iscontinue: false,\n iscontinue2: false,\n validation: false,\n completeTitle: \"\",\n office: \"添加\",\n centerDialogVisible: false,\n dis: false,\n formInline: {\n purchaseCentre: \"\",\n purchaseApplyDate: \"\",\n purchaseSpend: \"\",\n requisitioner: \"\",\n approver: \"\"\n },\n ruleForm: {\n purchaseCentre: \"\",\n purchaseApplyDate: \"\",\n purchaseStartDate: \"\",\n purchaseEndDate: [],\n purchaseSpend: \"\",\n requisitioner: \"\",\n approver: \"\",\n lister: \"\",\n remark: \"\",\n userPosition: \"\",\n file: this.file\n },\n file: \"\",\n fileList: [],\n form: {},\n files: {},\n flag: false,\n rules: {\n purchaseCentre: [{\n required: true,\n message: \"请填写采购中心\",\n trigger: \"blur\"\n }, {\n validator: valName,\n trigger: \"blur\"\n }],\n // required: true\n // house_type: [\n // { required: true, message: \"请填写采购申请日期\", trigger: \"change\" }\n // ],\n purchaseApplyDate: [{\n required: true,\n message: \"请输入采购申请日期\",\n trigger: \"blur\"\n }],\n purchaseEndDate: [{\n required: true,\n message: \"请选择采购周期\",\n trigger: \"blur\"\n }\n // { validator: purchaseAll, trigger: \"blur\" }\n ],\n purchaseSpend: [{\n required: true,\n message: \"请填写本次采购的实际消费\",\n trigger: \"blur\"\n }, {\n validator: priceVa,\n trigger: \"blur\"\n }],\n requisitioner: [{\n required: true,\n message: \"请填写申购人姓名\",\n trigger: \"blur\"\n }, {\n validator: priceVas,\n trigger: \"blur\"\n }],\n approver: [{\n required: true,\n message: \"请填写审批人姓名\",\n trigger: \"blur\"\n }, {\n validator: priceVas,\n trigger: \"blur\"\n }],\n lister: [{\n required: true,\n message: \"请填写制表人姓名\",\n trigger: \"blur\"\n }, {\n validator: priceVas,\n trigger: \"blur\"\n }],\n userPosition: [{\n required: true,\n message: \"请上传采购清单附件\",\n trigger: \"blur\"\n }, {\n validator: userPositionAll,\n trigger: \"blur\"\n }]\n },\n tableData: [],\n page: {\n limit: 0 /** 当前点击*/,\n sizePage: 10 /** 当前多少页*/,\n total: 0 /**总数 */\n }\n };\n },\n mounted: function mounted() {\n this.createLoad();\n this.getlist();\n },\n watch: {},\n methods: {\n createLoad: function createLoad() {\n this.loading = true;\n this.loadingMsg = \"加载中...\";\n },\n clearLoad: function clearLoad() {\n this.loading = false;\n this.loadingMsg = \"\";\n },\n getlist: function getlist() {\n var _this3 = this;\n var Content = {\n currentPage: this.page.limit,\n queryObj: {\n purchaseCentre: this.formInline.purchaseCentre,\n purchaseApplyDate: this.formInline.purchaseApplyDate,\n purchaseSpend: this.formInline.purchaseSpend,\n requisitioner: this.formInline.requisitioner,\n approver: this.formInline.approver\n }\n };\n (0, _getdata.Purchaselist)(Content).then(function (res) {\n if (res.returnCode == \"1\") {\n _this3.clearLoad();\n _this3.tableData = res.returnData.data;\n _this3.page.total = res.returnData.total;\n _this3.page.limit = res.returnData.currentPage;\n if (_this3.page.total == 0) {\n _this3.$message({\n message: \"当前无数据\",\n type: \"success\"\n });\n } else {\n _this3.$message({\n message: res.returnMsg,\n type: \"success\"\n });\n }\n } else {\n _this3.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n setTimeout(function () {\n _this3.clearLoad();\n }, 300);\n }\n }).catch(function (err) {\n console.log(err);\n setTimeout(function () {\n _this3.clearLoad();\n }, 300);\n });\n },\n changeUser: function changeUser(val) {\n if (!val || val != this.file) {\n this.form = {};\n }\n },\n bs64: function bs64(_bs) {\n var reader = new FileReader();\n reader.readAsDataURL(_bs);\n return new Promise(function (resolve) {\n reader.onload = function (e) {\n resolve(e.target.result);\n };\n });\n },\n closeDialogDel: function closeDialogDel(val) {\n var _this4 = this;\n var Content;\n var Contents = {\n id: this.row.id,\n fileId: this.row.file_id\n };\n if (val == \"1\") {\n this.createLoad();\n // console.log(1111111111)\n (0, _getdata.PurchaseDelete)(Contents).then(function (res) {\n if (res.returnCode == \"1\") {\n _this4.$message({\n message: res.returnMsg,\n type: \"success\"\n });\n _this4.page.limit = 1;\n _this4.getlist();\n } else {\n _this4.clearLoad();\n _this4.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n }\n }).catch(function (err) {\n _this4.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n });\n } else if (val == \"2\") {\n this.createLoad();\n // Content = {};\n // console.log(this.row)\n // this.form = new FormData();\n this.form = {\n id: this.row.id,\n fileId: this.row.file_id,\n fileName: this.row.file_name,\n purchaseCentre: this.ruleForm.purchaseCentre,\n purchaseApplyDate: this.ruleForm.purchaseApplyDate,\n purchaseStartDate: this.ruleForm.purchaseEndDate ? this.ruleForm.purchaseEndDate[0] : \"\",\n purchaseEndDate: this.ruleForm.purchaseEndDate ? this.ruleForm.purchaseEndDate[1] : \"\",\n purchaseSpend: this.ruleForm.purchaseSpend,\n requisitioner: this.ruleForm.requisitioner,\n approver: this.ruleForm.approver,\n lister: this.ruleForm.lister,\n remark: this.ruleForm.remark\n };\n this.dis = true;\n if (this.files.name) {\n this.bs64(this.files).then(function (bs64) {\n _this4.form.fileName = _this4.files.name;\n _this4.form.file = bs64;\n console.log(_this4.form, 600);\n (0, _getdata.PurchaseBj)(_this4.form).then(function (res) {\n if (res.returnCode == \"1\") {\n _this4.$message({\n message: res.returnMsg,\n type: \"success\"\n });\n _this4.page.limit = _this4.page.limit;\n _this4.getlist();\n _this4.$nextTick(function () {\n _this4.$refs[\"ruleForm\"].resetFields();\n });\n } else {\n _this4.clearLoad();\n _this4.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n }\n _this4.centerDialogVisible = false;\n }).catch(function (err) {\n console.log(err);\n });\n });\n return;\n }\n this.form.file = \"\";\n (0, _getdata.PurchaseBj)(this.form).then(function (res) {\n if (res.returnCode == \"1\") {\n _this4.$message({\n message: res.returnMsg,\n type: \"success\"\n });\n _this4.page.limit = _this4.page.limit;\n _this4.getlist();\n _this4.$nextTick(function () {\n _this4.$refs[\"ruleForm\"].resetFields();\n });\n } else {\n _this4.clearLoad();\n _this4.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n }\n _this4.centerDialogVisible = false;\n }).catch(function (err) {\n console.log(err);\n });\n } else if (val == \"3\") {\n this.createLoad();\n var _this = this;\n this.dis = true;\n this.form = {\n purchaseCentre: this.ruleForm.purchaseCentre,\n purchaseApplyDate: this.ruleForm.purchaseApplyDate,\n purchaseStartDate: this.ruleForm.purchaseEndDate ? this.ruleForm.purchaseEndDate[0] : \"\",\n purchaseEndDate: this.ruleForm.purchaseEndDate ? this.ruleForm.purchaseEndDate[1] : \"\",\n purchaseSpend: this.ruleForm.purchaseSpend,\n requisitioner: this.ruleForm.requisitioner,\n approver: this.ruleForm.approver,\n lister: this.ruleForm.lister,\n remark: this.ruleForm.remark,\n fileName: this.files.name\n };\n this.bs64(this.files).then(function (bs64) {\n _this4.form.file = bs64;\n if (_this4.flag) {\n (0, _getdata.AddPurchaselist)(_this4.form).then(function (res) {\n // console.log(res,8888);\n if (res.returnCode == \"1\") {\n _this4.$message({\n message: res.returnMsg,\n type: \"success\"\n });\n _this4.getlist();\n _this4.$nextTick(function () {\n _this4.$refs[\"ruleForm\"].resetFields();\n });\n } else {\n _this4.clearLoad();\n _this4.$message({\n message: res.returnMsg,\n type: \"warning\"\n });\n }\n _this4.centerDialogVisible = false;\n }).catch(function (err) {\n console.log(err);\n });\n }\n });\n }\n setTimeout(function () {\n _this4.clearLoad();\n }, 1000);\n this.validation = false;\n },\n filename: function filename() {},\n changedate: function changedate() {\n // console.log(val,500)\n // console.log(111111)\n },\n changeFile: function changeFile(options) {\n var _this = this;\n this.fileList = [];\n this.fileList.push(options);\n this.flag = false;\n if (this.fileList.length > 0) {\n var isLt2M = options.size / 1024 / 1024 < 2;\n if (!isLt2M) {\n this.$message.error(\"附件文件上传大小不能超过 2MB!\");\n }\n this.flag = false;\n if (isLt2M) {\n var Lastindex = this.fileList[0].name.lastIndexOf(\".\");\n if (\n // doc|docx|xls|xlsx|pdf|zip\n this.fileList[0].name.slice(Lastindex) != \".doc\" && this.fileList[0].name.slice(Lastindex) != \".docx\" && this.fileList[0].name.slice(Lastindex) != \".xls\" && this.fileList[0].name.slice(Lastindex) != \".xlsx\" && this.fileList[0].name.slice(Lastindex) != \".pdf\") {\n this.flag = false;\n this.files = {};\n this.file = \"\";\n this.ruleForm.userPosition = \"\";\n this.$message({\n message: \"请选择 doc|docx|xls|xlsx|pdf 格式\",\n type: \"warning\"\n });\n return false;\n } else {\n this.files = options.raw;\n this.file = options.name;\n this.ruleForm.userPosition = options.name;\n this.flag = true;\n }\n }\n } else {\n this.flag = true;\n }\n // console.log(this.flag,703)\n // if(!this.flag){\n // this.files = {};\n // this.file = '';\n // this.ruleForm.userPosition = \"\";\n // }\n // setTimeout(()=>{\n // console.log(this.form,12222)\n // })\n // Uploading(form)\n // .then(res => {\n // // console.log(res, 111);\n // if (res.success == \"200\") {\n // // this.aa = res.filePath;\n // this.ruleForm.picture = res.filePath;\n // }\n // })\n // .catch(err => {\n // console.log(err);\n // });\n },\n /**上传附件 */addAccessory: function addAccessory() {},\n onSearch: function onSearch() {\n var chinese = /^[\\u4e00-\\u9fa5]+$/;\n var englist = /^[a-zA-Z]+$/;\n this.iscontinue = false;\n this.iscontinue2 = false;\n // formInline.receiptorName\n if (chinese.test(this.formInline.requisitioner) || englist.test(this.formInline.requisitioner) || this.formInline.requisitioner == \"\") {\n this.iscontinue = true;\n }\n if (chinese.test(this.formInline.approver) || englist.test(this.formInline.approver) || this.formInline.approver == \"\") {\n this.iscontinue2 = true;\n }\n // console.log(this.iscontinue)\n if (!this.iscontinue || !this.iscontinue2) {\n this.validation = true;\n this.completeTitle = \"警告\";\n this.btn = 2;\n this.nav = \"姓名格式只支持输入全中或全英文!\";\n } else {\n this.page.limit = 1;\n this.createLoad();\n this.getlist();\n }\n\n // this.createLoad();\n // this.page.limit = 1;\n // this.getlist();\n },\n addPlay: function addPlay() {\n var _this5 = this;\n this.$nextTick(function () {\n _this5.$refs[\"ruleForm\"].resetFields();\n });\n this.office = \"添加\";\n this.dis = false;\n this.centerDialogVisible = true;\n this.ruleForm = {\n roomNo: \"\",\n roomAddress: \"\",\n house_type: \"\",\n roomAcreage: \"\",\n roomStatusValue: \"\",\n applyPersonName: \"\",\n userCompany: \"\",\n userName: \"\",\n userPosition: \"\",\n checkTime: \"\",\n remark: \"\"\n };\n },\n /**编辑 */handleUpdate: function handleUpdate(row) {\n // this.$nextTick(()=>{\n // this.$refs['ruleForm'].resetFields();\n // })\n\n // console.log(row,260)\n this.office = \"编辑\";\n this.centerDialogVisible = true;\n this.row = row;\n this.files = {};\n this.dis = false;\n this.ruleForm = {\n purchaseCentre: row.purchase_centre,\n purchaseApplyDate: row.purchase_apply_date,\n purchaseEndDate: [row.purchase_start_date, row.purchase_end_date],\n purchaseSpend: row.purchase_spend,\n requisitioner: row.requisitioner,\n approver: row.approver,\n lister: row.lister,\n remark: row.remark,\n userPosition: row.file_name,\n file: row.file_name\n };\n // this.$nextTick(()=>{\n // this.$refs['ruleForm'].resetFields();\n // })\n },\n /**下载 */addother: function addother(row) {\n (0, _getdata.Own)().then(function (res) {\n if (res.returnCode === \"1\") {\n var url = \"/greenH5/greenWebmodul/rest/greenPurchase/downLoad?\" + \"fileId\" + \"=\" + row.file_id;\n // document.location.href = url\n // window.open(url)\n window.location.href = url;\n }\n });\n },\n del: function del(row) {\n this.validation = true;\n this.btn = 3;\n this.completeTitle = \"删除\";\n this.nav = \"是否删除?\";\n this.row = row;\n },\n /**保存 */submitForm: function submitForm(formName) {\n var _this6 = this;\n this.$refs[formName].validate(function (valid) {\n if (valid) {\n _this6.validation = true;\n _this6.btn = 3;\n if (_this6.office == \"编辑\") {\n _this6.completeTitle = \"编辑\";\n _this6.nav = \"是否编辑?\";\n } else {\n _this6.completeTitle = \"添加\";\n _this6.nav = \"是否添加?\";\n }\n\n // AddPurchaselist().then()\n }\n });\n },\n /**取消 */resetForm: function resetForm() {\n var _this7 = this;\n this.centerDialogVisible = false;\n this.$nextTick(function () {\n _this7.$refs[\"ruleForm\"].resetFields();\n });\n },\n closeDialog: function closeDialog() {\n var _this8 = this;\n this.$nextTick(function () {\n _this8.$refs[\"ruleForm\"].resetFields();\n });\n },\n // 分页\n currentChanges: function currentChanges(val) {\n this.createLoad();\n this.page.limit = val;\n this.getlist();\n }\n }\n};",null]} |