From deef6d4cb35f6d855689f2c219087f95193dc9ba Mon Sep 17 00:00:00 2001 From: hehaibing-1996 Date: Fri, 24 Jan 2025 07:59:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=93=E5=AD=98=E7=9B=98=E7=82=B9=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=20=20=E5=BA=93=E5=AD=98=E6=9F=A5=E8=AF=A2=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PDA/PDA/package-lock.json | 18 + PDA/PDA/package.json | 5 + PDA/PDA/pages.json | 7 + PDA/PDA/pages/main/main.vue | 10 +- PDA/PDA/pages/queryBindList/queryBindList.vue | 334 ++-- PDA/PDA/pages/stockTaking/stockTaking.vue | 22 + .../dist/dev/app-plus/app-service.js | 1471 ++++++++++++++++- .../Service/MatDetailCurrentInfoService.cs | 4 + .../UpdateMatDetailCurrentInfoByIdRequest.cs | 13 + .../MatDetailCurrenInfoController.cs | 17 + 10 files changed, 1720 insertions(+), 181 deletions(-) create mode 100644 PDA/PDA/package-lock.json create mode 100644 PDA/PDA/package.json create mode 100644 PDA/PDA/pages/stockTaking/stockTaking.vue create mode 100644 WCS.Model/ApiModel/MatDetailCurrentInfo/UpdateMatDetailCurrentInfoByIdRequest.cs diff --git a/PDA/PDA/package-lock.json b/PDA/PDA/package-lock.json new file mode 100644 index 0000000..5abe469 --- /dev/null +++ b/PDA/PDA/package-lock.json @@ -0,0 +1,18 @@ +{ + "name": "PDA", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "@dcloudio/uni-ui": "^1.5.7" + } + }, + "node_modules/@dcloudio/uni-ui": { + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/@dcloudio/uni-ui/-/uni-ui-1.5.7.tgz", + "integrity": "sha512-DugxSIrQrze1FLdUOj9a+JEQ0bHGjnJTcGUK1mN/MivKg7nuKJBRWk5Ipa9sUdoBznX6ndz5h2e7Uao6x1CdCw==", + "license": "Apache-2.0" + } + } +} diff --git a/PDA/PDA/package.json b/PDA/PDA/package.json new file mode 100644 index 0000000..5dadd8b --- /dev/null +++ b/PDA/PDA/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@dcloudio/uni-ui": "^1.5.7" + } +} diff --git a/PDA/PDA/pages.json b/PDA/PDA/pages.json index 83830f4..bd2ccff 100644 --- a/PDA/PDA/pages.json +++ b/PDA/PDA/pages.json @@ -40,6 +40,13 @@ { "navigationBarTitleText" : "智慧物流系统-绑定查询" } + }, + { + "path" : "pages/stockTaking/stockTaking", + "style" : + { + "navigationBarTitleText" : "智慧物流系统-库存盘点" + } } ], "globalStyle": { diff --git a/PDA/PDA/pages/main/main.vue b/PDA/PDA/pages/main/main.vue index 74badce..ce7aed2 100644 --- a/PDA/PDA/pages/main/main.vue +++ b/PDA/PDA/pages/main/main.vue @@ -47,10 +47,12 @@ - - - - 库存盘点 + + + + + 库存盘点 + diff --git a/PDA/PDA/pages/queryBindList/queryBindList.vue b/PDA/PDA/pages/queryBindList/queryBindList.vue index 7f27458..0cfc214 100644 --- a/PDA/PDA/pages/queryBindList/queryBindList.vue +++ b/PDA/PDA/pages/queryBindList/queryBindList.vue @@ -1,6 +1,29 @@ @@ -76,29 +101,154 @@ import { getServerIPAndPort } from '@/config.js'; + import Card from '@/components/Card.vue'; + import { + ref, + nextTick + } from 'vue'; + import uniPopup from '@/node_modules/@dcloudio/uni-ui/lib/uni-popup/uni-popup'; + export default { components: { - bindSelectMat, + uniPopup, Card }, + setup() { + // 不能修改的信息 + const fixedInfo = { + infoId: 0, + matCode: '示例名称', + matName: '这是一段示例描述', + matSpec: '', + matQty: 0, + }; + const popup = ref(null); + const inputValue = ref(''); + + const showPopup = (info) => { + fixedInfo.infoId = info.id; + fixedInfo.matCode = info.matCode; + fixedInfo.matName = info.matName; + fixedInfo.matSpec = info.matSpec; + fixedInfo.matQty = info.matQty; + + inputValue.value = info.matQty; + + popup.value.open(); + // nextTick(() => { + // inputRef.value.focus(); + // }); + }; + + const hidePopup = () => { + popup.value.close(); + }; + + const saveData = () => { + if (inputValue.value == fixedInfo.matQty) { + uni.showToast({ + title: '本次修改未修改数量', + icon: 'none', + duration: 1500 + }); + hidePopup(); + return; + } + if (inputValue.value < 0) { + uni.showToast({ + title: '您所输入的数量应该大于0!', + icon: 'none', + duration: 1500 + }); + return; + } + if (inputValue.value == 0) { + uni.showToast({ + title: '数量为0,请使用删除功能!', + icon: 'none', + duration: 1500 + }); + return; + } + var serverIPAndPort = getServerIPAndPort(); + + //调用接口进行数量的修改 + uni.request({ + url: 'http://' + serverIPAndPort +'/matDetailCurrenInfo/updateMatDetailCurrentInfoById', // 请求的接口地址 + method: 'POST', // 设置请求方式为 POST + data: { + "matQty": inputValue.value, + "matDetailCurrentInfoId": fixedInfo.infoId, + "userName": getConfig('userName', 'admin'), + "deviceType": "PDA" + }, + header: { + 'Content-Type': 'application/json', // 如果需要以JSON格式发送数据 + }, + success: (res) => { + // 请求成功的回调函数 + if (res.statusCode === 200) { + //接口返回数据为200 表示获取成功! + if (res.data.code == 200) { + + uni.showToast({ + title: '修改成功!', + icon: 'none', + duration: 1200 + }); + hidePopup(); + } else { + uni.showToast({ + title: '修改失败:' + res.data.message, + icon: 'none', + duration: 2500 + }); + } + + } else { + uni.showToast({ + title: '服务器返回错误状态码' + res.statusCode, + icon: 'none', + duration: 2500 + }); + } + }, + fail: (err) => { + // 请求失败的回调函数 + uni.showToast({ + title: '请求失败' + err, + icon: 'none', + duration: 2500 + }); + + this.clear(); + }, + complete: (event) => { + // 请求完成的回调函数(无论成功或失败都会调用) + + } + }); + + + + + }; + + return { + fixedInfo, + popup, + inputValue, + showPopup, + hidePopup, + saveData + }; + }, data() { return { - - isNeedScanLocationCode: true, - isNeedCallShelfCode: true, - - - matBaseInfoId: null, - matCode: '', locationId: null, locationCode: '', - matCode: '', - matName: '', - matSpec: '', - matQty: 100, //默认数量值 - userName: '', //当前登录的用户名 recordCount: 0, @@ -141,81 +291,9 @@ this.shelfCode = originalString; //调用接口获取当前工位信息 当前工位是否有货架 var serverIPAndPort = getServerIPAndPort(); - // uni.request({ - // url: 'http://' + serverIPAndPort + '/pdaMatBind/getShelfInfoByLocationCode', // 请求的接口地址 - // method: 'POST', // 设置请求方式为 POST - // data: { - // "locationCode": this.locationCode, - // "userName": this.userName, - // "deviceType": "PDA" - // }, - // header: { - // 'Content-Type': 'application/json', // 如果需要以JSON格式发送数据 - // }, - // success: (res) => { - // // 请求成功的回调函数 - // if (res.statusCode === 200) { - // //接口返回数据为200 表示获取成功! - // if (res.data.code == 200) { - // this.locationId = res.data.data.locationId; - // this.shelfId = res.data.data.shelfId; - // this.shelfCode = res.data.data.shelfCode; - - // if (this.shelfId == null) { - // this.shelfCode = '(工位无货架,请呼叫!)'; - // this.isNeedScanLocationCode = false; - // this.isNeedCallShelfCode = true; - // this.placeholderText = '请呼叫货架'; - // } else { - // this.isNeedScanLocationCode = false; - // this.isNeedCallShelfCode = false; - // this.placeholderText = '输入编码或名称'; - // } - - // uni.showToast({ - // title: '获取成功!', - // icon: 'none', - // duration: 1500 - // }); - - // } else { - // uni.showToast({ - // title: '获取失败:' + res.data.message, - // icon: 'none', - // duration: 3500 - // }); - // this.clear(); - // } - - // } else { - // uni.showToast({ - // title: '服务器返回错误状态码' + res.statusCode, - // icon: 'none', - // duration: 3000 - // }); - // this.clear(); - // } - // }, - // fail: (err) => { - // // 请求失败的回调函数 - // uni.showToast({ - // title: '请求失败' + err, - // icon: 'none', - // duration: 3000 - // }); - - // this.clear(); - // }, - // complete: (event) => { - // // 请求完成的回调函数(无论成功或失败都会调用) - // console.log('请求完成', event); - // } - // }); - - uni.request({ url: 'http://' + serverIPAndPort + - '/matDetailCurrenInfo/getMatDetailCurrentInfos', // 请求的接口地址 + '/matDetailCurrenInfo/getMatDetailCurrentInfos', // 请求的接口地址 method: 'POST', // 设置请求方式为 POST data: { "shelfCode": this.shelfCode, @@ -288,14 +366,6 @@ }, - bindSelectedMat: function(item) { - console.log('用户选择了项目:', item); - this.matCode = item.matCode; - this.matName = item.matName; - this.matSpec = item.matSpec; - this.matBaseInfoId = item.id; - }, - queryMatList: function() { if (this.shelfCode == null || this.shelfCode == '') { uni.showToast({ @@ -310,7 +380,7 @@ var serverIPAndPort = getServerIPAndPort(); uni.request({ url: 'http://' + serverIPAndPort + - '/matDetailCurrenInfo/getMatDetailCurrentInfos', // 请求的接口地址 + '/matDetailCurrenInfo/getMatDetailCurrentInfos', // 请求的接口地址 method: 'POST', // 设置请求方式为 POST data: { "shelfCode": this.shelfCode, @@ -385,22 +455,22 @@ //清空当前界面所有内容 clear: function() { - this.locationId = null; - this.locationCode = ''; - this.shelfId = null; - this.shelfCode = ''; - this.isNeedCallShelfCode = true; - this.isNeedScanLocationCode = true; this.placeholderText = '请先扫描货架码'; + this.cardData = null; + this.recordCount = 0; }, - clearMatInfo: function() { - this.matCode = ''; - this.matName = ''; - this.matSpec = ''; - }, - handlePopupClose() { - // 弹出层关闭后的处理逻辑 - console.log('弹出层已关闭'); + + //长按 + longpress(item) { + // uni.showToast({ + // title: '您长按了' + item.matCode, + // icon: 'none', + // duration: 1500 + // }); + + this.showPopup(item); + //this.$refs.popup.open(); + }, } } @@ -463,4 +533,46 @@ .scroll-view { height: 75vh; } + + .popup-content { + padding: 20px; + background-color: rgba(0, 0, 0, 1); + background-color: white; + z-index: 2; + border-radius: 20rpx; + } + + + .input-item { + margin-bottom: 5rpx; + display: flex; + align-items: center; + /* 让内部元素垂直居中 */ + } + + .input-item label { + display: inline-block; + } + + .input-item input { + display: inline-block; + background: wheat; + width: 280rpx; + } + + .button-group { + display: flex; + justify-content: space-between; + margin-top: 20rpx; + } + + .button-group button { + margin-top: 20rpx; + padding: 10rpx 10rpx; + border: none; + border-radius: 5px; + background-color: #007AFF; + color: #fff; + cursor: pointer; + } \ No newline at end of file diff --git a/PDA/PDA/pages/stockTaking/stockTaking.vue b/PDA/PDA/pages/stockTaking/stockTaking.vue new file mode 100644 index 0000000..8183fd0 --- /dev/null +++ b/PDA/PDA/pages/stockTaking/stockTaking.vue @@ -0,0 +1,22 @@ + + + + + diff --git a/PDA/PDA/unpackage/dist/dev/app-plus/app-service.js b/PDA/PDA/unpackage/dist/dev/app-plus/app-service.js index 823df8f..fbef8ac 100644 --- a/PDA/PDA/unpackage/dist/dev/app-plus/app-service.js +++ b/PDA/PDA/unpackage/dist/dev/app-plus/app-service.js @@ -38,6 +38,9 @@ if (uni.restoreGlobal) { console[type].apply(console, [...args, filename]); } } + function resolveEasycom(component, easycom) { + return typeof component === "string" ? easycom : component; + } var main = null; var receiver = null; function recive(success, fail) { @@ -142,7 +145,7 @@ if (uni.restoreGlobal) { } return target; }; - const _sfc_main$7 = { + const _sfc_main$a = { data() { return { title: "登录", @@ -218,7 +221,7 @@ if (uni.restoreGlobal) { } } }; - function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) { + function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: "bg-image" }, [ vue.createElementVNode("navigator", { url: "../config/config", @@ -304,8 +307,8 @@ if (uni.restoreGlobal) { ]) ]); } - const PagesIndexIndex = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$6], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/pages/index/index.vue"]]); - const _sfc_main$6 = { + const PagesIndexIndex = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$9], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/pages/index/index.vue"]]); + const _sfc_main$9 = { data() { return { serverIP: "", @@ -327,7 +330,7 @@ if (uni.restoreGlobal) { } } }; - function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) { + function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: "container" }, [ vue.createElementVNode("view", null, [ vue.createElementVNode("label", null, "服务器IP:"), @@ -364,7 +367,7 @@ if (uni.restoreGlobal) { }, "保存配置") ]); } - const PagesConfigConfig = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/pages/config/config.vue"]]); + const PagesConfigConfig = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$8], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/pages/config/config.vue"]]); const _imports_0$1 = "/static/logOut.png"; const _imports_1 = "/static/bind.png"; const _imports_2 = "/static/bindQuery.png"; @@ -372,13 +375,13 @@ if (uni.restoreGlobal) { const _imports_4 = "/static/callOut.png"; const _imports_5 = "/static/stockTaking.png"; const _imports_6 = "/static/task.png"; - const _sfc_main$5 = { + const _sfc_main$8 = { data() { return {}; }, methods: {} }; - function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) { + function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: "bg-image" }, [ vue.createElementVNode("view", null, [ vue.createElementVNode("navigator", { @@ -509,8 +512,8 @@ if (uni.restoreGlobal) { ]) ]); } - const PagesMainMain = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/pages/main/main.vue"]]); - const _sfc_main$4 = { + const PagesMainMain = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$7], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/pages/main/main.vue"]]); + const _sfc_main$7 = { data() { return { visible: false, @@ -596,7 +599,7 @@ if (uni.restoreGlobal) { } } }; - function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) { + function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) { return $data.visible ? (vue.openBlock(), vue.createElementBlock("view", { key: 0, class: "popup-container" @@ -627,9 +630,9 @@ if (uni.restoreGlobal) { ]) ])) : vue.createCommentVNode("v-if", true); } - const PagesBindSelectMatBindSelectMat = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3], ["__scopeId", "data-v-68e7b952"], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/pages/bindSelectMat/bindSelectMat.vue"]]); + const PagesBindSelectMatBindSelectMat = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$6], ["__scopeId", "data-v-68e7b952"], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/pages/bindSelectMat/bindSelectMat.vue"]]); const _imports_0 = "/static/scan.png"; - const _sfc_main$3 = { + const _sfc_main$6 = { components: { bindSelectMat: PagesBindSelectMatBindSelectMat }, @@ -862,7 +865,7 @@ if (uni.restoreGlobal) { } } }; - function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) { + function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) { const _component_bindSelectMat = vue.resolveComponent("bindSelectMat"); return vue.openBlock(), vue.createElementBlock("view", { class: "bg-image" }, [ vue.createVNode(_component_bindSelectMat, { @@ -1039,8 +1042,767 @@ if (uni.restoreGlobal) { ]) ]); } - const PagesBindBind = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/pages/bind/bind.vue"]]); - const _sfc_main$2 = { + const PagesBindBind = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/pages/bind/bind.vue"]]); + class MPAnimation { + constructor(options, _this) { + this.options = options; + this.animation = uni.createAnimation(options); + this.currentStepAnimates = {}; + this.next = 0; + this.$ = _this; + } + _nvuePushAnimates(type, args) { + let aniObj = this.currentStepAnimates[this.next]; + let styles = {}; + if (!aniObj) { + styles = { + styles: {}, + config: {} + }; + } else { + styles = aniObj; + } + if (animateTypes1.includes(type)) { + if (!styles.styles.transform) { + styles.styles.transform = ""; + } + let unit = ""; + if (type === "rotate") { + unit = "deg"; + } + styles.styles.transform += `${type}(${args + unit}) `; + } else { + styles.styles[type] = `${args}`; + } + this.currentStepAnimates[this.next] = styles; + } + _animateRun(styles = {}, config = {}) { + let ref = this.$.$refs["ani"].ref; + if (!ref) + return; + return new Promise((resolve, reject) => { + nvueAnimation.transition(ref, { + styles, + ...config + }, (res) => { + resolve(); + }); + }); + } + _nvueNextAnimate(animates, step = 0, fn) { + let obj = animates[step]; + if (obj) { + let { + styles, + config + } = obj; + this._animateRun(styles, config).then(() => { + step += 1; + this._nvueNextAnimate(animates, step, fn); + }); + } else { + this.currentStepAnimates = {}; + typeof fn === "function" && fn(); + this.isEnd = true; + } + } + step(config = {}) { + this.animation.step(config); + return this; + } + run(fn) { + this.$.animationData = this.animation.export(); + this.$.timer = setTimeout(() => { + typeof fn === "function" && fn(); + }, this.$.durationTime); + } + } + const animateTypes1 = [ + "matrix", + "matrix3d", + "rotate", + "rotate3d", + "rotateX", + "rotateY", + "rotateZ", + "scale", + "scale3d", + "scaleX", + "scaleY", + "scaleZ", + "skew", + "skewX", + "skewY", + "translate", + "translate3d", + "translateX", + "translateY", + "translateZ" + ]; + const animateTypes2 = ["opacity", "backgroundColor"]; + const animateTypes3 = ["width", "height", "left", "right", "top", "bottom"]; + animateTypes1.concat(animateTypes2, animateTypes3).forEach((type) => { + MPAnimation.prototype[type] = function(...args) { + this.animation[type](...args); + return this; + }; + }); + function createAnimation(option, _this) { + if (!_this) + return; + clearTimeout(_this.timer); + return new MPAnimation(option, _this); + } + const _sfc_main$5 = { + name: "uniTransition", + emits: ["click", "change"], + props: { + show: { + type: Boolean, + default: false + }, + modeClass: { + type: [Array, String], + default() { + return "fade"; + } + }, + duration: { + type: Number, + default: 300 + }, + styles: { + type: Object, + default() { + return {}; + } + }, + customClass: { + type: String, + default: "" + } + }, + data() { + return { + isShow: false, + transform: "", + opacity: 1, + animationData: {}, + durationTime: 300, + config: {} + }; + }, + watch: { + show: { + handler(newVal) { + if (newVal) { + this.open(); + } else { + if (this.isShow) { + this.close(); + } + } + }, + immediate: true + } + }, + computed: { + // 生成样式数据 + stylesObject() { + let styles = { + ...this.styles, + "transition-duration": this.duration / 1e3 + "s" + }; + let transform = ""; + for (let i in styles) { + let line = this.toLine(i); + transform += line + ":" + styles[i] + ";"; + } + return transform; + }, + // 初始化动画条件 + transformStyles() { + return "transform:" + this.transform + ";opacity:" + this.opacity + ";" + this.stylesObject; + } + }, + created() { + this.config = { + duration: this.duration, + timingFunction: "ease", + transformOrigin: "50% 50%", + delay: 0 + }; + this.durationTime = this.duration; + }, + methods: { + /** + * ref 触发 初始化动画 + */ + init(obj = {}) { + if (obj.duration) { + this.durationTime = obj.duration; + } + this.animation = createAnimation(Object.assign(this.config, obj), this); + }, + /** + * 点击组件触发回调 + */ + onClick() { + this.$emit("click", { + detail: this.isShow + }); + }, + /** + * ref 触发 动画分组 + * @param {Object} obj + */ + step(obj, config = {}) { + if (!this.animation) + return; + for (let i in obj) { + try { + if (typeof obj[i] === "object") { + this.animation[i](...obj[i]); + } else { + this.animation[i](obj[i]); + } + } catch (e) { + formatAppLog("error", "at uni_modules/uni-transition/components/uni-transition/uni-transition.vue:139", `方法 ${i} 不存在`); + } + } + this.animation.step(config); + return this; + }, + /** + * ref 触发 执行动画 + */ + run(fn) { + if (!this.animation) + return; + this.animation.run(fn); + }, + // 开始过度动画 + open() { + clearTimeout(this.timer); + this.transform = ""; + this.isShow = true; + let { opacity, transform } = this.styleInit(false); + if (typeof opacity !== "undefined") { + this.opacity = opacity; + } + this.transform = transform; + this.$nextTick(() => { + this.timer = setTimeout(() => { + this.animation = createAnimation(this.config, this); + this.tranfromInit(false).step(); + this.animation.run(); + this.$emit("change", { + detail: this.isShow + }); + }, 20); + }); + }, + // 关闭过度动画 + close(type) { + if (!this.animation) + return; + this.tranfromInit(true).step().run(() => { + this.isShow = false; + this.animationData = null; + this.animation = null; + let { opacity, transform } = this.styleInit(false); + this.opacity = opacity || 1; + this.transform = transform; + this.$emit("change", { + detail: this.isShow + }); + }); + }, + // 处理动画开始前的默认样式 + styleInit(type) { + let styles = { + transform: "" + }; + let buildStyle = (type2, mode) => { + if (mode === "fade") { + styles.opacity = this.animationType(type2)[mode]; + } else { + styles.transform += this.animationType(type2)[mode] + " "; + } + }; + if (typeof this.modeClass === "string") { + buildStyle(type, this.modeClass); + } else { + this.modeClass.forEach((mode) => { + buildStyle(type, mode); + }); + } + return styles; + }, + // 处理内置组合动画 + tranfromInit(type) { + let buildTranfrom = (type2, mode) => { + let aniNum = null; + if (mode === "fade") { + aniNum = type2 ? 0 : 1; + } else { + aniNum = type2 ? "-100%" : "0"; + if (mode === "zoom-in") { + aniNum = type2 ? 0.8 : 1; + } + if (mode === "zoom-out") { + aniNum = type2 ? 1.2 : 1; + } + if (mode === "slide-right") { + aniNum = type2 ? "100%" : "0"; + } + if (mode === "slide-bottom") { + aniNum = type2 ? "100%" : "0"; + } + } + this.animation[this.animationMode()[mode]](aniNum); + }; + if (typeof this.modeClass === "string") { + buildTranfrom(type, this.modeClass); + } else { + this.modeClass.forEach((mode) => { + buildTranfrom(type, mode); + }); + } + return this.animation; + }, + animationType(type) { + return { + fade: type ? 1 : 0, + "slide-top": `translateY(${type ? "0" : "-100%"})`, + "slide-right": `translateX(${type ? "0" : "100%"})`, + "slide-bottom": `translateY(${type ? "0" : "100%"})`, + "slide-left": `translateX(${type ? "0" : "-100%"})`, + "zoom-in": `scaleX(${type ? 1 : 0.8}) scaleY(${type ? 1 : 0.8})`, + "zoom-out": `scaleX(${type ? 1 : 1.2}) scaleY(${type ? 1 : 1.2})` + }; + }, + // 内置动画类型与实际动画对应字典 + animationMode() { + return { + fade: "opacity", + "slide-top": "translateY", + "slide-right": "translateX", + "slide-bottom": "translateY", + "slide-left": "translateX", + "zoom-in": "scale", + "zoom-out": "scale" + }; + }, + // 驼峰转中横线 + toLine(name) { + return name.replace(/([A-Z])/g, "-$1").toLowerCase(); + } + } + }; + function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) { + return $data.isShow ? (vue.openBlock(), vue.createElementBlock("view", { + key: 0, + ref: "ani", + animation: $data.animationData, + class: vue.normalizeClass($props.customClass), + style: vue.normalizeStyle($options.transformStyles), + onClick: _cache[0] || (_cache[0] = (...args) => $options.onClick && $options.onClick(...args)) + }, [ + vue.renderSlot(_ctx.$slots, "default") + ], 14, ["animation"])) : vue.createCommentVNode("v-if", true); + } + const __easycom_0$1 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/uni_modules/uni-transition/components/uni-transition/uni-transition.vue"]]); + const _sfc_main$4 = { + name: "uniPopup", + components: {}, + emits: ["change", "maskClick"], + props: { + // 开启动画 + animation: { + type: Boolean, + default: true + }, + // 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层 + // message: 消息提示 ; dialog : 对话框 + type: { + type: String, + default: "center" + }, + // maskClick + isMaskClick: { + type: Boolean, + default: null + }, + // TODO 2 个版本后废弃属性 ,使用 isMaskClick + maskClick: { + type: Boolean, + default: null + }, + backgroundColor: { + type: String, + default: "none" + }, + safeArea: { + type: Boolean, + default: true + }, + maskBackgroundColor: { + type: String, + default: "rgba(0, 0, 0, 0.4)" + } + }, + watch: { + /** + * 监听type类型 + */ + type: { + handler: function(type) { + if (!this.config[type]) + return; + this[this.config[type]](true); + }, + immediate: true + }, + isDesktop: { + handler: function(newVal) { + if (!this.config[newVal]) + return; + this[this.config[this.type]](true); + }, + immediate: true + }, + /** + * 监听遮罩是否可点击 + * @param {Object} val + */ + maskClick: { + handler: function(val) { + this.mkclick = val; + }, + immediate: true + }, + isMaskClick: { + handler: function(val) { + this.mkclick = val; + }, + immediate: true + }, + // H5 下禁止底部滚动 + showPopup(show) { + } + }, + data() { + return { + duration: 300, + ani: [], + showPopup: false, + showTrans: false, + popupWidth: 0, + popupHeight: 0, + config: { + top: "top", + bottom: "bottom", + center: "center", + left: "left", + right: "right", + message: "top", + dialog: "center", + share: "bottom" + }, + maskClass: { + position: "fixed", + bottom: 0, + top: 0, + left: 0, + right: 0, + backgroundColor: "rgba(0, 0, 0, 0.4)" + }, + transClass: { + position: "fixed", + left: 0, + right: 0 + }, + maskShow: true, + mkclick: true, + popupstyle: this.isDesktop ? "fixforpc-top" : "top" + }; + }, + computed: { + isDesktop() { + return this.popupWidth >= 500 && this.popupHeight >= 500; + }, + bg() { + if (this.backgroundColor === "" || this.backgroundColor === "none") { + return "transparent"; + } + return this.backgroundColor; + } + }, + mounted() { + const fixSize = () => { + const { + windowWidth, + windowHeight, + windowTop, + safeArea, + screenHeight, + safeAreaInsets + } = uni.getSystemInfoSync(); + this.popupWidth = windowWidth; + this.popupHeight = windowHeight + (windowTop || 0); + if (safeArea && this.safeArea) { + this.safeAreaInsets = safeAreaInsets.bottom; + } else { + this.safeAreaInsets = 0; + } + }; + fixSize(); + }, + // TODO vue3 + unmounted() { + this.setH5Visible(); + }, + created() { + if (this.isMaskClick === null && this.maskClick === null) { + this.mkclick = true; + } else { + this.mkclick = this.isMaskClick !== null ? this.isMaskClick : this.maskClick; + } + if (this.animation) { + this.duration = 300; + } else { + this.duration = 0; + } + this.messageChild = null; + this.clearPropagation = false; + this.maskClass.backgroundColor = this.maskBackgroundColor; + }, + methods: { + setH5Visible() { + }, + /** + * 公用方法,不显示遮罩层 + */ + closeMask() { + this.maskShow = false; + }, + /** + * 公用方法,遮罩层禁止点击 + */ + disableMask() { + this.mkclick = false; + }, + // TODO nvue 取消冒泡 + clear(e) { + e.stopPropagation(); + this.clearPropagation = true; + }, + open(direction) { + if (this.showPopup) { + clearTimeout(this.timer); + this.showPopup = false; + } + let innerType = ["top", "center", "bottom", "left", "right", "message", "dialog", "share"]; + if (!(direction && innerType.indexOf(direction) !== -1)) { + direction = this.type; + } + if (!this.config[direction]) { + formatAppLog("error", "at uni_modules/uni-popup/components/uni-popup/uni-popup.vue:280", "缺少类型:", direction); + return; + } + this[this.config[direction]](); + this.$emit("change", { + show: true, + type: direction + }); + }, + close(type) { + this.showTrans = false; + this.$emit("change", { + show: false, + type: this.type + }); + clearTimeout(this.timer); + this.timer = setTimeout(() => { + this.showPopup = false; + }, 300); + }, + // TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容 + touchstart() { + this.clearPropagation = false; + }, + onTap() { + if (this.clearPropagation) { + this.clearPropagation = false; + return; + } + this.$emit("maskClick"); + if (!this.mkclick) + return; + this.close(); + }, + /** + * 顶部弹出样式处理 + */ + top(type) { + this.popupstyle = this.isDesktop ? "fixforpc-top" : "top"; + this.ani = ["slide-top"]; + this.transClass = { + position: "fixed", + left: 0, + right: 0, + backgroundColor: this.bg + }; + if (type) + return; + this.showPopup = true; + this.showTrans = true; + this.$nextTick(() => { + if (this.messageChild && this.type === "message") { + this.messageChild.timerClose(); + } + }); + }, + /** + * 底部弹出样式处理 + */ + bottom(type) { + this.popupstyle = "bottom"; + this.ani = ["slide-bottom"]; + this.transClass = { + position: "fixed", + left: 0, + right: 0, + bottom: 0, + paddingBottom: this.safeAreaInsets + "px", + backgroundColor: this.bg + }; + if (type) + return; + this.showPopup = true; + this.showTrans = true; + }, + /** + * 中间弹出样式处理 + */ + center(type) { + this.popupstyle = "center"; + this.ani = ["zoom-out", "fade"]; + this.transClass = { + position: "fixed", + display: "flex", + flexDirection: "column", + bottom: 0, + left: 0, + right: 0, + top: 0, + justifyContent: "center", + alignItems: "center" + }; + if (type) + return; + this.showPopup = true; + this.showTrans = true; + }, + left(type) { + this.popupstyle = "left"; + this.ani = ["slide-left"]; + this.transClass = { + position: "fixed", + left: 0, + bottom: 0, + top: 0, + backgroundColor: this.bg, + display: "flex", + flexDirection: "column" + }; + if (type) + return; + this.showPopup = true; + this.showTrans = true; + }, + right(type) { + this.popupstyle = "right"; + this.ani = ["slide-right"]; + this.transClass = { + position: "fixed", + bottom: 0, + right: 0, + top: 0, + backgroundColor: this.bg, + display: "flex", + flexDirection: "column" + }; + if (type) + return; + this.showPopup = true; + this.showTrans = true; + } + } + }; + function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) { + const _component_uni_transition = resolveEasycom(vue.resolveDynamicComponent("uni-transition"), __easycom_0$1); + return $data.showPopup ? (vue.openBlock(), vue.createElementBlock( + "view", + { + key: 0, + class: vue.normalizeClass(["uni-popup", [$data.popupstyle, $options.isDesktop ? "fixforpc-z-index" : ""]]) + }, + [ + vue.createElementVNode( + "view", + { + onTouchstart: _cache[1] || (_cache[1] = (...args) => $options.touchstart && $options.touchstart(...args)) + }, + [ + $data.maskShow ? (vue.openBlock(), vue.createBlock(_component_uni_transition, { + key: "1", + name: "mask", + "mode-class": "fade", + styles: $data.maskClass, + duration: $data.duration, + show: $data.showTrans, + onClick: $options.onTap + }, null, 8, ["styles", "duration", "show", "onClick"])) : vue.createCommentVNode("v-if", true), + vue.createVNode(_component_uni_transition, { + key: "2", + "mode-class": $data.ani, + name: "content", + styles: $data.transClass, + duration: $data.duration, + show: $data.showTrans, + onClick: $options.onTap + }, { + default: vue.withCtx(() => [ + vue.createElementVNode( + "view", + { + class: vue.normalizeClass(["uni-popup__wrapper", [$data.popupstyle]]), + style: vue.normalizeStyle({ backgroundColor: $options.bg }), + onClick: _cache[0] || (_cache[0] = (...args) => $options.clear && $options.clear(...args)) + }, + [ + vue.renderSlot(_ctx.$slots, "default", {}, void 0, true) + ], + 6 + /* CLASS, STYLE */ + ) + ]), + _: 3 + /* FORWARDED */ + }, 8, ["mode-class", "styles", "duration", "show", "onClick"]) + ], + 32 + /* NEED_HYDRATION */ + ) + ], + 2 + /* CLASS */ + )) : vue.createCommentVNode("v-if", true); + } + const __easycom_0 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3], ["__scopeId", "data-v-4dd3c44b"], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/uni_modules/uni-popup/components/uni-popup/uni-popup.vue"]]); + const _sfc_main$3 = { __name: "Card", props: { item: { @@ -1064,7 +1826,7 @@ if (uni.restoreGlobal) { return __returned__; } }; - function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { + function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) { return vue.openBlock(), vue.createElementBlock("view", { class: "card" }, [ vue.createElementVNode("view", { class: "card-header" }, [ vue.createElementVNode( @@ -1165,25 +1927,539 @@ if (uni.restoreGlobal) { ]) ]); } - const Card = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-29c414df"], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/components/Card.vue"]]); - const _sfc_main$1 = { - components: { - bindSelectMat: PagesBindSelectMatBindSelectMat, - Card + const Card = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__scopeId", "data-v-29c414df"], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/components/Card.vue"]]); + const _sfc_main$2 = { + name: "uniPopup", + components: {}, + emits: ["change", "maskClick"], + props: { + // 开启动画 + animation: { + type: Boolean, + default: true + }, + // 弹出层类型,可选值,top: 顶部弹出层;bottom:底部弹出层;center:全屏弹出层 + // message: 消息提示 ; dialog : 对话框 + type: { + type: String, + default: "center" + }, + // maskClick + isMaskClick: { + type: Boolean, + default: null + }, + // TODO 2 个版本后废弃属性 ,使用 isMaskClick + maskClick: { + type: Boolean, + default: null + }, + backgroundColor: { + type: String, + default: "none" + }, + safeArea: { + type: Boolean, + default: true + }, + maskBackgroundColor: { + type: String, + default: "rgba(0, 0, 0, 0.4)" + }, + borderRadius: { + type: String + } + }, + watch: { + /** + * 监听type类型 + */ + type: { + handler: function(type) { + if (!this.config[type]) + return; + this[this.config[type]](true); + }, + immediate: true + }, + isDesktop: { + handler: function(newVal) { + if (!this.config[newVal]) + return; + this[this.config[this.type]](true); + }, + immediate: true + }, + /** + * 监听遮罩是否可点击 + * @param {Object} val + */ + maskClick: { + handler: function(val) { + this.mkclick = val; + }, + immediate: true + }, + isMaskClick: { + handler: function(val) { + this.mkclick = val; + }, + immediate: true + }, + // H5 下禁止底部滚动 + showPopup(show) { + } + }, + data() { + return { + duration: 300, + ani: [], + showPopup: false, + showTrans: false, + popupWidth: 0, + popupHeight: 0, + config: { + top: "top", + bottom: "bottom", + center: "center", + left: "left", + right: "right", + message: "top", + dialog: "center", + share: "bottom" + }, + maskClass: { + position: "fixed", + bottom: 0, + top: 0, + left: 0, + right: 0, + backgroundColor: "rgba(0, 0, 0, 0.4)" + }, + transClass: { + backgroundColor: "transparent", + borderRadius: this.borderRadius || "0", + position: "fixed", + left: 0, + right: 0 + }, + maskShow: true, + mkclick: true, + popupstyle: "top" + }; + }, + computed: { + getStyles() { + let res = { backgroundColor: this.bg }; + if (this.borderRadius || "0") { + res = Object.assign(res, { borderRadius: this.borderRadius }); + } + return res; + }, + isDesktop() { + return this.popupWidth >= 500 && this.popupHeight >= 500; + }, + bg() { + if (this.backgroundColor === "" || this.backgroundColor === "none") { + return "transparent"; + } + return this.backgroundColor; + } + }, + mounted() { + const fixSize = () => { + const { + windowWidth, + windowHeight, + windowTop, + safeArea, + screenHeight, + safeAreaInsets + } = uni.getSystemInfoSync(); + this.popupWidth = windowWidth; + this.popupHeight = windowHeight + (windowTop || 0); + if (safeArea && this.safeArea) { + this.safeAreaInsets = safeAreaInsets.bottom; + } else { + this.safeAreaInsets = 0; + } + }; + fixSize(); + }, + // TODO vue3 + unmounted() { + this.setH5Visible(); + }, + activated() { + this.setH5Visible(!this.showPopup); + }, + deactivated() { + this.setH5Visible(true); + }, + created() { + if (this.isMaskClick === null && this.maskClick === null) { + this.mkclick = true; + } else { + this.mkclick = this.isMaskClick !== null ? this.isMaskClick : this.maskClick; + } + if (this.animation) { + this.duration = 300; + } else { + this.duration = 0; + } + this.messageChild = null; + this.clearPropagation = false; + this.maskClass.backgroundColor = this.maskBackgroundColor; + }, + methods: { + setH5Visible(visible = true) { + }, + /** + * 公用方法,不显示遮罩层 + */ + closeMask() { + this.maskShow = false; + }, + /** + * 公用方法,遮罩层禁止点击 + */ + disableMask() { + this.mkclick = false; + }, + // TODO nvue 取消冒泡 + clear(e) { + e.stopPropagation(); + this.clearPropagation = true; + }, + open(direction) { + if (this.showPopup) { + return; + } + let innerType = ["top", "center", "bottom", "left", "right", "message", "dialog", "share"]; + if (!(direction && innerType.indexOf(direction) !== -1)) { + direction = this.type; + } + if (!this.config[direction]) { + formatAppLog("error", "at node_modules/@dcloudio/uni-ui/lib/uni-popup/uni-popup.vue:310", "缺少类型:", direction); + return; + } + this[this.config[direction]](); + this.$emit("change", { + show: true, + type: direction + }); + }, + close(type) { + this.showTrans = false; + this.$emit("change", { + show: false, + type: this.type + }); + clearTimeout(this.timer); + this.timer = setTimeout(() => { + this.showPopup = false; + }, 300); + }, + // TODO 处理冒泡事件,头条的冒泡事件有问题 ,先这样兼容 + touchstart() { + this.clearPropagation = false; + }, + onTap() { + if (this.clearPropagation) { + this.clearPropagation = false; + return; + } + this.$emit("maskClick"); + if (!this.mkclick) + return; + this.close(); + }, + /** + * 顶部弹出样式处理 + */ + top(type) { + this.popupstyle = this.isDesktop ? "fixforpc-top" : "top"; + this.ani = ["slide-top"]; + this.transClass = { + position: "fixed", + left: 0, + right: 0, + backgroundColor: this.bg, + borderRadius: this.borderRadius || "0" + }; + if (type) + return; + this.showPopup = true; + this.showTrans = true; + this.$nextTick(() => { + this.showPoptrans(); + if (this.messageChild && this.type === "message") { + this.messageChild.timerClose(); + } + }); + }, + /** + * 底部弹出样式处理 + */ + bottom(type) { + this.popupstyle = "bottom"; + this.ani = ["slide-bottom"]; + this.transClass = { + position: "fixed", + left: 0, + right: 0, + bottom: 0, + paddingBottom: this.safeAreaInsets + "px", + backgroundColor: this.bg, + borderRadius: this.borderRadius || "0" + }; + if (type) + return; + this.showPoptrans(); + }, + /** + * 中间弹出样式处理 + */ + center(type) { + this.popupstyle = "center"; + this.ani = ["zoom-out", "fade"]; + this.transClass = { + position: "fixed", + display: "flex", + flexDirection: "column", + bottom: 0, + left: 0, + right: 0, + top: 0, + justifyContent: "center", + alignItems: "center", + borderRadius: this.borderRadius || "0" + }; + if (type) + return; + this.showPoptrans(); + }, + left(type) { + this.popupstyle = "left"; + this.ani = ["slide-left"]; + this.transClass = { + position: "fixed", + left: 0, + bottom: 0, + top: 0, + backgroundColor: this.bg, + borderRadius: this.borderRadius || "0", + display: "flex", + flexDirection: "column" + }; + if (type) + return; + this.showPoptrans(); + }, + right(type) { + this.popupstyle = "right"; + this.ani = ["slide-right"]; + this.transClass = { + position: "fixed", + bottom: 0, + right: 0, + top: 0, + backgroundColor: this.bg, + borderRadius: this.borderRadius || "0", + display: "flex", + flexDirection: "column" + }; + if (type) + return; + this.showPoptrans(); + }, + showPoptrans() { + this.$nextTick(() => { + this.showPopup = true; + this.showTrans = true; + }); + } + } + }; + function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { + const _component_uni_transition = resolveEasycom(vue.resolveDynamicComponent("uni-transition"), __easycom_0$1); + return $data.showPopup ? (vue.openBlock(), vue.createElementBlock( + "view", + { + key: 0, + class: vue.normalizeClass(["uni-popup", [$data.popupstyle, $options.isDesktop ? "fixforpc-z-index" : ""]]) + }, + [ + vue.createElementVNode( + "view", + { + onTouchstart: _cache[1] || (_cache[1] = (...args) => $options.touchstart && $options.touchstart(...args)) + }, + [ + $data.maskShow ? (vue.openBlock(), vue.createBlock(_component_uni_transition, { + key: "1", + name: "mask", + "mode-class": "fade", + styles: $data.maskClass, + duration: $data.duration, + show: $data.showTrans, + onClick: $options.onTap + }, null, 8, ["styles", "duration", "show", "onClick"])) : vue.createCommentVNode("v-if", true), + vue.createVNode(_component_uni_transition, { + key: "2", + "mode-class": $data.ani, + name: "content", + styles: $data.transClass, + duration: $data.duration, + show: $data.showTrans, + onClick: $options.onTap + }, { + default: vue.withCtx(() => [ + vue.createElementVNode( + "view", + { + class: vue.normalizeClass(["uni-popup__wrapper", [$data.popupstyle]]), + style: vue.normalizeStyle($options.getStyles), + onClick: _cache[0] || (_cache[0] = (...args) => $options.clear && $options.clear(...args)) + }, + [ + vue.renderSlot(_ctx.$slots, "default", {}, void 0, true) + ], + 6 + /* CLASS, STYLE */ + ) + ]), + _: 3 + /* FORWARDED */ + }, 8, ["mode-class", "styles", "duration", "show", "onClick"]) + ], + 32 + /* NEED_HYDRATION */ + ) + ], + 2 + /* CLASS */ + )) : vue.createCommentVNode("v-if", true); + } + const uniPopup = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-7db519c7"], ["__file", "E:/代码/赛特制冷WCS/wcs/PDA/PDA/node_modules/@dcloudio/uni-ui/lib/uni-popup/uni-popup.vue"]]); + const _sfc_main$1 = { + components: { + uniPopup, + Card + }, + setup() { + const fixedInfo = { + infoId: 0, + matCode: "示例名称", + matName: "这是一段示例描述", + matSpec: "", + matQty: 0 + }; + const popup = vue.ref(null); + const inputValue = vue.ref(""); + const showPopup = (info) => { + fixedInfo.infoId = info.id; + fixedInfo.matCode = info.matCode; + fixedInfo.matName = info.matName; + fixedInfo.matSpec = info.matSpec; + fixedInfo.matQty = info.matQty; + inputValue.value = info.matQty; + popup.value.open(); + }; + const hidePopup = () => { + popup.value.close(); + }; + const saveData = () => { + if (inputValue.value == fixedInfo.matQty) { + uni.showToast({ + title: "本次修改未修改数量", + icon: "none", + duration: 1500 + }); + hidePopup(); + return; + } + if (inputValue.value < 0) { + uni.showToast({ + title: "您所输入的数量应该大于0!", + icon: "none", + duration: 1500 + }); + return; + } + if (inputValue.value == 0) { + uni.showToast({ + title: "数量为0,请使用删除功能!", + icon: "none", + duration: 1500 + }); + return; + } + var serverIPAndPort = getServerIPAndPort(); + uni.request({ + url: "http://" + serverIPAndPort + "/matDetailCurrenInfo/updateMatDetailCurrentInfoById", + // 请求的接口地址 + method: "POST", + // 设置请求方式为 POST + data: { + "matQty": inputValue.value, + "matDetailCurrentInfoId": fixedInfo.infoId, + "userName": getConfig("userName", "admin"), + "deviceType": "PDA" + }, + header: { + "Content-Type": "application/json" + // 如果需要以JSON格式发送数据 + }, + success: (res) => { + if (res.statusCode === 200) { + if (res.data.code == 200) { + uni.showToast({ + title: "修改成功!", + icon: "none", + duration: 1200 + }); + hidePopup(); + } else { + uni.showToast({ + title: "修改失败:" + res.data.message, + icon: "none", + duration: 2500 + }); + } + } else { + uni.showToast({ + title: "服务器返回错误状态码" + res.statusCode, + icon: "none", + duration: 2500 + }); + } + }, + fail: (err) => { + uni.showToast({ + title: "请求失败" + err, + icon: "none", + duration: 2500 + }); + this.clear(); + }, + complete: (event) => { + } + }); + }; + return { + fixedInfo, + popup, + inputValue, + showPopup, + hidePopup, + saveData + }; }, data() { return { - isNeedScanLocationCode: true, - isNeedCallShelfCode: true, - matBaseInfoId: null, - matCode: "", locationId: null, locationCode: "", - matCode: "", - matName: "", - matSpec: "", - matQty: 100, - //默认数量值 userName: "", //当前登录的用户名 recordCount: 0, @@ -1199,10 +2475,10 @@ if (uni.restoreGlobal) { this.userName = getConfig("userName", "admin"); const self = this; recive(function(res) { - formatAppLog("log", "at pages/queryBindList/queryBindList.vue:117", "Success:" + res.data); + formatAppLog("log", "at pages/queryBindList/queryBindList.vue:267", "Success:" + res.data); self.analysisScanCode(res.data); }, function(err) { - formatAppLog("log", "at pages/queryBindList/queryBindList.vue:120", "Error:", JSON.stringify(err)); + formatAppLog("log", "at pages/queryBindList/queryBindList.vue:270", "Error:", JSON.stringify(err)); }); }, methods: { @@ -1280,17 +2556,10 @@ if (uni.restoreGlobal) { this.clear(); }, complete: (event) => { - formatAppLog("log", "at pages/queryBindList/queryBindList.vue:284", "请求完成", event); + formatAppLog("log", "at pages/queryBindList/queryBindList.vue:362", "请求完成", event); } }); }, - bindSelectedMat: function(item) { - formatAppLog("log", "at pages/queryBindList/queryBindList.vue:292", "用户选择了项目:", item); - this.matCode = item.matCode; - this.matName = item.matName; - this.matSpec = item.matSpec; - this.matBaseInfoId = item.id; - }, queryMatList: function() { if (this.shelfCode == null || this.shelfCode == "") { uni.showToast({ @@ -1362,39 +2631,106 @@ if (uni.restoreGlobal) { this.clear(); }, complete: (event) => { - formatAppLog("log", "at pages/queryBindList/queryBindList.vue:379", "请求完成", event); + formatAppLog("log", "at pages/queryBindList/queryBindList.vue:449", "请求完成", event); } }); }, //清空当前界面所有内容 clear: function() { - this.locationId = null; - this.locationCode = ""; - this.shelfId = null; - this.shelfCode = ""; - this.isNeedCallShelfCode = true; - this.isNeedScanLocationCode = true; this.placeholderText = "请先扫描货架码"; + this.cardData = null; + this.recordCount = 0; }, - clearMatInfo: function() { - this.matCode = ""; - this.matName = ""; - this.matSpec = ""; - }, - handlePopupClose() { - formatAppLog("log", "at pages/queryBindList/queryBindList.vue:403", "弹出层已关闭"); + //长按 + longpress(item) { + this.showPopup(item); } } }; function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { - const _component_bindSelectMat = vue.resolveComponent("bindSelectMat"); + const _component_uni_popup = resolveEasycom(vue.resolveDynamicComponent("uni-popup"), __easycom_0); const _component_Card = vue.resolveComponent("Card"); return vue.openBlock(), vue.createElementBlock("view", { class: "bg-image" }, [ - vue.createVNode(_component_bindSelectMat, { - ref: "proup", - onClose: $options.handlePopupClose, - onSelected: $options.bindSelectedMat - }, null, 8, ["onClose", "onSelected"]), + vue.createVNode( + _component_uni_popup, + { + ref: "popup", + type: "dialog" + }, + { + default: vue.withCtx(() => [ + vue.createElementVNode("view", { class: "popup-content" }, [ + vue.createElementVNode("view", { class: "info-item" }, [ + vue.createElementVNode("label", null, "物料编码:"), + vue.createElementVNode( + "text", + null, + vue.toDisplayString($setup.fixedInfo.matCode), + 1 + /* TEXT */ + ) + ]), + vue.createElementVNode("view", { class: "info-item" }, [ + vue.createElementVNode("label", null, "物料名称:"), + vue.createElementVNode( + "text", + null, + vue.toDisplayString($setup.fixedInfo.matName), + 1 + /* TEXT */ + ) + ]), + vue.createElementVNode("view", { class: "info-item" }, [ + vue.createElementVNode("label", null, "物料规格:"), + vue.createElementVNode( + "text", + null, + vue.toDisplayString($setup.fixedInfo.matSpec), + 1 + /* TEXT */ + ) + ]), + vue.createElementVNode("view", { + class: "input-item", + style: { "background-color": "wheat" } + }, [ + vue.createElementVNode("label", null, "数量:"), + vue.withDirectives(vue.createElementVNode( + "input", + { + ref: "inputRef", + "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $setup.inputValue = $event), + type: "number", + placeholder: "输入数量" + }, + null, + 512 + /* NEED_PATCH */ + ), [ + [ + vue.vModelText, + $setup.inputValue, + void 0, + { number: true } + ] + ]) + ]), + vue.createElementVNode("view", { class: "button-group" }, [ + vue.createElementVNode("button", { + onClick: _cache[1] || (_cache[1] = (...args) => $setup.hidePopup && $setup.hidePopup(...args)) + }, "取消"), + vue.createElementVNode("button", { + onClick: _cache[2] || (_cache[2] = (...args) => $setup.saveData && $setup.saveData(...args)) + }, "保存") + ]) + ]) + ]), + _: 1 + /* STABLE */ + }, + 512 + /* NEED_PATCH */ + ), vue.createElementVNode("view", { class: "diy-flex-row" }, [ vue.createElementVNode("view", { style: { "flex": "3" } }, [ vue.createCommentVNode(" 占位 ") @@ -1419,8 +2755,8 @@ if (uni.restoreGlobal) { class: "uni-input", style: { "font-size": "50rpx", "padding": "10rpx" }, placeholder: $data.placeholderText, - "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.matCodeCondition = $event), - onBlur: _cache[1] || (_cache[1] = (...args) => $options.queryMatList && $options.queryMatList(...args)) + "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.matCodeCondition = $event), + onBlur: _cache[4] || (_cache[4] = (...args) => $options.queryMatList && $options.queryMatList(...args)) }, null, 40, ["placeholder"]), [ [vue.vModelText, $data.matCodeCondition] ]) @@ -1428,7 +2764,7 @@ if (uni.restoreGlobal) { vue.createElementVNode("view", { style: { "flex": "3" } }), vue.createElementVNode("view", { style: { "flex": "30" } }, [ vue.createElementVNode("button", { - onClick: _cache[2] || (_cache[2] = (...args) => $options.queryMatList && $options.queryMatList(...args)) + onClick: _cache[5] || (_cache[5] = (...args) => $options.queryMatList && $options.queryMatList(...args)) }, "查询") ]) ]) @@ -1472,13 +2808,16 @@ if (uni.restoreGlobal) { vue.Fragment, null, vue.renderList($data.cardData, (item, index) => { - return vue.openBlock(), vue.createElementBlock("view", { key: index }, [ + return vue.openBlock(), vue.createElementBlock("view", { + key: index, + onLongpress: ($event) => $options.longpress(item) + }, [ vue.createVNode(_component_Card, { item, currentIndex: index, cardData: $data.cardData }, null, 8, ["item", "currentIndex", "cardData"]) - ]); + ], 40, ["onLongpress"]); }), 128 /* KEYED_FRAGMENT */ diff --git a/WCS.BLL/Services/Service/MatDetailCurrentInfoService.cs b/WCS.BLL/Services/Service/MatDetailCurrentInfoService.cs index 8bd99ab..3fbbbf2 100644 --- a/WCS.BLL/Services/Service/MatDetailCurrentInfoService.cs +++ b/WCS.BLL/Services/Service/MatDetailCurrentInfoService.cs @@ -154,6 +154,8 @@ namespace WCS.BLL.Services.Service } } + + public async Task> deleteMatDetailCurrentInfo(DeleteInfosRequest request) { //先查询出具体的Id @@ -182,5 +184,7 @@ namespace WCS.BLL.Services.Service return response; } } + + } } diff --git a/WCS.Model/ApiModel/MatDetailCurrentInfo/UpdateMatDetailCurrentInfoByIdRequest.cs b/WCS.Model/ApiModel/MatDetailCurrentInfo/UpdateMatDetailCurrentInfoByIdRequest.cs new file mode 100644 index 0000000..736f786 --- /dev/null +++ b/WCS.Model/ApiModel/MatDetailCurrentInfo/UpdateMatDetailCurrentInfoByIdRequest.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace WCS.Model.ApiModel.MatDetailCurrentInfo +{ + public class UpdateMatDetailCurrentInfoByIdRequest : RequestBase + { + public int MatDetailCurrentInfoId { get; set; } + + public int MatQty { get; set; } + } +} diff --git a/WCS.WebApi/Controllers/MatDetailCurrenInfoController.cs b/WCS.WebApi/Controllers/MatDetailCurrenInfoController.cs index e6a2b71..f71f66e 100644 --- a/WCS.WebApi/Controllers/MatDetailCurrenInfoController.cs +++ b/WCS.WebApi/Controllers/MatDetailCurrenInfoController.cs @@ -6,6 +6,7 @@ using WCS.Model.ApiModel.StoreInfo; using WCS.BLL.DbModels; using WCS.Model.ApiModel.MatBaseInfo; using WCS.Model.ApiModel.MatDetailCurrentInfo; +using WCS.DAL.DbModels; namespace WCS.WebApi.Controllers { @@ -36,6 +37,22 @@ namespace WCS.WebApi.Controllers return await _matDetailCurrentInfoService.updateMatDetailCurrentInfo(request); } + [HttpPost("updateMatDetailCurrentInfoById")] + public async Task> updateMatDetailCurrentInfoById(UpdateMatDetailCurrentInfoByIdRequest request) + { + var transRequest = new AddLocaionInfoRequest() + { + UserName = request.UserName, + DeviceType = request.DeviceType, + LocationInfo = new MatDetailCurrentInfo() + { + Id = request.MatDetailCurrentInfoId, + MatQty = request.MatQty, + } + }; + return await _matDetailCurrentInfoService.updateMatDetailCurrentInfo(transRequest); + } + [HttpPost("deleteMatDetailCurrentInfo")] public async Task> deleteMatDetailCurrentInfo(DeleteInfosRequest request) {