(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["package1/index/orderDetail"],{ /***/ 493: /*!********************************************************************************!*\ !*** C:/文档/distribution-uni/main.js?{"page":"package1%2Findex%2ForderDetail"} ***! \********************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(wx, createPage) { var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4); __webpack_require__(/*! uni-pages */ 26); var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 25)); var _orderDetail = _interopRequireDefault(__webpack_require__(/*! ./package1/index/orderDetail.vue */ 494)); // @ts-ignore wx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__; createPage(_orderDetail.default); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["createPage"])) /***/ }), /***/ 494: /*!*************************************************************!*\ !*** C:/文档/distribution-uni/package1/index/orderDetail.vue ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _orderDetail_vue_vue_type_template_id_2555042c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./orderDetail.vue?vue&type=template&id=2555042c& */ 495); /* harmony import */ var _orderDetail_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./orderDetail.vue?vue&type=script&lang=js& */ 497); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _orderDetail_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _orderDetail_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /* harmony import */ var _orderDetail_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./orderDetail.vue?vue&type=style&index=0&lang=scss& */ 499); /* harmony import */ var _HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 38); var renderjs /* normalize component */ var component = Object(_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])( _orderDetail_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], _orderDetail_vue_vue_type_template_id_2555042c___WEBPACK_IMPORTED_MODULE_0__["render"], _orderDetail_vue_vue_type_template_id_2555042c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], false, null, null, null, false, _orderDetail_vue_vue_type_template_id_2555042c___WEBPACK_IMPORTED_MODULE_0__["components"], renderjs ) component.options.__file = "package1/index/orderDetail.vue" /* harmony default export */ __webpack_exports__["default"] = (component.exports); /***/ }), /***/ 495: /*!********************************************************************************************!*\ !*** C:/文档/distribution-uni/package1/index/orderDetail.vue?vue&type=template&id=2555042c& ***! \********************************************************************************************/ /*! exports provided: render, staticRenderFns, recyclableRender, components */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_orderDetail_vue_vue_type_template_id_2555042c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./orderDetail.vue?vue&type=template&id=2555042c& */ 496); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_orderDetail_vue_vue_type_template_id_2555042c___WEBPACK_IMPORTED_MODULE_0__["render"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_orderDetail_vue_vue_type_template_id_2555042c___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return _HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_orderDetail_vue_vue_type_template_id_2555042c___WEBPACK_IMPORTED_MODULE_0__["recyclableRender"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_17_0_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_orderDetail_vue_vue_type_template_id_2555042c___WEBPACK_IMPORTED_MODULE_0__["components"]; }); /***/ }), /***/ 496: /*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--17-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!C:/文档/distribution-uni/package1/index/orderDetail.vue?vue&type=template&id=2555042c& ***! \********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! exports provided: render, staticRenderFns, recyclableRender, components */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return recyclableRender; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; }); var components try { components = { cmdNavBar: function () { return __webpack_require__.e(/*! import() | components/cmd-nav-bar/cmd-nav-bar */ "components/cmd-nav-bar/cmd-nav-bar").then(__webpack_require__.bind(null, /*! @/components/cmd-nav-bar/cmd-nav-bar.vue */ 1026)) }, uNoticeBar: function () { return Promise.all(/*! import() | uni_modules/uview-ui/components/u-notice-bar/u-notice-bar */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u-notice-bar/u-notice-bar")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u-notice-bar/u-notice-bar.vue */ 1033)) }, uniCard: function () { return __webpack_require__.e(/*! import() | uni_modules/uni-card/components/uni-card/uni-card */ "uni_modules/uni-card/components/uni-card/uni-card").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-card/components/uni-card/uni-card.vue */ 1091)) }, uniDataSelect: function () { return Promise.all(/*! import() | uni_modules/uni-data-select/components/uni-data-select/uni-data-select */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-data-select/components/uni-data-select/uni-data-select")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue */ 1188)) }, uNumberBox: function () { return Promise.all(/*! import() | uni_modules/uview-ui/components/u-number-box/u-number-box */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u-number-box/u-number-box")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u-number-box/u-number-box.vue */ 1324)) }, uniTable: function () { return __webpack_require__.e(/*! import() | uni_modules/uni-table/components/uni-table/uni-table */ "uni_modules/uni-table/components/uni-table/uni-table").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-table/components/uni-table/uni-table.vue */ 1280)) }, uniTr: function () { return __webpack_require__.e(/*! import() | uni_modules/uni-table/components/uni-tr/uni-tr */ "uni_modules/uni-table/components/uni-tr/uni-tr").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-table/components/uni-tr/uni-tr.vue */ 1287)) }, uniTh: function () { return __webpack_require__.e(/*! import() | uni_modules/uni-table/components/uni-th/uni-th */ "uni_modules/uni-table/components/uni-th/uni-th").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-table/components/uni-th/uni-th.vue */ 1294)) }, uniTd: function () { return __webpack_require__.e(/*! import() | uni_modules/uni-table/components/uni-td/uni-td */ "uni_modules/uni-table/components/uni-td/uni-td").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-table/components/uni-td/uni-td.vue */ 1301)) }, uniTooltip: function () { return __webpack_require__.e(/*! import() | uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip */ "uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip.vue */ 1405)) }, uniEasyinput: function () { return __webpack_require__.e(/*! import() | uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput */ "uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue */ 1207)) }, uniDataCheckbox: function () { return Promise.all(/*! import() | uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox.vue */ 1256)) }, uPopup: function () { return Promise.all(/*! import() | uni_modules/uview-ui/components/u-popup/u-popup */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u-popup/u-popup")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u-popup/u-popup.vue */ 1412)) }, uniPopup: function () { return __webpack_require__.e(/*! import() | uni_modules/uni-popup/components/uni-popup/uni-popup */ "uni_modules/uni-popup/components/uni-popup/uni-popup").then(__webpack_require__.bind(null, /*! @/uni_modules/uni-popup/components/uni-popup/uni-popup.vue */ 1106)) }, uqrcode: function () { return Promise.all(/*! import() | uni_modules/Sansnn-uQRCode/components/uqrcode/uqrcode */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/Sansnn-uQRCode/components/uqrcode/uqrcode")]).then(__webpack_require__.bind(null, /*! @/uni_modules/Sansnn-uQRCode/components/uqrcode/uqrcode.vue */ 1270)) }, } } catch (e) { if ( e.message.indexOf("Cannot find module") !== -1 && e.message.indexOf(".vue") !== -1 ) { console.error(e.message) console.error("1. 排查组件名称拼写是否正确") console.error( "2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom" ) console.error( "3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件" ) } else { throw e } } var render = function () { var _vm = this var _h = _vm.$createElement var _c = _vm._self._c || _h var l1 = _vm.__map(_vm.list, function (item, index) { var $orig = _vm.__get_orig(item) var g0 = _vm.payType1 == "1" && _vm.shopId != "1960543009070256129" ? (item.productCount * item.discountAmount).toFixed(2) : null var g1 = _vm.payType1 == "1" && !(_vm.shopId != "1960543009070256129") ? (item.productCount * item.discountAmount).toFixed(2) : null var l0 = _vm.payType1 == "1" ? _vm.__map(item.stockLogList1, function (item1, index1) { var $orig = _vm.__get_orig(item1) var f0 = item1.productCount != 0 ? _vm._f("sliceMsg")(item1.attributeList) : null return { $orig: $orig, f0: f0, } }) : null return { $orig: $orig, g0: g0, g1: g1, l0: l0, } }) var l5 = _vm.__map(_vm.newData, function (item, index) { var $orig = _vm.__get_orig(item) var g2 = _vm.payType1 == "2" ? (item.productCount * item.discountAmount).toFixed(2) : null var l2 = _vm.payType1 == "2" ? _vm.__map(_vm.newData[index].sizeList, function (item1, index1) { var $orig = _vm.__get_orig(item1) var f1 = !( _vm.shopId != "1820269107191353344" && _vm.shopId != "1810179818189361152" ) ? _vm._f("sliceJun")(item1) : null return { $orig: $orig, f1: f1, } }) : null var l4 = _vm.payType1 == "2" ? _vm.__map( Array.from(_vm.newData[index].sizePrintList), function (value, key) { var $orig = _vm.__get_orig(value) var g3 = value[0].indexOf("退") var f2 = !( _vm.shopId != "1820269107191353344" && _vm.shopId != "1810179818189361152" ) ? _vm._f("sliceJun")(value[0]) : null var l3 = _vm.__map( _vm.newData[index].sizeList, function (item2, index2) { var $orig = _vm.__get_orig(item2) var g4 = value[1].get(item2) == undefined || (value[1].get(item2) != undefined && value[1].get(item2).split(":")[0] == undefined) var g5 = !g4 ? value[1].get(item2).split(":") : null return { $orig: $orig, g4: g4, g5: g5, } } ) return { $orig: $orig, g3: g3, f2: f2, l3: l3, } } ) : null return { $orig: $orig, g2: g2, l2: l2, l4: l4, } }) var l8 = _vm.__map(_vm.returnList, function (item, index) { var $orig = _vm.__get_orig(item) var l7 = _vm.payType1 == "1" ? _vm.__map(item.saleDetailDTOList, function (item1, index1) { var $orig = _vm.__get_orig(item1) var g6 = _vm.shopId != "1960543009070256129" ? (item1.productCount * item1.discountAmount).toFixed(2) : null var g7 = !(_vm.shopId != "1960543009070256129") ? (item1.productCount * item1.discountAmount).toFixed(2) : null var l6 = _vm.__map(item1.stockLogList1, function (item2, index2) { var $orig = _vm.__get_orig(item2) var f3 = item2.productCount != 0 ? _vm._f("sliceMsg")(item2.attributeList) : null return { $orig: $orig, f3: f3, } }) return { $orig: $orig, g6: g6, g7: g7, l6: l6, } }) : null return { $orig: $orig, l7: l7, } }) var l9 = _vm.payType1 == "0" ? _vm.__map(_vm.listHeng, function (item, index) { var $orig = _vm.__get_orig(item) var g8 = item.productSn.indexOf("退") var f4 = _vm._f("sliceMsg")(item.attributeList) var g9 = (item.discountAmount * item.productCount).toFixed(2) return { $orig: $orig, g8: g8, f4: f4, g9: g9, } }) : null var g10 = Math.abs(_vm.returnNum) var g11 = Math.abs(_vm.returnNum) var g12 = _vm.dealingsRecord.lastDebtAmount < 0 && !(_vm.dealingsRecord.lastDebtAmount == null) ? Math.abs(_vm.dealingsRecord.lastDebtAmount) : null var f5 = _vm._f("convertToChineseNumeral1")( _vm.sales.realAmount == null ? "暂无" : _vm.sales.realAmount ) var f6 = _vm._f("convertToChineseNumeral1")( _vm.sales.alreadyEarn == null ? "暂无" : _vm.sales.alreadyEarn ) var g13 = _vm.dealingsRecord.balanceDue < 0 && !(_vm.dealingsRecord.balanceDue == null) ? Math.abs(_vm.dealingsRecord.balanceDue) : null var f7 = _vm.sales.noEarn >= 0 ? _vm._f("convertToChineseNumeral1")( _vm.sales.noEarn == null ? "暂无" : _vm.sales.noEarn ) : null var g14 = _vm.sales.noEarn < 0 && !(_vm.sales.noEarn == null) ? Math.abs(_vm.sales.noEarn) : null var f8 = _vm.sales.noEarn < 0 ? _vm._f("convertToChineseNumeral1")( _vm.sales.noEarn == null ? "暂无" : Math.abs(_vm.sales.noEarn) ) : null var g15 = _vm.qrArr.length var g16 = _vm.newQRList.length _vm.$mp.data = Object.assign( {}, { $root: { l1: l1, l5: l5, l8: l8, l9: l9, g10: g10, g11: g11, g12: g12, f5: f5, f6: f6, g13: g13, f7: f7, g14: g14, f8: f8, g15: g15, g16: g16, }, } ) } var recyclableRender = false var staticRenderFns = [] render._withStripped = true /***/ }), /***/ 497: /*!**************************************************************************************!*\ !*** C:/文档/distribution-uni/package1/index/orderDetail.vue?vue&type=script&lang=js& ***! \**************************************************************************************/ /*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_orderDetail_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./orderDetail.vue?vue&type=script&lang=js& */ 498); /* harmony import */ var _HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_orderDetail_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_orderDetail_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_orderDetail_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_orderDetail_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /* harmony default export */ __webpack_exports__["default"] = (_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_13_1_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_orderDetail_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a); /***/ }), /***/ 498: /*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--13-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!C:/文档/distribution-uni/package1/index/orderDetail.vue?vue&type=script&lang=js& ***! \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(uni, wx) { var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ 13); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 28)); var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ 18)); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 30)); var _util = _interopRequireDefault(__webpack_require__(/*! @/components/kk-printer/utils/util.js */ 440)); var blesdk = _interopRequireWildcard(__webpack_require__(/*! @/components/kk-printer/utils/bluetoolth.js */ 441)); var _printUtilGBK = _interopRequireDefault(__webpack_require__(/*! @/components/kk-printer/utils/printUtil-GBK.js */ 474)); var _global = __webpack_require__(/*! @/utils/global.js */ 214); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // var kkPrinter = function kkPrinter() { Promise.all(/*! require.ensure | components/kk-printer/index */[__webpack_require__.e("common/vendor"), __webpack_require__.e("components/kk-printer/index")]).then((function () { return resolve(__webpack_require__(/*! @/components/kk-printer/index.vue */ 1398)); }).bind(null, __webpack_require__)).catch(__webpack_require__.oe); }; var cmdNavBar = function cmdNavBar() { __webpack_require__.e(/*! require.ensure | components/cmd-nav-bar/cmd-nav-bar */ "components/cmd-nav-bar/cmd-nav-bar").then((function () { return resolve(__webpack_require__(/*! @/components/cmd-nav-bar/cmd-nav-bar.vue */ 1026)); }).bind(null, __webpack_require__)).catch(__webpack_require__.oe); }; var _default = { data: function data() { return { enDayShow: false, textArr: ['您还未关注快衣店服务号,暂无法接收充值及上新提醒,点击关注'], FWHPic: 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/f2ba2080aaa54c618c2e47df4f220087.png', defaultText: '贴包单', radio1: 0, isSelfOrder: false, isshanglu: true, isSizeHeng: false, canvasshow: false, bigImg: [], shopId: uni.getStorageSync('shopId'), shopName: uni.getStorageSync('shopName'), QrUrl: '', //二维码临时存放 newQRList: [], // 生成的二维码临时路径的数组 newQRList1: [], // 生成的二维码临时路径的数组 qrCodeImage: '', swiperDotIndex: 0, sex: [{ text: '是', value: 0 }, { text: '否', value: 2 }], orderByWorkerCandidates: [], orderByWorker: '', bufferData: [], userType: uni.getStorageSync('type'), show: false, popupShow: false, shopAddress: uni.getStorageSync('shopAddress'), shopOwnerPhone: uni.getStorageSync('shopOwnerPhone'), shopRemark1: uni.getStorageSync('shopRemark'), businessDistrictLevel: "", sales: {}, dealingsRecord: {}, order: {}, list: [], newData: [], listHeng: [], lettrList: ['XS', 'S', 'M', 'L', 'XL', '2XL', 'XXL', '3XL', 'XXXL', '4XL', 'XXXXL', '5XL', 'XXXXXL', '6XL', 'XXXXXXL', '7XL', 'XXXXXXXL'], isReturn: false, orderByWorkerList: [], inventoryList: [], shopList: [], returnList: [], editNoPrice: false, newEarn: 0, shopRemark: [], fontsmailDcl: 0, isgys: true, printHeight: 0, myCanvasHeight: '', myCanvasWidth: '', isReturnPrice: 1, type: '', orderXd: [], collection: [], returnPrice: 0, shopMoblie: '', smailSize: 0, returnNum: 0, lbgName: [], returnAmount: 0, smailDcl: 1, shopData: [], changeA: '', sAmout: 0, yNum: 150, picOk: false, printingMethod: '0', printHeight1: 0, printWidth1: 0, printTotal: 1040, deviceType: 'ios', payType1: 1, payTypeList: [{ value: 1, text: "切换样式" }, { value: 1, text: "展示图片" }, { value: 0, text: "表格样式" }, { value: 2, text: "尺码横排" }], qrArr: [], isShare: false, isDownKH: false, userId: '', customId: "", needPushMsg: false, mini_program_openid: '', unionid: '', official_account_openid: '', zhengtizhekou: false, addressArr: [], jinjuPhone: '', //金桔家单独改成这个电话 modal_qr: false, qrCodeUrl: 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/8e305338798c4152a89e3351eaf6c84e.png' // 要生成的二维码值 }; }, components: { kkPrinter: kkPrinter, cmdNavBar: cmdNavBar }, computed: { changeAmount: function changeAmount() { if (this.isReturn) { var sum = 0; this.list.forEach(function (item1) { item1.stockLogList1.forEach(function (v) { if (v.returnCount) { sum = v.returnCount * item1.discountAmount + sum; } }); }); this.sAmout = sum.toFixed(2); //临时存储退货信息,用于用户删除了输入框值后重新赋值 this.returnAmount = sum.toFixed(2); return this.returnAmount; } else { return 0; } } }, filters: { sliceMsg: function sliceMsg(val) { var name = ''; if (typeof val == 'string') { var newObj = JSON.parse(val); for (var as in newObj) { name += newObj[as] + '/'; } } return name; }, sliceJun: function sliceJun(val) { var name = ''; if (typeof val == 'string') { name = val.replace(/均/g, '分'); } if (name == '分') { name = '分码'; } return name; }, maxNum: function maxNum(val) { if (val >= 10) { return 10; } else if (val < 0) { return 0; } }, // 金额转大写 convertToChineseNumeral1: function convertToChineseNumeral1(money) { var fu = false; if (money == 0) { return '零元整'; } if (JSON.stringify(money).indexOf('-') != -1) { money = JSON.stringify(money).split('-')[1]; fu = true; } var cnNums = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']; var cnIntRadice = ['', '拾', '佰', '仟']; var cnIntUnits = ['', '万', '亿', '兆']; var cnDecUnits = ['角', '分', '毫', '厘']; var cnInteger = '整'; var cnIntLast = '元'; var maxNum = 999999999999999.9999; var integerNum; var decimalNum; var chineseStr = ''; var parts; if (money == '') { return ''; } money = parseFloat(money); if (money >= maxNum) { return ''; } if (money == 0) { chineseStr = cnNums[0] + cnIntLast + cnInteger; return chineseStr; } money = money.toString(); if (money.indexOf('.') == -1) { integerNum = money; decimalNum = ''; } else { parts = money.split('.'); integerNum = parts[0]; decimalNum = parts[1].substr(0, 4); } if (parseInt(integerNum, 10) > 0) { var zeroCount = 0; var IntLen = integerNum.length; for (var i = 0; i < IntLen; i++) { var n = integerNum.substr(i, 1); var p = IntLen - i - 1; var q = p / 4; var m = p % 4; if (n == '0') { zeroCount++; } else { if (zeroCount > 0) { chineseStr += cnNums[0]; } zeroCount = 0; chineseStr += cnNums[parseInt(n)] + cnIntRadice[m]; } if (m == 0 && zeroCount < 4) { chineseStr += cnIntUnits[q]; } } chineseStr += cnIntLast; } if (decimalNum != '') { var decLen = decimalNum.length; for (var _i = 0; _i < decLen; _i++) { var _n = decimalNum.substr(_i, 1); if (_n != '0') { chineseStr += cnNums[Number(_n)] + cnDecUnits[_i]; } } } if (chineseStr == '') { chineseStr += cnNums[0] + cnIntLast + cnInteger; } else if (decimalNum == '') { chineseStr += cnInteger; } if (fu == true) { chineseStr = '负' + chineseStr; } return chineseStr; } }, onShareAppMessage: function onShareAppMessage() { var _this2 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { var titleText, imageUrl; return _regenerator.default.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: //禁止转发 // wx.updateShareMenu({ // isPrivateMessage: true, // success () { }, // fail () {} // }) titleText = _this2.shopName + ' ' + _this2.sales.createTime.split(' ')[0] + '\n销售单'; _context.next = 3; return _this2.senrPath(); case 3: imageUrl = _context.sent; return _context.abrupt("return", { title: titleText, imageUrl: imageUrl, path: '/package1/index/orderDetail?popleType=khName&id=' + _this2.sales.id + '&shopId=' + uni.getStorageSync('shopId') + '&shopName=' + _this2.shopName + '&shopOwnerPhone=' + _this2.shopOwnerPhone + '&mini_program_openid=' + _this2.order.miniProgramOpenid + '&unionid=' + _this2.order.unionid + '&official_account_openid=' + _this2.order.officialAccountOpenid + '&customId=' + _this2.order.id + '&userId=' + _this2.order.userId }); case 5: case "end": return _context.stop(); } } }, _callee); }))(); }, onShow: function onShow() { var that = this; // 初始化蓝牙模块 wx.openBluetoothAdapter({ mode: 'central' }); uni.authorize({ scope: 'scope.writePhotosAlbum', success: function success() {}, fail: function fail() { this.tui.toast("您未授权,图片上传功能可能会出现错误"); } }); if (this.isDownKH) { this.getUserInfo(); } if (uni.getStorageSync('shopName').indexOf('杰娜世家') != -1) { this.payType1 = "2"; } this.lbgName = JSON.parse(JSON.stringify(this.lbgName)); }, onLoad: function onLoad(option) { var _this3 = this; var that = this; //isDownKH 是否为下游客户登录 if (option.shopId && option.shopId != uni.getStorageSync('shopId')) { this.isDownKH = true; } else { this.isSelfOrder = true; } if (option.needPushMsg) { this.needPushMsg = option.needPushMsg; } this.saleId = option.id; this.userId = option.userId; this.customId = option.customId; this.isShare = option.shopId ? true : false; this.mini_program_openid = option.mini_program_openid; if (option.id != null && option.id != undefined && option.id != "") { if (option.type == 'gys') { this.type = option.type; this.tui.request("/app/purchase/getPurchaseAllData", "post", { id: option.id }, false, true).then(function (res) { if (res.code == 200) { _this3.isgys = false; _this3.sales = res.result.purchase; _this3.list = res.result.purchaseDetails; } else { _this3.tui.toast(res.message); } }).catch(function (res) {}); } else { this.tui.request("/app/sale/get/" + option.id, "GET", { customerId: this.customId }, false, false).then(function (res) { if (res.code == 200 && res.result != null && res.result != undefined) { if (res.result.sale.status == '2') { that.tui.toast('该订单已撤销'); } _this3.order = res.result.customer; if (_this3.isDownKH == true && res.result.customer.name != '散客') { /* 微信登录判断开始 */ _this3.contrastOpneId(); /* 微信登录判断结束 */ } else if (res.result.customer.name == '散客') { _this3.isSelfOrder = true; } _this3.sales = res.result.sale; //推送开单通知 if (that.needPushMsg == 'true' && res.result.customer.officialAccountOpenid != null) { var content = { thing4: res.result.sale.shopName, //店铺名称 time3: res.result.sale.createTime, //充值时间 thing5: res.result.sale.userName, //顾客姓名 amount1: res.result.sale.totalAmount //充值金额 }; that.tui.request("/social/wechat/sendWechatTempMessage", "post", { tempId: 'xAoOMfWdnT8pwfj_OOskJGKQHVU-8_AYwx1A5I5wBTM', title: '新订单通知', content: JSON.stringify(content), pagePath: '/package1/index/orderDetail?popleType=khName&id=' + that.sales.id + '&shopId=' + uni.getStorageSync('shopId') + '&shopName=' + that.shopName + '&shopOwnerPhone=' + that.shopOwnerPhone + '&mini_program_openid=' + that.order.miniProgramOpenid + '&unionid=' + that.order.unionid + '&official_account_openid=' + that.order.officialAccountOpenid + '&customId=' + that.order.id + '&userId=' + that.order.userId, upNewType: "", userId: res.result.customer.userId, categoryId: "" }, false, false).then(function (res11) { if (res11.code == 200) {} else { that.tui.toast(res11.message); } }).catch(function (res) {}); } if (res.result.sale.status == "7") { _this3.isShare = true; } if (res.result.dealingsRecord != null) { _this3.dealingsRecord = res.result.dealingsRecord; } if (res.result.sale.discount != null && res.result.sale.discount < 10) { //判断订单是否有折扣,整体折扣和单品折扣,都变为true _this3.zhengtizhekou = true; } _this3.list = res.result.saleDetailDTOList; _this3.getChildrenPic(); for (var i = 0; i < that.list.length; i++) { if (that.list[i].realPrice != '' && that.list[i].discountAmount == null) { that.list[i].discountAmount = that.list[i].realPrice; } if (res.result.sale.discount < 10) { _this3.list[i].printDiscount = res.result.sale.discount; } else if (that.list[i].discount < 10) { _this3.zhengtizhekou = true; _this3.list[i].printDiscount = that.list[i].discount; } else { _this3.list[i].printDiscount = ''; } var isZiMu = false; var isNumber = false; var colorList = new Map(); var sizeNumList = []; var notNum = []; if (that.list[i].stockLogList1.length > 0) { for (var m = 0; m < that.list[i].stockLogList1.length; m++) { var attr = that.list[i].stockLogList1[m].attributeList; var newObj = JSON.parse(attr); for (var as in newObj) { if (as == '尺码' && that.isLetterOrDigit(newObj[as].replace(/码/g, '')) == 'Letter') { isZiMu = true; } if (as == '尺码' && that.isLetterOrDigit(newObj[as].replace(/码/g, '')) == 'Digit') { isNumber = true; } if (as == '尺码' && sizeNumList.indexOf(newObj[as].replace(/码/g, '')) == -1) { if (as == '尺码' && that.isLetterOrDigit(newObj[as].replace(/码/g, '')) == 'Digit') { sizeNumList.push(newObj[as].replace(/码/g, '')); } else { if (notNum.indexOf(newObj[as].replace(/码/g, '')) == -1) { notNum.push(newObj[as].replace(/码/g, '')); } } } if (as == '颜色') { if (colorList.has(newObj[as])) { colorList.get(newObj[as]).push(that.list[i].stockLogList1[m]); } else { var listChild = []; listChild.push(that.list[i].stockLogList1[m]); colorList.set(newObj[as], listChild); } } } } } if (notNum.length > 0) { sizeNumList = sizeNumList.concat(notNum); } var newStockList = []; if (isNumber) { sizeNumList = sizeNumList.sort(function (a, b) { return a - b; }); colorList.forEach(function (value, key) { for (var j = 0; j < sizeNumList.length; j++) { for (var m = 0; m < value.length; m++) { var newObj = JSON.parse(value[m].attributeList); var size = ''; var color = ''; for (var as in newObj) { if (as == '尺码') { size = newObj[as].replace(/码/g, ''); } } if (size == sizeNumList[j]) { newStockList.push(value[m]); value.splice(m, 1); break; } } } if (value.length > 0) { newStockList = newStockList.concat(value); } }); that.list[i].stockLogList1 = newStockList; } if (isZiMu) { colorList.forEach(function (value, key) { for (var j = 0; j < that.lettrList.length; j++) { for (var m = 0; m < value.length; m++) { var newObj = JSON.parse(value[m].attributeList); var size = ''; var color = ''; for (var as in newObj) { if (as == '尺码') { size = newObj[as].replace(/码/g, ''); } } if (size == that.lettrList[j]) { newStockList.push(value[m]); value.splice(m, 1); break; } } } if (value.length > 0) { newStockList = newStockList.concat(value); } }); that.list[i].stockLogList1 = newStockList; } for (var m = 0; m < _this3.list[i].stockLogList1.length; m++) { if (_this3.list[i].productCount == null) { _this3.list[i].productCount = _this3.list[i].stockLogList1[m].productCount; } else { _this3.list[i].productCount += _this3.list[i].stockLogList1[m].productCount; } var hasBuy = ''; if (_this3.list[i].stockLogList1[m].isPurchasedBefore == 0 || _this3.list[i].stockLogList1[m].isPurchasedBefore == 1 && _this3.sales.userName == '散客') { hasBuy = '【销】'; } if (_this3.list[i].stockLogList1[m].isPurchasedBefore == 1 && _this3.sales.userName != '散客') { hasBuy = '【补】'; } var tableData = { productSn: hasBuy + _this3.list[i].productSn, productName: _this3.list[i].productName, productCount: _this3.list[i].stockLogList1[m].productCount, attributeList: _this3.list[i].stockLogList1[m].attributeList, discountAmount: _this3.list[i].discountAmount }; that.listHeng.push(tableData); } _this3.list[i].chengben = _this3.list[i].productCount * _this3.list[i].purchasePrice; } _this3.newData = JSON.parse(JSON.stringify(_this3.list)); _this3.orderXd = res.result.orderXd; _this3.shopData = res.result.shop; _this3.splitTextIntoChunks(res.result.shop.shopAddress, 30); _this3.getReturnOrder(option.id); } else { if (res.code == 500 && res.message == 'java.lang.NullPointerException') { _this3.tui.toast('该订单已撤销,无法查看'); } else { _this3.tui.toast(res.message); } } }).catch(function (res) {}); } } this.shopOwnerPhone = option.shopOwnerPhone ? option.shopOwnerPhone : uni.getStorageSync('shopOwnerPhone'); this.shopId = option.shopId != '' && option.shopId != undefined ? option.shopId : uni.getStorageSync('shopId') != '' && uni.getStorageSync('shopId') != undefined ? uni.getStorageSync('shopId') : ""; this.shopName = option.shopName ? option.shopName : uni.getStorageSync('shopName'); uni.getSystemInfo({ success: function success(res) { that.deviceType = res.osName; } }); uni.setNavigationBarTitle({ title: this.shopName }); if (option.oneShareData) { this.isShare = true; this.shopAddress = JSON.parse(option.oneShareData).shopAddress; this.shopMoblie = JSON.parse(option.oneShareData).shopMoblie || ''; } else { this.analysisQrCode(); } /* setTimeout(ress=>{ this.getData() },4000) */ }, methods: { // 金额转大写 convertToChineseNumeral: function convertToChineseNumeral(money) { var fu = false; if (money == 0) { return '零元整'; } if (JSON.stringify(money).indexOf('-') != -1) { money = JSON.stringify(money).split('-')[1]; fu = true; } var cnNums = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']; var cnIntRadice = ['', '拾', '佰', '仟']; var cnIntUnits = ['', '万', '亿', '兆']; var cnDecUnits = ['角', '分', '毫', '厘']; var cnInteger = '整'; var cnIntLast = '元'; var maxNum = 999999999999999.9999; var integerNum; var decimalNum; var chineseStr = ''; var parts; if (money == '') { return ''; } money = parseFloat(money); if (money >= maxNum) { return ''; } if (money == 0) { chineseStr = cnNums[0] + cnIntLast + cnInteger; return chineseStr; } money = money.toString(); if (money.indexOf('.') == -1) { integerNum = money; decimalNum = ''; } else { parts = money.split('.'); integerNum = parts[0]; decimalNum = parts[1].substr(0, 4); } if (parseInt(integerNum, 10) > 0) { var zeroCount = 0; var IntLen = integerNum.length; for (var i = 0; i < IntLen; i++) { var n = integerNum.substr(i, 1); var p = IntLen - i - 1; var q = p / 4; var m = p % 4; if (n == '0') { zeroCount++; } else { if (zeroCount > 0) { chineseStr += cnNums[0]; } zeroCount = 0; chineseStr += cnNums[parseInt(n)] + cnIntRadice[m]; } if (m == 0 && zeroCount < 4) { chineseStr += cnIntUnits[q]; } } chineseStr += cnIntLast; } if (decimalNum != '') { var decLen = decimalNum.length; for (var _i2 = 0; _i2 < decLen; _i2++) { var _n2 = decimalNum.substr(_i2, 1); if (_n2 != '0') { chineseStr += cnNums[Number(_n2)] + cnDecUnits[_i2]; } } } if (chineseStr == '') { chineseStr += cnNums[0] + cnIntLast + cnInteger; } else if (decimalNum == '') { chineseStr += cnInteger; } if (fu == true) { chineseStr = '负' + chineseStr; } return chineseStr; }, //更新配货状态 changePeiHuo: function changePeiHuo() { var that = this; uni.showModal({ title: "提示", content: '要将该订单状态改为配货完成吗?', success: function success(res) { if (res.confirm) { that.tui.request("/app/sale/updateDistributionFlag", "post", { saleId: that.sales.id, distributionFlag: '1' }, false, true).then(function (res) { if (res.code == 200) { uni.showToast({ duration: 1000, title: "更改成功", mask: true }); setTimeout(function (res) { var pages = getCurrentPages(); var prevPage = pages[pages.length - 2]; for (var i = 0; i < prevPage.$vm.inventoryList.length; i++) { if (prevPage.$vm.inventoryList[i].id == that.sales.id) { prevPage.$vm.inventoryList[i].distributionFlag = '1'; } } uni.navigateBack({ delta: 1 }); }, 1000); } else { that.tui.toast(res.message); } }).catch(function (res) {}); } } }); }, contrastOpneId: function contrastOpneId() { var _this4 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() { var openid1, openid2; return _regenerator.default.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: openid1 = uni.getStorageSync('miniProgramOpenid'); openid2 = _this4.mini_program_openid; if (!(openid1 != '' && openid1 != undefined && openid1 != null)) { _context2.next = 6; break; } if (openid2 != undefined && openid2 != "undefined" && openid2 != 'null' && openid2 != '' && openid2 != null) { if (openid1 != openid2) { //缓存和分享的openid不一致 // this.tui.toast('暂无查看权限', 1000) // return } else { _this4.isSelfOrder = true; _this4.$forceUpdate(); } } else { //调接口传customId更新userid _this4.updateUserId(); _this4.isSelfOrder = true; _this4.$forceUpdate(); } _context2.next = 11; break; case 6: if (uni.getStorageSync('shopId')) { _context2.next = 9; break; } _context2.next = 9; return _this4.getOpenId(_this4.customId, uni.getStorageSync('id') ? uni.getStorageSync('id') : _this4.userId); case 9: openid1 = uni.getStorageSync('miniProgramOpenid'); if (openid2 != undefined && openid2 != "undefined" && openid2 != 'null' && openid2 != '' && openid2 != null) { if (openid1 != openid2) { //缓存和分享的openid不一致 // this.tui.toast('暂无查看权限', 1000) // return } else { _this4.isSelfOrder = true; _this4.$forceUpdate(); } } else { //调接口传customId更新userid _this4.updateUserId(); _this4.isSelfOrder = true; _this4.$forceUpdate(); } case 11: case "end": return _context2.stop(); } } }, _callee2); }))(); }, updateUserId: function updateUserId() { var _this5 = this; this.tui.request("/app/customer/updateUserId", "post", { customerId: this.customId, userId: uni.getStorageSync('id') }, false, true).then(function (res) { if (res.code != 200) { _this5.tui.toast(res.message); } }).catch(function (res) {}); }, getUserInfo: function getUserInfo() { var _this6 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() { return _regenerator.default.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: _this6.tui.request("/user/getUserInfo", "post", { miniProgramOpenid: uni.getStorageSync('miniProgramOpenid') }, false, true).then(function (res) { if (res.code == 200) { if (res.result.officialAccountOpenid == 'null' || res.result.officialAccountOpenid == null || res.result.officialAccountOpenid == undefined || res.result.officialAccountOpenid == '') { _this6.enDayShow = true; } else { uni.setStorageSync('officialAccountOpenid', res.result.officialAccountOpenid); _this6.enDayShow = false; } } }).catch(function (err) {}); case 1: case "end": return _context3.stop(); } } }, _callee3); }))(); }, //获取小程序openid getOpenId: function getOpenId(customId, userId) { var that = this; return new Promise(function (resolve, reject) { uni.login({ provider: 'weixin', success: function success(res) { uni.getUserInfo({ provider: 'weixin', success: function success(infoRes) { var _this7 = this; that.tui.request("/user/login", "post", { jsCode: res.code, customId: customId, userId: userId, wechatName: infoRes.userInfo.nickName, userType: "2" }, false, false).then(function (res) { if (res.code == 200) { uni.setStorageSync("hiver_token", res.result.accessToken); uni.setStorageSync("wayValue", "2"); uni.setStorageSync("nickname", res.result.user.nickname); uni.setStorageSync("id", res.result.user.id); uni.setStorageSync('unionid', res.result.user.unionid); uni.setStorageSync('miniProgramOpenid', res.result.user.miniProgramOpenid); uni.setStorageSync('officialAccountOpenid', res.result.user.officialAccountOpenid); if ((res.result.user.officialAccountOpenid == 'null' || res.result.user.officialAccountOpenid == null || res.result.user.officialAccountOpenid == undefined || res.result.user.officialAccountOpenid == '') && _this7.order.name != '散客') { that.enDayShow = true; that.$forceUpdate(); } return resolve(res.result); } else { that.tui.toast(res.message); } }).catch(function (res) {}); }, fail: function fail(err1) {} }); }, fail: function fail(err) {} }); }); }, // 展示二维码 showQrcode: function showQrcode() { for (var i = 0; i < _this.$refs.qrcodePopup.length; i++) { _this.$refs.qrcodePopup[i].crtQrCode(); } }, senrPath: function senrPath() { var _this8 = this; return new Promise( /*#__PURE__*/function () { var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(resolve, reject) { var that, ctx, imgA; return _regenerator.default.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: that = _this8; uni.showLoading({ title: '生成中...' }); ctx = uni.createCanvasContext('myCanvas1', _this8); //背景图 imgA = 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/38568f1580bc423698d2a499197a5b44.png'; uni.downloadFile({ url: imgA, success: function success(res2) { if (res2.statusCode === 200) { // // 绘制第一张图片 ctx.drawImage(res2.tempFilePath, 0, 0, 1515, 1210); ctx.draw(true); // 设置字体样式 ctx.font = 'bold 80px SimSun'; // 设置文字颜色 ctx.fillStyle = '#FF5809'; var beginHeight = 450; if (that.sales.productCount != null && that.sales.productCount != '') { var textWidth = 350; // 计算居中位置 beginHeight += 100; // 绘制文字 ctx.fillText('销售', textWidth, beginHeight); ctx.draw(true); // 设置字体样式 ctx.font = 'bold 60px SimSun'; // 设置文字颜色 ctx.fillStyle = '#FF5809'; beginHeight += 90; var text = '总件数:' + that.sales.productCount + ' 总金额:' + that.sales.totalAmount; // 绘制文字 ctx.fillText(text, textWidth, beginHeight); ctx.draw(true); } if (that.returnNum != null && that.returnNum != '') { beginHeight += 110; var textWidth = 350; // 绘制文字 // 设置字体样式 ctx.font = 'bold 80px SimSun'; // 设置文字颜色 ctx.fillStyle = '#FF5809'; ctx.fillText('退货', textWidth, beginHeight); ctx.draw(true); beginHeight += 90; // 设置字体样式 ctx.font = 'bold 60px SimSun'; // 设置文字颜色 ctx.fillStyle = '#FF5809'; var text = '总件数:' + that.returnNum + ' 总金额:' + that.returnPrice; // 绘制文字 ctx.fillText(text, textWidth, beginHeight); ctx.draw(true); } if (that.sales.realAmount != null) { var textWidth = 350; beginHeight += 120; // 绘制文字 // 设置字体样式 ctx.font = 'bold 80px SimSun'; // 设置文字颜色 ctx.fillStyle = 'black'; ctx.fillText('本单应收:' + that.sales.realAmount, textWidth, beginHeight); ctx.draw(true); } if (that.sales.alreadyEarn != null) { beginHeight += 100; var textWidth = 350; // 绘制文字 // 设置字体样式 ctx.font = 'bold 80px SimSun'; // 设置文字颜色 ctx.fillStyle = 'black'; ctx.fillText('本单实收:' + that.sales.alreadyEarn, textWidth, beginHeight); ctx.draw(true); beginHeight += 120; } setTimeout(function (ress) { uni.canvasToTempFilePath({ x: 0, y: 0, width: 1515, height: 1210, destWidth: 1515, destHeight: 1210, canvasId: 'myCanvas1', success: function success(res3) { uni.hideLoading(); return resolve(res3.tempFilePath); } }); }, 500); } } }); case 5: case "end": return _context4.stop(); } } }, _callee4); })); return function (_x, _x2) { return _ref.apply(this, arguments); }; }()); }, returnRealSize: function returnRealSize(size) { if (this.smailDcl >= 1) { return Number((size / this.smailDcl).toFixed(2)); } else { return size; } }, returnFontSize: function returnFontSize(size) { return Number((size / this.smailDcl).toFixed(0)) - 1; }, getData: function getData() { var _this9 = this; var that = this; if (that.picOk) { uni.showLoading({ title: '图片绘制中...' }); } else { this.tui.toast('账单生成中...'); return; } var dataHeight = that.printHeight1; this.canvasshow = true; var ctx = uni.createCanvasContext('myCanvas', this); ctx.fillStyle = "#FFFFFF"; ctx.fillRect(0, 0, that.printWidth1, dataHeight); //店铺名 // 设置字体样式 ctx.font = 'bold ' + that.returnFontSize(150) + 'px SimSun'; // 设置文字颜色 ctx.fillStyle = 'black'; var text = this.shopName + ' 销售单'; var textWidth = ctx.measureText(text).width; // 计算居中位置 var x = (that.printWidth1 - textWidth) / 2; // 绘制文字 ctx.fillText(text, x, that.returnRealSize(300)); ctx.draw(true); // 设置字体样式 ctx.font = 'bold ' + that.returnFontSize(60) + 'px SimSun'; // 设置文字颜色 ctx.fillStyle = 'black'; // 客户 ctx.fillText('客户:' + (that.shopId == '1863043415453863936' && that.order.name == '散客' ? '客户' : that.order.name ? that.order.name : '散客'), that.returnRealSize(20), that.returnRealSize(500)); ctx.fillText('单号:' + that.sales.id, that.returnRealSize(1450), that.returnRealSize(500)); // 销售员 ctx.fillText('销售员:' + that.sales.createByName, that.returnRealSize(20), that.returnRealSize(600)); ctx.fillText('日期:' + that.sales.createTime, that.returnRealSize(1450), that.returnRealSize(600)); // 横线 ctx.fillText('-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------', that.returnRealSize(20), that.returnRealSize(700)); // 数据 if (this.printingMethod == '0' || this.printingMethod == '2') { ctx.fillText('货号(名称)', that.returnRealSize(20), that.returnRealSize(800)); ctx.fillText('规格', that.returnRealSize(1040), that.returnRealSize(800)); ctx.fillText('数量', that.returnRealSize(1590), that.returnRealSize(800)); if (that.shopId == '1960543009070256129') { ctx.fillText('直播价', that.returnRealSize(1875), that.returnRealSize(800)); } else { ctx.fillText('单价', that.returnRealSize(1875), that.returnRealSize(800)); } ctx.fillText('总价', that.returnRealSize(2140), that.returnRealSize(800)); // 横线 ctx.fillText('-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------', that.returnRealSize(20), that.returnRealSize(900)); } var dataheigth = that.returnRealSize(700); var dataheigth1 = that.returnRealSize(900); var moretime = 0; var Xindex = 0; for (var i = 0; i < that.newData.length; i++) { if (this.printingMethod == '1') { moretime += 140; dataheigth += that.returnRealSize(100); //货号 if (that.newData[i].productName == that.newData[i].productSn) { ctx.fillText(that.newData[i].productSn, that.returnRealSize(20), dataheigth); } else { ctx.fillText(that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')', that.returnRealSize(20), dataheigth); } dataheigth += that.returnRealSize(100); //尺码头 ctx.fillText('颜色', that.returnRealSize(20), dataheigth); var startWith = that.returnRealSize(450); for (var a = 0; a < that.newData[i].sizeList.length; a++) { if ((that.shopId == '1820269107191353344' || that.shopId == '1810179818189361152') && that.newData[i].sizeList[a] == '均') { that.newData[i].sizeList[a] = '分码'; } ctx.fillText(that.newData[i].sizeList[a], startWith, dataheigth); startWith += Math.floor(that.returnRealSize(1250) / 8); } ctx.fillText('数量', that.returnRealSize(1700), dataheigth); if (that.shopId == '1960543009070256129') { ctx.fillText('直播价', that.returnRealSize(1950), dataheigth); } else { ctx.fillText('单价', that.returnRealSize(1950), dataheigth); } ctx.fillText('总价', that.returnRealSize(2200), dataheigth); var begin = 0; that.newData[i].sizePrintList.forEach(function (value, key) { moretime += 70; dataheigth += that.returnRealSize(100); if ((that.shopId == '1820269107191353344' || that.shopId == '1810179818189361152') && key == '均色') { key = '分色'; } ctx.fillText(key, that.returnRealSize(20), dataheigth); var childStartWith = that.returnRealSize(450); var allCount = 0; var discountAmount = 0; for (var _a = 0; _a < that.newData[i].sizeList.length; _a++) { var printSizeCount = []; if (that.newData[i].sizeList[_a] == '分码') { that.newData[i].sizeList[_a] = '均'; } if (value.has(that.newData[i].sizeList[_a])) { printSizeCount = value.get(that.newData[i].sizeList[_a]).split(':'); discountAmount = printSizeCount[1] == undefined ? '' : printSizeCount[1]; } allCount += printSizeCount[0] == undefined ? 0 : Number(printSizeCount[0]); that.newData[i].allCount = allCount; ctx.fillText(printSizeCount[0] == undefined ? '' : Number(printSizeCount[0]), childStartWith, dataheigth); childStartWith += Math.floor(that.returnRealSize(1250) / 8); } ctx.fillText(allCount, that.returnRealSize(1700), dataheigth); ctx.fillText(discountAmount, that.returnRealSize(1950), dataheigth); ctx.fillText(allCount * discountAmount, that.returnRealSize(2200), dataheigth); }); // 横线 ctx.fillText('-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------', that.returnRealSize(20), dataheigth += that.returnRealSize(100)); } else { for (var m = 0; m < that.newData[i].stockLogList1.length; m++) { moretime += 80; dataheigth1 += that.returnRealSize(100); if (that.newData[i].stockLogList1[m].isReturn) { if (that.newData[i].productName == that.newData[i].productSn) { ctx.fillText((Xindex += 1) + '.' + '【退】' + that.newData[i].productSn, that.returnRealSize(20), dataheigth1); } else { ctx.fillText((Xindex += 1) + '.' + '【退】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')', that.returnRealSize(20), dataheigth1); } } else { if (that.newData[i].productName == that.newData[i].productSn && that.order.name != '散客') { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1) { //买过 ctx.fillText((Xindex += 1) + '.' + '【补】' + that.newData[i].productSn, that.returnRealSize(20), dataheigth1); } else { // 0是没买过 ctx.fillText((Xindex += 1) + '.' + '【销】' + that.newData[i].productSn, that.returnRealSize(20), dataheigth1); } } else { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != '散客') { //买过 ctx.fillText((Xindex += 1) + '.' + '【补】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')', that.returnRealSize(20), dataheigth1); } else { // 0是没买过 ctx.fillText((Xindex += 1) + '.' + '【销】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')', that.returnRealSize(20), dataheigth1); } } } if (that.shopId == '1820269107191353344' || that.shopId == '1810179818189361152') { if (that.newData[i].stockLogList1[m].attributeList.indexOf('均色') != -1) { that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m].attributeList.replace(/均色/g, '分色'); } if (that.newData[i].stockLogList1[m].attributeList.indexOf('均码') != -1) { that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m].attributeList.replace(/均码/g, '分码'); } } ctx.fillText(that.slicePrint(that.newData[i].stockLogList1[m].attributeList), that.returnRealSize(1040), dataheigth1); ctx.fillText(that.newData[i].stockLogList1[m].productCount, that.returnRealSize(1590), dataheigth1); if (that.newData[i].stockLogList1[m].isReturn) { ctx.fillText(that.newData[i].stockLogList1[m].discountAmount, that.returnRealSize(1875), dataheigth1); ctx.fillText(that.newData[i].stockLogList1[m].discountAmount * that.newData[i].stockLogList1[m].productCount, that.returnRealSize(2140), dataheigth1); } else { ctx.fillText(that.newData[i].discountAmount, that.returnRealSize(1875), dataheigth1); ctx.fillText(that.newData[i].discountAmount * that.newData[i].stockLogList1[m].productCount, that.returnRealSize(2140), dataheigth1); } // 横线 ctx.fillText('-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------', that.returnRealSize(20), dataheigth1 += that.returnRealSize(100)); } } } var lastHeight = 0; if (this.printingMethod == '1') { lastHeight = dataheigth; } else { lastHeight = dataheigth1; } ctx.fillText('合计:', that.returnRealSize(20), lastHeight += that.returnRealSize(100)); ctx.fillText(that.sales.productCount + '件', that.returnRealSize(1700), lastHeight); ctx.fillText(that.sales.totalAmount, that.returnRealSize(2200), lastHeight); ctx.fillText('-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------', that.returnRealSize(20), lastHeight += that.returnRealSize(100)); ctx.draw(true); // 设置字体样式 ctx.font = 'bold ' + that.returnFontSize(70) + 'px SimSun'; // 设置文字颜色 ctx.fillStyle = 'black'; ctx.fillText('本单应收:' + that.sales.realAmount + '(' + this.convertToChineseNumeral(that.sales.realAmount) + ')', that.returnRealSize(20), lastHeight += that.returnRealSize(100)); if (that.dealingsRecord.lastDebtAmount >= 0) { ctx.fillText('之前欠款:' + that.dealingsRecord.lastDebtAmount, that.returnRealSize(1700), lastHeight); } else if (that.dealingsRecord.lastDebtAmount < 0) { ctx.fillText('之前余额:' + Math.abs(that.dealingsRecord.lastDebtAmount), that.returnRealSize(1700), lastHeight); } else { ctx.fillText('之前欠款:0', that.returnRealSize(1700), lastHeight); } ctx.fillText('-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------', that.returnRealSize(20), lastHeight += that.returnRealSize(100)); ctx.fillText('本单实收:' + that.sales.alreadyEarn + '(' + this.convertToChineseNumeral(that.sales.alreadyEarn) + ')', that.returnRealSize(20), lastHeight += that.returnRealSize(100)); if (that.dealingsRecord.balanceDue >= 0) { ctx.fillText('累计欠款:' + that.dealingsRecord.balanceDue, that.returnRealSize(1700), lastHeight); } else if (that.dealingsRecord.balanceDue < 0) { ctx.fillText('累计余额:' + Math.abs(that.dealingsRecord.balanceDue), that.returnRealSize(1700), lastHeight); } else { ctx.fillText('累计欠款:0', that.returnRealSize(1700), lastHeight); } ctx.fillText('-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------', that.returnRealSize(20), lastHeight += that.returnRealSize(100)); ctx.draw(true); // 设置字体样式 ctx.font = 'bold ' + that.returnFontSize(60) + 'px SimSun'; // 设置文字颜色 ctx.fillStyle = 'black'; if (that.sales.noEarn >= 0) { ctx.fillText('本单欠款:' + that.sales.noEarn, that.returnRealSize(20), lastHeight += that.returnRealSize(100)); } else { ctx.fillText('本单余额:' + Math.abs(that.sales.noEarn), that.returnRealSize(20), lastHeight += that.returnRealSize(100)); } if (that.returnPrice > 0) { ctx.fillText('退货数量:' + that.returnNum, that.returnRealSize(900), lastHeight); ctx.fillText('退货金额:' + that.returnPrice, that.returnRealSize(1700), lastHeight); } ctx.fillText('-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------', that.returnRealSize(20), lastHeight += that.returnRealSize(100)); if (that.sales.remark) { ctx.fillText('订单备注:' + that.sales.remark, that.returnRealSize(20), lastHeight += that.returnRealSize(100)); ctx.fillText('-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------', that.returnRealSize(20), lastHeight += that.returnRealSize(100)); } ctx.fillText('店铺地址:' + this.addressArr, that.returnRealSize(20), lastHeight += that.returnRealSize(100)); if (this.shopId == '1820391948796694529' || this.shopId == '1848966744035692545' || this.shopId == '1850038419279974400') { ctx.fillText('店铺电话:' + this.jinjuPhone, that.returnRealSize(20), lastHeight += that.returnRealSize(100)); } else if (this.shopId == '1834512626093264897') { ctx.fillText('店铺电话:13191998128', that.returnRealSize(20), lastHeight += that.returnRealSize(100)); } else { ctx.fillText('店铺电话:' + (uni.getStorageSync('shopOwnerPhone') ? uni.getStorageSync('shopOwnerPhone') : uni.getStorageSync('username')), that.returnRealSize(20), lastHeight += that.returnRealSize(100)); } if (this.sales.companyName != null) { ctx.fillText('发货方式:' + this.sales.companyName + ' ' + this.sales.companyPhone, that.returnRealSize(20), lastHeight += that.returnRealSize(100)); } if (this.shopRemark.length > 0) { for (var _i3 = 0; _i3 < this.shopRemark.length; _i3++) { ctx.fillText(this.shopRemark[_i3], that.returnRealSize(20), lastHeight += that.returnRealSize(100)); } } ctx.fillText('-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------', that.returnRealSize(20), lastHeight += that.returnRealSize(100)); ctx.draw(true); var begineidth = that.returnRealSize(20); var wenheight = lastHeight + that.returnRealSize(150); lastHeight += that.returnRealSize(200); /* let qrarr = [] for(let k = 0;k { // } // }); // end _this10.printingMethod = res.result.printingMethod == null ? '0' : res.result.printingMethod; _this10.shopName = res.result.shopName; _this10.shopRemark = res.result.remark.split('\n'); _this10.shopAddress = res.result.shopAddress; _this10.shopRemark1 = res.result.remark; // businessDistrictLevel值为"1"时,是新款长机头打印机 _this10.businessDistrictLevel = res.result.businessDistrictLevel; _this10.jinjuPhone = res.result.contactPhone; var qrCode = res.result.shopIcon; // let qrCode = // '田一@_@https://u.wechat.com/EOzom56XQ_1MKeVPPqgwMlI?uVsMiaUpfpOk8MxSE19t4ao0TCVrd' if (qrCode != '') { var data = qrCode.split(','); for (var i = 0; i < data.length; i++) { if (qrCode.indexOf('@_@') != -1) { var obj = { name: data[i].split('@_@')[0], path: data[i].split('@_@')[1], imgUrl: data[i].split('@_@')[2], level: "M" }; _this10.qrArr.push(obj); } else { var weixin = data[i].indexOf("微信"); var dianpu = data[i].indexOf("店铺"); var zifubao = data[i].indexOf("支付"); var yinlian = data[i].indexOf("收款"); var duizhang = data[i].indexOf("对账"); if (duizhang != -1) { var result = data[i].substring(duizhang + 2); var _obj = { name: '查看对账单', path: result, level: "M" }; _this10.qrArr.push(_obj); } if (dianpu != -1) { var result = data[i].substring(dianpu + 2); var _obj2 = { name: '店铺微信', path: result, level: "M" }; _this10.qrArr.push(_obj2); } if (weixin != -1) { var result = data[i].substring(weixin + 2); var _obj3 = { name: '微信收款码', path: result, level: "M" }; _this10.qrArr.push(_obj3); } if (zifubao != -1) { var result = data[i].substring(zifubao + 2); var _obj4 = { name: '支付宝收款码', path: result, level: "Q" }; _this10.qrArr.push(_obj4); } if (yinlian != -1) { var result = data[i].substring(yinlian + 2); var _obj5 = { name: '银行收款码', path: result, level: "M" }; _this10.qrArr.push(_obj5); } } } setTimeout(function (res) { if (_this10.qrArr.length > 0) { that.getQRCode(); } }, 1000); } } }).catch(function (res) {}); }, goToInfo: function goToInfo() { var pages = getCurrentPages(); if (pages.length > 1) { uni.navigateBack({ delta: 1 }); } else { uni.reLaunch({ url: '/pages/index/home' }); } }, deleteOrder: function deleteOrder() { var that = this; uni.showModal({ title: "提示", content: "确定删除此条挂单吗?", success: function success(res) { if (res.confirm) { that.tui.request("/app/sale/delById", "post", { id: that.saleId }, false, true).then(function (res) { if (res.code == 200) { setTimeout(function (res) { uni.showToast({ title: "删除成功", icon: 'none' }); }, 1000); uni.navigateBack(); } else { uni.showToast({ title: "删除失败", icon: 'none' }); } }).catch(function (res) {}); } } }); }, getPrintHeight: function getPrintHeight() { var that = this; this.printHeight = 960; this.printHeight1 = 1900; this.printWidth1 = 2500; var scale = 0; uni.getSystemInfo({ success: function success(res) { scale = res.devicePixelRatio; } }); if (this.printingMethod == '1') { if (that.shopId == '1822829636942434305' || that.shopId == '1810179818189361152') { for (var i = 0; i < that.newData.length; i++) { this.printHeight1 += 300; this.printHeight += 100; this.printHeight += that.newData[i].sizePrintList.size * 90; this.printHeight1 += that.newData[i].sizePrintList.size * 100; } } else { for (var _i4 = 0; _i4 < that.newData.length; _i4++) { this.printHeight1 += 300; this.printHeight += 90; this.printHeight += that.newData[_i4].sizePrintList.size * 40; this.printHeight1 += that.newData[_i4].sizePrintList.size * 100; } } } else { this.printHeight1 += 200; for (var _i5 = 0; _i5 < that.newData.length; _i5++) { this.printHeight += 40; for (var m = 0; m < that.newData[_i5].stockLogList1.length; m++) { this.printHeight1 += 200; this.printHeight += 40; } } } if (that.qrArr.length > 0) { if (uni.getStorageSync('shopId') == '1890655721893269507' || uni.getStorageSync('shopId') == '1844355592815251456') { //原创家二维码放大了 this.printHeight += 452; } else { this.printHeight += 360; } this.printHeight1 += 1000; } if (that.shopRemark.length > 0) { this.printHeight += that.shopRemark.length * 40; this.printHeight1 += that.shopRemark.length * 100; } if (that.sales.remark) { this.printHeight += 100; this.printHeight1 += 100; } var smailBegin = 4000; if (that.deviceType == 'ios') { smailBegin = 2500; } this.smailDcl = Number(Number(this.printHeight1 / smailBegin).toFixed(2)); this.printHeight1 = smailBegin; this.myCanvasHeight = this.printHeight1 + 'px'; if (this.smailDcl >= 1) { this.printWidth1 = Number(Number(this.printWidth1 / this.smailDcl).toFixed(0)); } this.myCanvasWidth = this.printWidth1 + 'px'; setTimeout(function (res) { that.picOk = true; }, 1000); }, //生成二维码 getQRCode: function getQRCode() { var _this11 = this; var that = this; var _loop3 = function _loop3(i) { setTimeout(function (res1) { that.QrUrl = that.qrArr[i].path; var data = { name: that.qrArr[i].name, path: "" }; setTimeout(function (res1) { _this11.$refs.uqrcode.toTempFilePath({ success: function success(res) { data.path = res.tempFilePath; that.newQRList1.push(data); that.newQRList.push(data); }, fail: function fail(err) {} }); }, 500 * i); }, 1000 * i); }; for (var i = 0; i < that.qrArr.length; i++) { _loop3(i); } }, splitTextIntoChunks: function splitTextIntoChunks(text, chunkSize) { var _this12 = this; var result = []; for (var i = 0; i < text.length; i += chunkSize) { result.push(text.slice(i, i + chunkSize)); } this.$nextTick(function () { _this12.addressArr = result; }); }, sizeHengFn: function sizeHengFn() { this.isSizeHeng = !this.isSizeHeng; }, getPrintWidth: function getPrintWidth(width, add) { return Number(width) + add; }, //打印小票 onPrintSmall: function onPrintSmall() { var _this13 = this; var that = this; var strCmd = ''; var pageNum = 1; var Xindex = 0; var xNum = 0; if (this.businessDistrictLevel == "1") { xNum = 30; } if (this.printingMethod == '0') { that.yNum = 405; } else { that.yNum = 350; } strCmd = blesdk.CreatCPCLPage(1080, this.printHeight >= 1990 * pageNum ? 1990 : this.printHeight, 1, 0, 0); strCmd += blesdk.addCPCLSETMAG(4, 4); blesdk.addCPCLSETBOLD('bold'); strCmd += blesdk.addCPCLLocation(2); strCmd += blesdk.addCPCLText('0', '120', '24', '0', 0, this.shopName); strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLLocation(0); blesdk.addCPCLSETBOLD('bold'); if (this.shopId == '1865592366551928832' || this.shopId == '1810179818189361152') { var orderPayType = this.sales.payType == null ? '暂无' : this.sales.payType == 0 ? '现金收款' : this.sales.payType == 1 ? '微信收款' : this.sales.payType == 2 ? '支付宝收款' : this.sales.payType == 3 ? '银行卡转账' : this.sales.payType == 4 ? '收款码收款' : ''; strCmd += blesdk.addCPCLText(that.getPrintWidth('500', xNum), '250', '24', '0', 0, '收款方式:' + orderPayType); } if (this.shopName == '杰娜世家' || this.shopName == '老早测试') { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), '250', '24', '0', 0, '客户地址:' + that.order.address); } strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), '300', '24', '0', 0, '客户:' + (this.shopId == '1863043415453863936' && that.order.name == '散客' ? '客户' : that.order.name ? that.order.name : '散客')); strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLText(that.getPrintWidth('500', xNum), '300', '24', '0', 0, '单号:' + that.sales.id); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), '350', '24', '0', 0, '销售员:' + that.sales.createByName); strCmd += blesdk.addCPCLText(that.getPrintWidth('500', xNum), '350', '24', '0', 0, '日期:' + that.sales.createTime); var guige = '420'; var shuliang = '600'; if (this.zhengtizhekou) { guige = '350'; shuliang = '530'; } var zhekou = '600'; var danjia = '660'; var zongjia = '730'; if (this.printingMethod == '0') { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), '390', '24', '0', 0, '-----------------------------------------------------------------------------------'); strCmd += blesdk.addCPCLText(that.getPrintWidth('10', xNum), that.yNum += 40, '24', '0', 0, '货号(名称)'); strCmd += blesdk.addCPCLText(that.getPrintWidth(guige, xNum), that.yNum, '24', '0', 0, '规格'); strCmd += blesdk.addCPCLText(that.getPrintWidth(shuliang, xNum), that.yNum, '24', '0', 0, '数量'); if (this.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth(zhekou, xNum), that.yNum, '24', '0', 0, '折扣'); } if (that.shopId == '1960543009070256129') { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, '直播价'); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, '单价'); } strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, '总价'); } else if (this.printingMethod == '2') { that.yNum = 370; strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), '370', '24', '0', 0, '-----------------------------------------------------------------------------------'); strCmd += blesdk.addCPCLText(that.getPrintWidth('10', xNum), that.yNum += 40, '24', '0', 0, '货号(名称)'); strCmd += blesdk.addCPCLText(that.getPrintWidth('420', xNum), that.yNum, '24', '0', 0, '数量'); if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth('510', xNum), that.yNum, '24', '0', 0, '折扣'); if (that.shopId == '1960543009070256129') { strCmd += blesdk.addCPCLText(that.getPrintWidth('600', xNum), that.yNum, '24', '0', 0, '直播价'); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('600', xNum), that.yNum, '24', '0', 0, '单价'); } } else { if (that.shopId == '1960543009070256129') { strCmd += blesdk.addCPCLText(that.getPrintWidth('575', xNum), that.yNum, '24', '0', 0, '直播价'); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('575', xNum), that.yNum, '24', '0', 0, '单价'); } } strCmd += blesdk.addCPCLText(that.getPrintWidth('730', xNum), that.yNum, '24', '0', 0, '总价'); } if (this.shopId == '1843114735801864192' || this.shopId == '1810179818189361152') { var colorHeight = 25; //华秀家的退货商品单独显示在最下面 for (var i = 0; i < that.newData.length; i++) { if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; for (var m = 0; m < that.newData[i].stockLogList1.length; m++) { if (that.newData[i].stockLogList1[m].isReturn != true) { if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; if (that.newData[i].productName == that.newData[i].productSn && that.order.name != '散客') { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1) { //买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【补】' + that.newData[i].productSn); } else { // 0是没买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn); } } else { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != '散客') { //买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【补】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } else { // 0是没买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } } strCmd += blesdk.addCPCLText(that.getPrintWidth(guige, xNum), that.yNum, '24', '0', 0, that.slicePrint(that.newData[i].stockLogList1[m].attributeList)); strCmd += blesdk.addCPCLText(that.getPrintWidth(shuliang, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].productCount); if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth(zhekou, xNum), that.yNum, '24', '0', 0, that.newData[i].printDiscount); } if (that.newData[i].stockLogList1[m].isReturn) { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount * that.newData[i].stockLogList1[m].productCount); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount * that.newData[i].stockLogList1[m].productCount); } } else { if (that.newData[i].productName == that.newData[i].productSn && that.order.name != '散客') { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1) { //买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【补】' + that.newData[i].productSn); } else { // 0是没买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn); } } else { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != '散客') { //买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【补】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } else { // 0是没买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } } strCmd += blesdk.addCPCLText(that.getPrintWidth(guige, xNum), that.yNum, '24', '0', 0, that.slicePrint(that.newData[i].stockLogList1[m].attributeList)); strCmd += blesdk.addCPCLText(that.getPrintWidth(shuliang, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].productCount); if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth(zhekou, xNum), that.yNum, '24', '0', 0, that.newData[i].printDiscount); } if (that.newData[i].stockLogList1[m].isReturn) { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount * that.newData[i].stockLogList1[m].productCount); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount * that.newData[i].stockLogList1[m].productCount); } } } } } else { for (var m = 0; m < that.newData[i].stockLogList1.length; m++) { if (that.newData[i].stockLogList1[m].isReturn != true) { if (that.yNum + colorHeight >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + colorHeight >= 1990 ? 1990 : this.printHeight - that.yNum + colorHeight, 1, 0, 162); that.yNum = 0; pageNum++; if (this.printingMethod != '2') { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += colorHeight, '24', '0', 0, '-----------------------------------------------------------------------------------'); } } else { if (this.printingMethod != '2') { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += colorHeight, '24', '0', 0, '-----------------------------------------------------------------------------------'); } } if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; if (that.newData[i].productName == that.newData[i].productSn) { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != '散客') { //买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【补】' + that.newData[i].productSn); } else { // 0是没买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn); } } else { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != '散客') { //买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【补】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } else { // 0是没买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } } strCmd += blesdk.addCPCLText(that.getPrintWidth(guige, xNum), that.yNum, '24', '0', 0, that.slicePrint(that.newData[i].stockLogList1[m].attributeList)); strCmd += blesdk.addCPCLText(that.getPrintWidth(shuliang, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].productCount); if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth(zhekou, xNum), that.yNum, '24', '0', 0, that.newData[i].printDiscount); } if (that.newData[i].stockLogList1[m].isReturn) { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount * that.newData[i].stockLogList1[m].productCount); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount * that.newData[i].stockLogList1[m].productCount); } } else { if (that.newData[i].productName == that.newData[i].productSn) { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != '散客') { //买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【补】' + that.newData[i].productSn); } else { // 0是没买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn); } } else { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != '散客') { //买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【补】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } else { // 0是没买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } } strCmd += blesdk.addCPCLText(that.getPrintWidth(guige, xNum), that.yNum, '24', '0', 0, that.slicePrint(that.newData[i].stockLogList1[m].attributeList)); strCmd += blesdk.addCPCLText(that.getPrintWidth(shuliang, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].productCount); if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth(zhekou, xNum), that.yNum, '24', '0', 0, that.newData[i].printDiscount); } if (that.newData[i].stockLogList1[m].isReturn) { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount * that.newData[i].stockLogList1[m].productCount); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount * that.newData[i].stockLogList1[m].productCount); } } } } } } if (that.sales.productCount > 0) { if (that.yNum + colorHeight >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + colorHeight >= 1990 ? 1990 : this.printHeight - that.yNum + colorHeight, 1, 0, 162); that.yNum = 0; pageNum++; if (this.printingMethod != '2') { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += colorHeight, '24', '0', 0, '-----------------------------------------------------------------------------------'); } } else { if (this.printingMethod != '2') { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += colorHeight, '24', '0', 0, '-----------------------------------------------------------------------------------'); } } if (that.yNum + 64 >= 1990 * pageNum) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, '销售合计:'); strCmd += blesdk.addCPCLText(that.getPrintWidth('420', xNum), that.yNum, '24', '0', 0, that.sales.productCount + '件'); strCmd += blesdk.addCPCLText(that.getPrintWidth('730', xNum), that.yNum, '24', '0', 0, '¥' + that.sales.totalAmount); } else { strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, '销售合计:'); strCmd += blesdk.addCPCLText(that.getPrintWidth('420', xNum), that.yNum, '24', '0', 0, that.sales.productCount + '件'); strCmd += blesdk.addCPCLText(that.getPrintWidth('730', xNum), that.yNum, '24', '0', 0, '¥' + that.sales.totalAmount); } } if (that.returnNum > 0) { if (that.yNum + colorHeight >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + colorHeight >= 1990 ? 1990 : this.printHeight - that.yNum + colorHeight, 1, 0, 162); that.yNum = 0; pageNum++; if (this.printingMethod != '2') { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += colorHeight, '24', '0', 0, '-----------------------------------------------------------------------------------'); } } else { if (this.printingMethod != '2') { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += colorHeight, '24', '0', 0, '-----------------------------------------------------------------------------------'); } } } for (var i = 0; i < that.newData.length; i++) { if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; for (var m = 0; m < that.newData[i].stockLogList1.length; m++) { if (that.newData[i].stockLogList1[m].isReturn) { if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; if (that.newData[i].productName == that.newData[i].productSn) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } strCmd += blesdk.addCPCLText(that.getPrintWidth(guige, xNum), that.yNum, '24', '0', 0, that.slicePrint(that.newData[i].stockLogList1[m].attributeList)); strCmd += blesdk.addCPCLText(that.getPrintWidth(shuliang, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].productCount); if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth(zhekou, xNum), that.yNum, '24', '0', 0, that.newData[i].printDiscount); } if (that.newData[i].stockLogList1[m].isReturn) { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount * that.newData[i].stockLogList1[m].productCount); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount * that.newData[i].stockLogList1[m].productCount); } } else { if (that.newData[i].stockLogList1[m].isReturn) { if (that.newData[i].productName == that.newData[i].productSn) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } strCmd += blesdk.addCPCLText(that.getPrintWidth(guige, xNum), that.yNum, '24', '0', 0, that.slicePrint(that.newData[i].stockLogList1[m].attributeList)); strCmd += blesdk.addCPCLText(that.getPrintWidth(shuliang, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].productCount); if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth(zhekou, xNum), that.yNum, '24', '0', 0, that.newData[i].printDiscount); } if (that.newData[i].stockLogList1[m].isReturn) { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount * that.newData[i].stockLogList1[m].productCount); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount * that.newData[i].stockLogList1[m].productCount); } } } } } } else { for (var m = 0; m < that.newData[i].stockLogList1.length; m++) { if (that.newData[i].stockLogList1[m].isReturn) { if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; if (that.newData[i].productName == that.newData[i].productSn) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } strCmd += blesdk.addCPCLText(that.getPrintWidth(guige, xNum), that.yNum, '24', '0', 0, that.slicePrint(that.newData[i].stockLogList1[m].attributeList)); strCmd += blesdk.addCPCLText(that.getPrintWidth(shuliang, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].productCount); if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth(zhekou, xNum), that.yNum, '24', '0', 0, that.newData[i].printDiscount); } if (that.newData[i].stockLogList1[m].isReturn) { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount * that.newData[i].stockLogList1[m].productCount); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount * that.newData[i].stockLogList1[m].productCount); } } else { if (that.newData[i].stockLogList1[m].isReturn) { if (that.newData[i].productName == that.newData[i].productSn) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } } strCmd += blesdk.addCPCLText(that.getPrintWidth(guige, xNum), that.yNum, '24', '0', 0, that.slicePrint(that.newData[i].stockLogList1[m].attributeList)); strCmd += blesdk.addCPCLText(that.getPrintWidth(shuliang, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].productCount); if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth(zhekou, xNum), that.yNum, '24', '0', 0, that.newData[i].printDiscount); } if (that.newData[i].stockLogList1[m].isReturn) { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount * that.newData[i].stockLogList1[m].productCount); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount * that.newData[i].stockLogList1[m].productCount); } } } } } } } else { var _loop4 = function _loop4() { var colorHeight = 25; if (that.shopId == '1822829636942434305' || that.shopId == '1810179818189361152') { colorHeight = 50; } if (that.yNum + colorHeight >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, _this13.printHeight - that.yNum + colorHeight >= 1990 ? 1990 : _this13.printHeight - that.yNum + colorHeight, 1, 0, 162); that.yNum = 0; pageNum++; if (_this13.printingMethod != '2') { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += colorHeight, '24', '0', 0, '-----------------------------------------------------------------------------------'); } } else { if (_this13.printingMethod != '2') { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += colorHeight, '24', '0', 0, '-----------------------------------------------------------------------------------'); } } if (_this13.printingMethod == '1') { if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, _this13.printHeight - that.yNum + 64 >= 1990 ? 1990 : _this13.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; } var fountSize = '0'; if (that.shopId == '1822829636942434305' || that.shopId == '1810179818189361152') { fountSize = '1'; } if (that.newData[i].productName == that.newData[i].productSn) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', fountSize, 0, that.newData[i].productSn); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', fountSize, 0, that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } colorHeight = 64; if (that.shopId == '1822829636942434305' || that.shopId == '1810179818189361152') { colorHeight = 80; } if (that.yNum + colorHeight >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, _this13.printHeight - that.yNum + colorHeight >= 1990 ? 1990 : _this13.printHeight - that.yNum + colorHeight, 1, 0, 180); that.yNum = 0; pageNum++; } colorHeight = 40; if (that.shopId == '1822829636942434305' || that.shopId == '1810179818189361152') { fountSize = '1'; colorHeight = 58; } strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += colorHeight, '24', fountSize, 0, '颜色'); var startWith = 180; for (var a = 0; a < that.newData[i].sizeList.length; a++) { if ((that.shopId == '1820269107191353344' || that.shopId == '1810179818189361152') && that.newData[i].sizeList[a] == '均') { that.newData[i].sizeList[a] = '分码'; } strCmd += blesdk.addCPCLSETBOLD('400'); var _fountSize = '0'; var widthSize = 420; if (that.shopId == '1822829636942434305' || that.shopId == '1810179818189361152') { _fountSize = '1'; widthSize = 470; } strCmd += blesdk.addCPCLText(that.getPrintWidth(startWith.toString(), xNum), that.yNum, '24', _fountSize, 0, that.newData[i].sizeList[a]); strCmd += blesdk.addCPCLSETBOLD('0'); startWith += Math.floor(widthSize / 8); } if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth('562', xNum), that.yNum, '24', fountSize, 0, '数量'); strCmd += blesdk.addCPCLText(that.getPrintWidth('628', xNum), that.yNum, '24', fountSize, 0, '折扣'); if (that.shopId == '1960543009070256129') { strCmd += blesdk.addCPCLText(that.getPrintWidth('694', xNum), that.yNum, '24', fountSize, 0, '直播价'); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('694', xNum), that.yNum, '24', fountSize, 0, '单价'); } strCmd += blesdk.addCPCLText(that.getPrintWidth('770', xNum), that.yNum, '24', fountSize, 0, '总价'); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('578', xNum), that.yNum, '24', fountSize, 0, '数量'); if (that.shopId == '1960543009070256129') { strCmd += blesdk.addCPCLText(that.getPrintWidth('644', xNum), that.yNum, '24', fountSize, 0, '直播价'); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('644', xNum), that.yNum, '24', fountSize, 0, '单价'); } strCmd += blesdk.addCPCLText(that.getPrintWidth('720', xNum), that.yNum, '24', fountSize, 0, '总价'); } var begin = 0; that.newData[i].sizePrintList.forEach(function (value, key) { colorHeight = 64; if (that.shopId == '1822829636942434305' || that.shopId == '1810179818189361152') { colorHeight = 90; } if (that.yNum + colorHeight >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, that.printHeight - that.yNum + colorHeight >= 1990 ? 1990 : that.printHeight - that.yNum + colorHeight, 1, 0, 180); that.yNum = 0; pageNum++; } if ((that.shopId == '1820269107191353344' || that.shopId == '1810179818189361152') && key == '均色') { key = '分色'; } var beginHeight = 40; var widthSize = 420; var fountSize = '0'; if (that.shopId == '1822829636942434305' || that.shopId == '1810179818189361152') { beginHeight = 58; } begin++; if (that.shopId == '1822829636942434305' || that.shopId == '1810179818189361152') { fountSize = '1'; widthSize = 470; } strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += beginHeight, '24', fountSize, 0, key); var childStartWith = 180; var allCount = 0; var discountAmount = 0; for (var _a3 = 0; _a3 < that.newData[i].sizeList.length; _a3++) { var printSizeCount = []; if (that.newData[i].sizeList[_a3] == '分码') { that.newData[i].sizeList[_a3] = '均'; } if (value.has(that.newData[i].sizeList[_a3])) { printSizeCount = value.get(that.newData[i].sizeList[_a3]).split(':'); discountAmount = printSizeCount[1] == undefined ? '' : printSizeCount[1]; } allCount += printSizeCount[0] == undefined ? 0 : Number(printSizeCount[0]); that.newData[i].allCount = allCount; strCmd += blesdk.addCPCLText(that.getPrintWidth(childStartWith.toString(), xNum), that.yNum, '24', fountSize, 0, printSizeCount[0] == undefined ? '' : Number(printSizeCount[0])); childStartWith += Math.floor(widthSize / 8); } if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth('562', xNum), that.yNum, '24', fountSize, 0, allCount); strCmd += blesdk.addCPCLText(that.getPrintWidth('628', xNum), that.yNum, '24', fountSize, 0, that.newData[i].printDiscount); strCmd += blesdk.addCPCLText(that.getPrintWidth('694', xNum), that.yNum, '24', fountSize, 0, discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth('770', xNum), that.yNum, '24', fountSize, 0, allCount * discountAmount); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('578', xNum), that.yNum, '24', fountSize, 0, allCount); strCmd += blesdk.addCPCLText(that.getPrintWidth('644', xNum), that.yNum, '24', fountSize, 0, discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth('720', xNum), that.yNum, '24', fountSize, 0, allCount * discountAmount); } }); } else if (_this13.printingMethod == '2') { var returnCount = 0; var buyCount = 0; var returnPrice = 0; var buyPrice = 0; for (m = 0; m < that.newData[i].stockLogList1.length; m++) { if (that.newData[i].stockLogList1[m].isReturn) { returnPrice = that.newData[i].stockLogList1[m].discountAmount; returnCount += that.newData[i].stockLogList1[m].productCount; } else { buyCount += that.newData[i].stockLogList1[m].productCount; } } if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, _this13.printHeight - that.yNum + 64 >= 1990 ? 1990 : _this13.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; } if (buyCount > 0) { if (that.newData[i].productName == that.newData[i].productSn) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn); strCmd += blesdk.addCPCLText(that.getPrintWidth('420', xNum), that.yNum, '24', '0', 0, buyCount); if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth('510', xNum), that.yNum, '24', '0', 0, that.newData[i].printDiscount); strCmd += blesdk.addCPCLText(that.getPrintWidth('600', xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('575', xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount); } strCmd += blesdk.addCPCLText(that.getPrintWidth('730', xNum), that.yNum, '24', '0', 0, buyCount * that.newData[i].discountAmount); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); strCmd += blesdk.addCPCLText(that.getPrintWidth('420', xNum), that.yNum, '24', '0', 0, buyCount); if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth('510', xNum), that.yNum, '24', '0', 0, that.newData[i].printDiscount); strCmd += blesdk.addCPCLText(that.getPrintWidth('600', xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('575', xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount); } strCmd += blesdk.addCPCLText(that.getPrintWidth('730', xNum), that.yNum, '24', '0', 0, buyCount * that.newData[i].discountAmount); } } if (returnCount > 0) { if (that.newData[i].productName == that.newData[i].productSn) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn); strCmd += blesdk.addCPCLText(that.getPrintWidth('420', xNum), that.yNum, '24', '0', 0, returnCount); if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth('510', xNum), that.yNum, '24', '0', 0, ""); strCmd += blesdk.addCPCLText(that.getPrintWidth('600', xNum), that.yNum, '24', '0', 0, returnPrice); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('575', xNum), that.yNum, '24', '0', 0, returnPrice); } strCmd += blesdk.addCPCLText(that.getPrintWidth('730', xNum), that.yNum, '24', '0', 0, returnCount * returnPrice); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); strCmd += blesdk.addCPCLText(that.getPrintWidth('420', xNum), that.yNum, '24', '0', 0, returnCount); if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth('510', xNum), that.yNum, '24', '0', 0, ""); strCmd += blesdk.addCPCLText(that.getPrintWidth('600', xNum), that.yNum, '24', '0', 0, returnPrice); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('575', xNum), that.yNum, '24', '0', 0, returnPrice); } strCmd += blesdk.addCPCLText(that.getPrintWidth('730', xNum), that.yNum, '24', '0', 0, returnCount * returnPrice); } } } else { if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, _this13.printHeight - that.yNum + 64 >= 1990 ? 1990 : _this13.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; for (m = 0; m < that.newData[i].stockLogList1.length; m++) { if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, _this13.printHeight - that.yNum + 64 >= 1990 ? 1990 : _this13.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; if (that.newData[i].stockLogList1[m].isReturn) { if (that.newData[i].productName == that.newData[i].productSn) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } } else { if (that.newData[i].productName == that.newData[i].productSn && that.order.name != '散客') { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1) { //买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【补】' + that.newData[i].productSn); } else { // 0是没买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn); } } else { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != '散客') { //买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【补】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } else { // 0是没买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } } } if (that.shopId == '1820269107191353344' || that.shopId == '1810179818189361152') { if (that.newData[i].stockLogList1[m].attributeList.indexOf('均色') != -1) { that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m].attributeList.replace(/均色/g, '分色'); } if (that.newData[i].stockLogList1[m].attributeList.indexOf('均码') != -1) { that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m].attributeList.replace(/均码/g, '分码'); } } strCmd += blesdk.addCPCLText(that.getPrintWidth(guige, xNum), that.yNum, '24', '0', 0, that.slicePrint(that.newData[i].stockLogList1[m].attributeList)); strCmd += blesdk.addCPCLText(that.getPrintWidth(shuliang, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].productCount); if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth(zhekou, xNum), that.yNum, '24', '0', 0, that.newData[i].printDiscount); } if (that.newData[i].stockLogList1[m].isReturn) { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount * that.newData[i].stockLogList1[m].productCount); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount * that.newData[i].stockLogList1[m].productCount); } } else { if (that.newData[i].stockLogList1[m].isReturn) { if (that.newData[i].productName == that.newData[i].productSn) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } } else { if (that.newData[i].productName == that.newData[i].productSn && that.order.name != '散客') { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1) { //买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【补】' + that.newData[i].productSn); } else { // 0是没买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn); } } else { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != '散客') { //买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【补】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } else { // 0是没买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } } } if (that.shopId == '1820269107191353344' || that.shopId == '1810179818189361152') { if (that.newData[i].stockLogList1[m].attributeList.indexOf('均色') != -1) { that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m].attributeList.replace(/均色/g, '分色'); } if (that.newData[i].stockLogList1[m].attributeList.indexOf('均码') != -1) { that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m].attributeList.replace(/均码/g, '分码'); } } strCmd += blesdk.addCPCLText(that.getPrintWidth(guige, xNum), that.yNum, '24', '0', 0, that.slicePrint(that.newData[i].stockLogList1[m].attributeList)); strCmd += blesdk.addCPCLText(that.getPrintWidth(shuliang, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].productCount); if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth(zhekou, xNum), that.yNum, '24', '0', 0, that.newData[i].printDiscount); } if (that.newData[i].stockLogList1[m].isReturn) { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount * that.newData[i].stockLogList1[m].productCount); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount * that.newData[i].stockLogList1[m].productCount); } } } } else { for (m = 0; m < that.newData[i].stockLogList1.length; m++) { if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, _this13.printHeight - that.yNum + 64 >= 1990 ? 1990 : _this13.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; if (that.newData[i].stockLogList1[m].isReturn) { if (that.newData[i].productName == that.newData[i].productSn) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } } else { if (that.newData[i].productName == that.newData[i].productSn) { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != '散客') { //买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【补】' + that.newData[i].productSn); } else { // 0是没买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn); } } else { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != '散客') { //买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【补】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } else { // 0是没买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } } } if (that.shopId == '1820269107191353344' || that.shopId == '1810179818189361152') { if (that.newData[i].stockLogList1[m].attributeList.indexOf('均色') != -1) { that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m].attributeList.replace(/均色/g, '分色'); } if (that.newData[i].stockLogList1[m].attributeList.indexOf('均码') != -1) { that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m].attributeList.replace(/均码/g, '分码'); } } strCmd += blesdk.addCPCLText(that.getPrintWidth(guige, xNum), that.yNum, '24', '0', 0, that.slicePrint(that.newData[i].stockLogList1[m].attributeList)); strCmd += blesdk.addCPCLText(that.getPrintWidth(shuliang, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].productCount); if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth(zhekou, xNum), that.yNum, '24', '0', 0, that.newData[i].printDiscount); } if (that.newData[i].stockLogList1[m].isReturn) { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount * that.newData[i].stockLogList1[m].productCount); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount * that.newData[i].stockLogList1[m].productCount); } } else { if (that.newData[i].stockLogList1[m].isReturn) { if (that.newData[i].productName == that.newData[i].productSn) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【退】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } } else { if (that.newData[i].productName == that.newData[i].productSn) { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != '散客') { //买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【补】' + that.newData[i].productSn); } else { // 0是没买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn); } } else { if (that.newData[i].stockLogList1[m].isPurchasedBefore == 1 && that.order.name != '散客') { //买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【补】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } else { // 0是没买过 strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, (Xindex += 1) + '.' + '【销】' + that.newData[i].productSn + '(' + (that.newData[i].productName == null ? '' : that.newData[i].productName) + ')'); } } } if (that.shopId == '1820269107191353344' || that.shopId == '1810179818189361152') { if (that.newData[i].stockLogList1[m].attributeList.indexOf('均色') != -1) { that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m].attributeList.replace(/均色/g, '分色'); } if (that.newData[i].stockLogList1[m].attributeList.indexOf('均码') != -1) { that.newData[i].stockLogList1[m].attributeList = that.newData[i].stockLogList1[m].attributeList.replace(/均码/g, '分码'); } } strCmd += blesdk.addCPCLText(that.getPrintWidth(guige, xNum), that.yNum, '24', '0', 0, that.slicePrint(that.newData[i].stockLogList1[m].attributeList)); strCmd += blesdk.addCPCLText(that.getPrintWidth(shuliang, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].productCount); if (that.zhengtizhekou) { strCmd += blesdk.addCPCLText(that.getPrintWidth(zhekou, xNum), that.yNum, '24', '0', 0, that.newData[i].printDiscount); } if (that.newData[i].stockLogList1[m].isReturn) { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].stockLogList1[m].discountAmount * that.newData[i].stockLogList1[m].productCount); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth(danjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth(zongjia, xNum), that.yNum, '24', '0', 0, that.newData[i].discountAmount * that.newData[i].stockLogList1[m].productCount); } } } } } }; for (var i = 0; i < that.newData.length; i++) { var m; var m; var m; _loop4(); } } // strCmd += blesdk.addCPCLPrint(); // that.bufferData.push(strCmd); // that.yNum = 0 // strCmd = blesdk.CreatCPCLPage(1080, 700, 1, 0); var lineSize = 25; if (that.shopId == '1822829636942434305' || that.shopId == '1810179818189361152') { lineSize = 40; } if (that.yNum + lineSize >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + lineSize >= 1990 ? 1990 : this.printHeight - that.yNum + lineSize, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += lineSize, '24', '0', 0, '-----------------------------------------------------------------------------------'); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += lineSize, '24', '0', 0, '-----------------------------------------------------------------------------------'); } strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLLocation(0); //金桔家金额区域显示 if (this.shopId == '1820391948796694529') { if (that.yNum + 54 >= 1990 * pageNum) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 54 >= 1990 ? 1990 : this.printHeight - that.yNum + 54, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '销售数量:' + that.sales.productCount); strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '销售金额:' + that.sales.totalAmount); // strCmd += blesdk.addCPCLSETMAG(1, 2) strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '余额抵销售:' + that.sales.balanceDeductionAmount); // strCmd += blesdk.addCPCLText(that.getPrintWidth(,xNum) '600', (that.yNum - 20), '24', '0', 0, '本单实收:' + that.sales.alreadyEarn) } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '销售数量:' + that.sales.productCount); strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '销售金额:' + that.sales.totalAmount); // strCmd += blesdk.addCPCLSETMAG(1, 2) strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '余额抵销售:' + that.sales.balanceDeductionAmount); // strCmd += blesdk.addCPCLText(that.getPrintWidth(,xNum) '600', (that.yNum - 20), '24', '0', 0, '本单实收:' + that.sales.alreadyEarn) } strCmd += blesdk.addCPCLSETMAG(1, 1); if (that.yNum + 54 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 54 >= 1990 ? 1990 : this.printHeight - that.yNum + 54, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '退货数量:' + that.returnNum); strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice); strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '其他费用:' + that.sales.otherExpense); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '退货数量:' + that.returnNum); strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice); strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '其他费用:' + that.sales.otherExpense); } if (that.yNum + 54 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 54 >= 1990 ? 1990 : this.printHeight - that.yNum + 54, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '欠款抵退货:' + that.sales.debtDeductionAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '销售抵退货:' + that.sales.saleDeductionAmount); strCmd += blesdk.addCPCLSETMAG(1, 2); if (that.dealingsRecord.lastDebtAmount >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '之前欠款:' + that.dealingsRecord.lastDebtAmount); } else if (that.dealingsRecord.lastDebtAmount < 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '之前余额:' + Math.abs(that.dealingsRecord.lastDebtAmount)); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '之前欠款:0'); } } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '欠款抵退货:' + that.sales.debtDeductionAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '销售抵退货:' + that.sales.saleDeductionAmount); // strCmd += blesdk.addCPCLText(that.getPrintWidth(,xNum) '610', that.yNum, '24', '0', 0, '余额抵销售:' + (that.sales // .balanceDeductionAmount)) strCmd += blesdk.addCPCLSETMAG(1, 1); if (that.dealingsRecord.lastDebtAmount >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '之前欠款:' + that.dealingsRecord.lastDebtAmount); } else if (that.dealingsRecord.lastDebtAmount < 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '之前余额:' + Math.abs(that.dealingsRecord.lastDebtAmount)); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '之前欠款:0'); } } strCmd += blesdk.addCPCLSETMAG(1, 1); if (that.yNum + 54 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 54 >= 1990 ? 1990 : this.printHeight - that.yNum + 54, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '本单应收:' + that.sales.realAmount); if (that.sales.noEarn >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '本单欠款:' + that.sales.noEarn); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '本单余额:' + Math.abs(that.sales.noEarn)); } if (that.dealingsRecord.balanceDue >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord.balanceDue); } else if (that.dealingsRecord.balanceDue < 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '累计余额:' + Math.abs(that.dealingsRecord.balanceDue)); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '累计欠款:0'); } } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '本单应收:' + that.sales.realAmount); if (that.sales.noEarn >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '本单欠款:' + that.sales.noEarn); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '本单余额:' + Math.abs(that.sales.noEarn)); } if (that.dealingsRecord.balanceDue >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord.balanceDue); } else if (that.dealingsRecord.balanceDue < 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '累计余额:' + Math.abs(that.dealingsRecord.balanceDue)); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '累计欠款:0'); } } if (that.yNum + 54 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 54 >= 1990 ? 1990 : this.printHeight - that.yNum + 54, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 2); strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales.alreadyEarn); } else { strCmd += blesdk.addCPCLSETMAG(1, 2); strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales.alreadyEarn); } } else if (this.shopId == '1821406205034237952') { //董大姐家金额单独显示 if (that.yNum + 64 >= 1990 * pageNum) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, '合计:'); strCmd += blesdk.addCPCLText(that.getPrintWidth('520', xNum), that.yNum, '24', '0', 0, that.sales.productCount + '件'); strCmd += blesdk.addCPCLText(that.getPrintWidth('700', xNum), that.yNum, '24', '0', 0, '¥' + that.sales.totalAmount); } else { strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, '合计:'); strCmd += blesdk.addCPCLText(that.getPrintWidth('520', xNum), that.yNum, '24', '0', 0, that.sales.productCount + '件'); strCmd += blesdk.addCPCLText(that.getPrintWidth('700', xNum), that.yNum, '24', '0', 0, '¥' + that.sales.totalAmount); } if (that.yNum + 60 >= 1990 * pageNum) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 60 >= 1990 ? 1990 : this.printHeight - that.yNum + 60, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 2); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '本单应收:' + that.sales.realAmount + '(' + this.convertToChineseNumeral(that.sales.realAmount) + ')'); } else { strCmd += blesdk.addCPCLSETMAG(1, 2); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '本单应收:' + that.sales.realAmount + '(' + this.convertToChineseNumeral(that.sales.realAmount) + ')'); } if (that.yNum + 60 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 60 >= 1990 ? 1990 : this.printHeight - that.yNum + 60, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 2); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales.alreadyEarn + '(' + this.convertToChineseNumeral(that.sales.alreadyEarn) + ')'); } else { strCmd += blesdk.addCPCLSETMAG(1, 2); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '本单实收:' + that.sales.alreadyEarn + '(' + this.convertToChineseNumeral(that.sales.alreadyEarn) + ')'); } if (that.yNum + 60 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 60 >= 1990 ? 1990 : this.printHeight - that.yNum + 60, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 2); if (that.dealingsRecord.lastDebtAmount >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '之前欠款:' + that.dealingsRecord.lastDebtAmount); } else if (that.dealingsRecord.lastDebtAmount < 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '之前余额:' + Math.abs(that.dealingsRecord.lastDebtAmount)); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '之前欠款:0'); } if (that.dealingsRecord.balanceDue >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('540', xNum), that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord.balanceDue); } else if (that.dealingsRecord.balanceDue < 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('540', xNum), that.yNum, '24', '0', 0, '累计余额:' + Math.abs(that.dealingsRecord.balanceDue)); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('540', xNum), that.yNum, '24', '0', 0, '累计欠款:0'); } } else { strCmd += blesdk.addCPCLSETMAG(1, 2); if (that.dealingsRecord.lastDebtAmount >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '之前欠款:' + that.dealingsRecord.lastDebtAmount); } else if (that.dealingsRecord.lastDebtAmount < 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '之前余额:' + Math.abs(that.dealingsRecord.lastDebtAmount)); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '之前欠款:0'); } if (that.dealingsRecord.balanceDue >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('540', xNum), that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord.balanceDue); } else if (that.dealingsRecord.balanceDue < 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('540', xNum), that.yNum, '24', '0', 0, '累计余额:' + Math.abs(that.dealingsRecord.balanceDue)); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('540', xNum), that.yNum, '24', '0', 0, '累计欠款:0'); } } if (that.yNum + 60 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 60 >= 1990 ? 1990 : this.printHeight - that.yNum + 60, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '-----------------------------------------------------------------------------------'); } else { strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '-----------------------------------------------------------------------------------'); } strCmd += blesdk.addCPCLSETMAG(1, 1); if (that.yNum + 30 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 30 >= 1990 ? 1990 : this.printHeight - that.yNum + 30, 1, 0, 162); that.yNum = 0; pageNum++; if (that.sales.noEarn >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '本单欠款:' + that.sales.noEarn); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '本单余额:' + Math.abs(that.sales.noEarn)); } if (that.returnPrice > 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '退货数量:' + that.returnNum); strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice); } } else { if (that.sales.noEarn >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '本单欠款:' + that.sales.noEarn); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '本单余额:' + Math.abs(that.sales.noEarn)); } if (that.returnPrice > 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '退货数量:' + that.returnNum); strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice); } } } else if (this.printingMethod == '2' || this.shopId == '1843114735801864192' || this.shopId == '1810179818189361152') { //华秀 if (this.printingMethod == '2') { if (that.yNum + 64 >= 1990 * pageNum) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, '合计:'); strCmd += blesdk.addCPCLText(that.getPrintWidth('420', xNum), that.yNum, '24', '0', 0, that.sales.productCount + '件'); strCmd += blesdk.addCPCLText(that.getPrintWidth('730', xNum), that.yNum, '24', '0', 0, '¥' + that.sales.totalAmount); } else { strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, '合计:'); strCmd += blesdk.addCPCLText(that.getPrintWidth('420', xNum), that.yNum, '24', '0', 0, that.sales.productCount + '件'); strCmd += blesdk.addCPCLText(that.getPrintWidth('730', xNum), that.yNum, '24', '0', 0, '¥' + that.sales.totalAmount); } } else { if (that.yNum + 64 >= 1990 * pageNum) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, '退货合计:'); strCmd += blesdk.addCPCLText(that.getPrintWidth('420', xNum), that.yNum, '24', '0', 0, that.returnNum + '件'); strCmd += blesdk.addCPCLText(that.getPrintWidth('730', xNum), that.yNum, '24', '0', 0, '¥' + that.returnPrice); } else { strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, '退货合计:'); strCmd += blesdk.addCPCLText(that.getPrintWidth('420', xNum), that.yNum, '24', '0', 0, that.returnNum + '件'); strCmd += blesdk.addCPCLText(that.getPrintWidth('730', xNum), that.yNum, '24', '0', 0, '¥' + that.returnPrice); } } if (that.yNum + 60 >= 1990 * pageNum) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 60 >= 1990 ? 1990 : this.printHeight - that.yNum + 60, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 2); if (that.dealingsRecord.lastDebtAmount >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '之前欠款:' + that.dealingsRecord.lastDebtAmount); } else if (that.dealingsRecord.lastDebtAmount < 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '之前余额:' + Math.abs(that.dealingsRecord.lastDebtAmount)); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '之前欠款:0'); } strCmd += blesdk.addCPCLText(that.getPrintWidth('248', xNum), that.yNum, '24', '0', 0, '本单应收:' + that.sales.realAmount + '(' + this.convertToChineseNumeral(that.sales.realAmount) + ')'); } else { strCmd += blesdk.addCPCLSETMAG(1, 2); if (that.dealingsRecord.lastDebtAmount >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '之前欠款:' + that.dealingsRecord.lastDebtAmount); } else if (that.dealingsRecord.lastDebtAmount < 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '之前余额:' + Math.abs(that.dealingsRecord.lastDebtAmount)); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '之前欠款:0'); } strCmd += blesdk.addCPCLText(that.getPrintWidth('248', xNum), that.yNum, '24', '0', 0, '本单应收:' + that.sales.realAmount + '(' + this.convertToChineseNumeral(that.sales.realAmount) + ')'); } if (that.yNum + 60 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 60 >= 1990 ? 1990 : this.printHeight - that.yNum + 60, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 2); if (that.dealingsRecord.balanceDue >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '累计欠款:' + that.dealingsRecord.balanceDue); } else if (that.dealingsRecord.balanceDue < 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '累计余额:' + Math.abs(that.dealingsRecord.balanceDue)); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '累计欠款:0'); } strCmd += blesdk.addCPCLText(that.getPrintWidth('248', xNum), that.yNum, '24', '0', 0, '本单实收:' + that.sales.alreadyEarn + '(' + this.convertToChineseNumeral(that.sales.alreadyEarn) + ')'); } else { strCmd += blesdk.addCPCLSETMAG(1, 2); if (that.dealingsRecord.balanceDue >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '累计欠款:' + that.dealingsRecord.balanceDue); } else if (that.dealingsRecord.balanceDue < 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '累计余额:' + Math.abs(that.dealingsRecord.balanceDue)); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '累计欠款:0'); } strCmd += blesdk.addCPCLText(that.getPrintWidth('248', xNum), that.yNum, '24', '0', 0, '本单实收:' + that.sales.alreadyEarn + '(' + this.convertToChineseNumeral(that.sales.alreadyEarn) + ')'); } if (that.yNum + 60 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 60 >= 1990 ? 1990 : this.printHeight - that.yNum + 60, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '-----------------------------------------------------------------------------------'); } else { strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '-----------------------------------------------------------------------------------'); } strCmd += blesdk.addCPCLSETMAG(1, 1); if (that.yNum + 30 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 30 >= 1990 ? 1990 : this.printHeight - that.yNum + 30, 1, 0, 162); that.yNum = 0; pageNum++; if (that.sales.noEarn >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '本单欠款:' + that.sales.noEarn); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '本单余额:' + Math.abs(that.sales.noEarn)); } if (that.returnPrice > 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '退货数量:' + that.returnNum); strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice); } } else { if (that.sales.noEarn >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '本单欠款:' + that.sales.noEarn); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '本单余额:' + Math.abs(that.sales.noEarn)); } if (that.returnPrice > 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '退货数量:' + that.returnNum); strCmd += blesdk.addCPCLText(that.getPrintWidth('580', xNum), that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice); } } } else { //正常的金额显示 if (that.yNum + 84 >= 1990 * pageNum) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 84 >= 1990 ? 1990 : this.printHeight - that.yNum + 84, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '销售数量:' + that.sales.productCount); strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '销售金额:' + that.sales.totalAmount); // strCmd += blesdk.addCPCLSETMAG(1, 2) strCmd += blesdk.addCPCLText(that.getPrintWidth('610', xNum), that.yNum, '24', '0', 0, '余额抵销售:' + that.sales.balanceDeductionAmount); // strCmd += blesdk.addCPCLText(that.getPrintWidth(,xNum) '600', (that.yNum - 20), '24', '0', 0, '本单实收:' + that.sales.alreadyEarn) } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '销售数量:' + that.sales.productCount); strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '销售金额:' + that.sales.totalAmount); // strCmd += blesdk.addCPCLSETMAG(1, 2) strCmd += blesdk.addCPCLText(that.getPrintWidth('610', xNum), that.yNum, '24', '0', 0, '余额抵销售:' + that.sales.balanceDeductionAmount); // strCmd += blesdk.addCPCLText(that.getPrintWidth(,xNum) '600', (that.yNum - 20), '24', '0', 0, '本单实收:' + that.sales.alreadyEarn) } strCmd += blesdk.addCPCLSETMAG(1, 1); if (that.yNum + 84 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 84 >= 1990 ? 1990 : this.printHeight - that.yNum + 84, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '退货数量:' + that.returnNum); strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice); strCmd += blesdk.addCPCLText(that.getPrintWidth('610', xNum), that.yNum, '24', '0', 0, '其他费用:' + that.sales.otherExpense); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '退货数量:' + that.returnNum); strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '退货金额:' + that.returnPrice); strCmd += blesdk.addCPCLText(that.getPrintWidth('610', xNum), that.yNum, '24', '0', 0, '其他费用:' + that.sales.otherExpense); } if (that.yNum + 84 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 84 >= 1990 ? 1990 : this.printHeight - that.yNum + 84, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '欠款抵退货:' + that.sales.debtDeductionAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '销售抵退货:' + that.sales.saleDeductionAmount); strCmd += blesdk.addCPCLSETMAG(1, 2); if (that.dealingsRecord.lastDebtAmount >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('600', xNum), that.yNum, '24', '0', 0, '之前欠款:' + that.dealingsRecord.lastDebtAmount); } else if (that.dealingsRecord.lastDebtAmount < 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('600', xNum), that.yNum, '24', '0', 0, '之前余额:' + Math.abs(that.dealingsRecord.lastDebtAmount)); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('600', xNum), that.yNum, '24', '0', 0, '之前欠款:0'); } } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 60, '24', '0', 0, '欠款抵退货:' + that.sales.debtDeductionAmount); strCmd += blesdk.addCPCLText(that.getPrintWidth('300', xNum), that.yNum, '24', '0', 0, '销售抵退货:' + that.sales.saleDeductionAmount); // strCmd += blesdk.addCPCLText(that.getPrintWidth(,xNum) '610', that.yNum, '24', '0', 0, '余额抵销售:' + (that.sales // .balanceDeductionAmount)) strCmd += blesdk.addCPCLSETMAG(1, 2); if (that.dealingsRecord.lastDebtAmount >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('610', xNum), that.yNum - 10, '24', '0', 0, '之前欠款:' + that.dealingsRecord.lastDebtAmount); } else if (that.dealingsRecord.lastDebtAmount < 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('610', xNum), that.yNum - 10, '24', '0', 0, '之前余额:' + Math.abs(that.dealingsRecord.lastDebtAmount)); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('610', xNum), that.yNum - 10, '24', '0', 0, '之前欠款:0'); } } if (that.yNum + 94 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 94 >= 1990 ? 1990 : this.printHeight - that.yNum + 94, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 2); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 70, '24', '0', 0, '本单应收:' + that.sales.realAmount + '(' + that.convertToChineseNumeral(that.sales.realAmount) + ')'); strCmd += blesdk.addCPCLText(that.getPrintWidth('610', xNum), that.yNum, '24', '0', 0, '本单实收:' + that.sales.alreadyEarn); } else { strCmd += blesdk.addCPCLSETMAG(1, 2); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 70, '24', '0', 0, '本单应收:' + that.sales.realAmount + '(' + that.convertToChineseNumeral(that.sales.realAmount) + ')'); strCmd += blesdk.addCPCLText(that.getPrintWidth('610', xNum), that.yNum, '24', '0', 0, '本单实收:' + that.sales.alreadyEarn); } if (that.yNum + 114 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 114 >= 1990 ? 1990 : this.printHeight - that.yNum + 114, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 2); if (that.sales.noEarn >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 70, '24', '0', 0, '本单欠款:' + that.sales.noEarn + '(' + that.convertToChineseNumeral(that.sales.noEarn) + ')'); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 70, '24', '0', 0, '本单余额:' + Math.abs(that.sales.noEarn) + '(' + that.convertToChineseNumeral(Math.abs(that.sales.noEarn)) + ')'); } if (that.dealingsRecord.balanceDue >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('610', xNum), that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord.balanceDue); } else if (that.dealingsRecord.balanceDue < 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('610', xNum), that.yNum, '24', '0', 0, '累计余额:' + Math.abs(that.dealingsRecord.balanceDue)); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('610', xNum), that.yNum, '24', '0', 0, '累计欠款:0'); } } else { strCmd += blesdk.addCPCLSETMAG(1, 2); if (that.sales.noEarn >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 70, '24', '0', 0, '本单欠款:' + that.sales.noEarn + '(' + that.convertToChineseNumeral(that.sales.noEarn) + ')'); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 70, '24', '0', 0, '本单余额:' + Math.abs(that.sales.noEarn) + '(' + that.convertToChineseNumeral(Math.abs(that.sales.noEarn)) + ')'); } if (that.dealingsRecord.balanceDue >= 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('610', xNum), that.yNum, '24', '0', 0, '累计欠款:' + that.dealingsRecord.balanceDue); } else if (that.dealingsRecord.balanceDue < 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('610', xNum), that.yNum, '24', '0', 0, '累计余额:' + Math.abs(that.dealingsRecord.balanceDue)); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('610', xNum), that.yNum, '24', '0', 0, '累计欠款:0'); } } } if (that.yNum + 40 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 40 >= 1990 ? 1990 : this.printHeight - that.yNum + 40, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, '-----------------------------------------------------------------------------------'); } else { strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 40, '24', '0', 0, '-----------------------------------------------------------------------------------'); } if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 1); if (that.sales.remark) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.countPrint(), '24', '0', 0, '订单备注:' + that.sales.remark); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.countPrint(), '24', '0', 0, '-----------------------------------------------------------------------------------'); } } else { strCmd += blesdk.addCPCLSETMAG(1, 1); if (that.sales.remark) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.countPrint(), '24', '0', 0, '订单备注:' + that.sales.remark); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.countPrint(), '24', '0', 0, '-----------------------------------------------------------------------------------'); } } //店铺地址 strCmd += blesdk.addCPCLSETMAG(1, 1); if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 1); for (var _i6 = 0; _i6 < this.addressArr.length; _i6++) { // strCmd += blesdk.addCPCLText(that.getPrintWidth(,xNum) '50', yNum += 40, '24', '0', 0, this.addressArr[i]) if (_i6 == 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '店铺地址:' + this.addressArr[_i6]); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, this.addressArr[_i6]); } } } else { for (var _i7 = 0; _i7 < this.addressArr.length; _i7++) { // strCmd += blesdk.addCPCLText(that.getPrintWidth(,xNum) '50', yNum += 40, '24', '0', 0, this.addressArr[i]) if (_i7 == 0) { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, '店铺地址:' + this.addressArr[_i7]); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.yNum += 30, '24', '0', 0, this.addressArr[_i7]); } } } //店铺电话 strCmd += blesdk.addCPCLSETMAG(1, 1); if (this.shopId == '1820391948796694529' || this.shopId == '1848966744035692545' || this.shopId == '1850038419279974400') { if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.countPrint(), '24', '0', 0, '店铺电话:' + this.jinjuPhone); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.countPrint(), '24', '0', 0, '店铺电话:' + this.jinjuPhone); } } else if (this.shopId == '1834512626093264897') { if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.countPrint(), '24', '0', 0, '店铺电话:13191998128'); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.countPrint(), '24', '0', 0, '店铺电话:13191998128'); } } else { if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.countPrint(), '24', '0', 0, '店铺电话:' + (uni.getStorageSync('shopOwnerPhone') ? uni.getStorageSync('shopOwnerPhone') : uni.getStorageSync('username'))); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.countPrint(), '24', '0', 0, '店铺电话:' + (uni.getStorageSync('shopOwnerPhone') ? uni.getStorageSync('shopOwnerPhone') : uni.getStorageSync('username'))); } } //物流 if (this.sales.companyName != null) { strCmd += blesdk.addCPCLSETMAG(1, 1); if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.countPrint(), '24', '0', 0, '发货方式:' + this.sales.companyName + ' ' + this.sales.companyPhone); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.countPrint(), '24', '0', 0, '发货方式:' + this.sales.companyName + ' ' + this.sales.companyPhone); } } //店铺备注 if (this.shopRemark.length > 0) { for (var _i8 = 0; _i8 < this.shopRemark.length; _i8++) { if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.countPrint(), '24', '0', 0, this.shopRemark[_i8]); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.countPrint(), '24', '0', 0, this.shopRemark[_i8]); } } } if (that.yNum + 64 >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); strCmd = blesdk.CreatCPCLPage(1080, this.printHeight - that.yNum + 64 >= 1990 ? 1990 : this.printHeight - that.yNum + 64, 1, 0, 162); that.yNum = 0; pageNum++; strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.countPrint(), '24', '0', 0, '-----------------------------------------------------------------------------------'); } else { strCmd += blesdk.addCPCLText(that.getPrintWidth('0', xNum), that.countPrint(), '24', '0', 0, '-----------------------------------------------------------------------------------'); } var codeHeightPlus = 0; if (uni.getStorageSync('shopId') == '1890655721893269507' || uni.getStorageSync('shopId') == '1844355592815251456') { //原创家二维码放大了 codeHeightPlus = that.yNum + 372; } else { codeHeightPlus = that.yNum + 300; } if (codeHeightPlus >= 1990) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); var HeightPlus = 0; if (uni.getStorageSync('shopId') == '1890655721893269507' || uni.getStorageSync('shopId') == '1844355592815251456') { //原创家二维码放大了 HeightPlus = this.printHeight - that.yNum + 322; } else { HeightPlus = this.printHeight - that.yNum + 270; } strCmd = blesdk.CreatCPCLPage(1080, HeightPlus >= 1990 ? 1990 : HeightPlus, 1, 0, 162); that.yNum = 0; pageNum++; if (that.qrArr.length != 0) { //店铺微信/微信收款/支付宝收款/收款码收款(店铺,微信,支付,收款) for (var _i9 = 0; _i9 < that.qrArr.length; _i9++) { //店铺二维码 if (_i9 == 0) { strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth(that.countWidth(_i9, 900 / that.qrArr.length), xNum), that.yNum += 40, '24', '0', 0, that.qrArr[_i9].name); if (uni.getStorageSync('shopId') == '1890655721893269507' || uni.getStorageSync('shopId') == '1844355592815251456') { strCmd += blesdk.addCPCLQRCode(that.getPrintWidth(that.countWidth(_i9, 900 / that.qrArr.length), xNum), that.yNum += 40, that.qrArr[_i9].level, '2', 6, that.qrArr[_i9].path); //二维码 } else { strCmd += blesdk.addCPCLQRCode(that.getPrintWidth(that.countWidth(_i9, 900 / that.qrArr.length), xNum), that.yNum += 40, that.qrArr[_i9].level, '2', 4, that.qrArr[_i9].path); //二维码 } } else { strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth(that.countWidth(_i9, 900 / that.qrArr.length), xNum), that.yNum -= 40, '24', '0', 0, that.qrArr[_i9].name); if (uni.getStorageSync('shopId') == '1890655721893269507' || uni.getStorageSync('shopId') == '1844355592815251456') { strCmd += blesdk.addCPCLQRCode(that.getPrintWidth(that.countWidth(_i9, 900 / that.qrArr.length), xNum), that.yNum += 40, that.qrArr[_i9].level, '2', 6, that.qrArr[_i9].path); //二维码 } else { strCmd += blesdk.addCPCLQRCode(that.getPrintWidth(that.countWidth(_i9, 900 / that.qrArr.length), xNum), that.yNum += 40, that.qrArr[_i9].level, '2', 4, that.qrArr[_i9].path); //二维码 } } if (that.qrArr.length == _i9 + 1) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); } } } else { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); } } else { if (that.qrArr.length != 0) { //店铺微信/微信收款/支付宝收款/收款码收款(店铺,微信,支付,收款) for (var _i10 = 0; _i10 < that.qrArr.length; _i10++) { //店铺二维码 if (_i10 == 0) { strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth(that.countWidth(_i10, 900 / that.qrArr.length), xNum), that.yNum += 40, '24', '0', 0, that.qrArr[_i10].name); if (uni.getStorageSync('shopId') == '1890655721893269507' || uni.getStorageSync('shopId') == '1844355592815251456') { strCmd += blesdk.addCPCLQRCode(that.getPrintWidth(that.countWidth(_i10, 900 / that.qrArr.length), xNum), that.yNum += 40, that.qrArr[_i10].level, '2', 6, that.qrArr[_i10].path); //二维码 } else { strCmd += blesdk.addCPCLQRCode(that.getPrintWidth(that.countWidth(_i10, 900 / that.qrArr.length), xNum), that.yNum += 40, that.qrArr[_i10].level, '2', 4, that.qrArr[_i10].path); //二维码 } } else { strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLText(that.getPrintWidth(that.countWidth(_i10, 900 / that.qrArr.length), xNum), that.yNum -= 40, '24', '0', 0, that.qrArr[_i10].name); if (uni.getStorageSync('shopId') == '1890655721893269507' || uni.getStorageSync('shopId') == '1844355592815251456') { strCmd += blesdk.addCPCLQRCode(that.getPrintWidth(that.countWidth(_i10, 900 / that.qrArr.length), xNum), that.yNum += 40, that.qrArr[_i10].level, '2', 6, that.qrArr[_i10].path); //二维码 } else { strCmd += blesdk.addCPCLQRCode(that.getPrintWidth(that.countWidth(_i10, 900 / that.qrArr.length), xNum), that.yNum += 40, that.qrArr[_i10].level, '2', 4, that.qrArr[_i10].path); //二维码 } } if (that.qrArr.length == _i10 + 1) { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); } } } else { strCmd += blesdk.addCPCLPrint(); that.bufferData.push(strCmd); } } this.$nextTick(function () { if (uni.getStorageSync('shopName') == '杰娜世家') { that.changePrintCount(); } that.bufferData = []; }); }, changePrintCount: function changePrintCount() { var that = this; that.tui.request("/app/sale/updatePrintCount", "post", { saleId: this.saleId }, false, true).then(function (res) { if (res.code == 200) { var pages = getCurrentPages(); var prevPage = pages[pages.length - 2]; for (var i = 0; i < prevPage.$vm.inventoryList.length; i++) { if (prevPage.$vm.inventoryList[i].id == that.sales.id) { prevPage.$vm.inventoryList[i].printCount += 1; } } uni.showLoading({ title: '打印中...' }); } else { that.tui.toast(res.message); } }).catch(function (res) {}); }, countWidth: function countWidth(num, len) { return num * len; }, replaceCharAfterNumber: function replaceCharAfterNumber(str, charToFind, charToReplace) { // 正则表达式匹配字符前是否有数字,并且该字符与charToFind相同 var regex = new RegExp("\\d".concat(charToFind), 'g'); // 使用replace方法进行替换 return str.replace(regex, function (match) { // 将匹配到的字符中的指定字符替换为charToReplace return match.replace(charToFind, charToReplace); }); }, convertImageToBitmap: function convertImageToBitmap(imagePath) { var _this14 = this; return new Promise(function (resolve, reject) { var ctx = uni.createCanvasContext('myCanvas1', _this14); uni.getImageInfo({ src: imagePath, success: function success(res) { // 设置画布的宽高为图片的宽高 ctx.width = res.width; ctx.height = res.height; // 绘制图片 ctx.drawImage(res.path, 0, 0, res.width, res.height); // 将绘制的内容转为位图数据 ctx.getImageData(0, 0, res.width, res.height, function (imageData) { resolve(imageData); }, reject); }, fail: reject }); }); }, goPrint: function goPrint(type) { var _this15 = this; var strCmd = ''; strCmd = blesdk.CreatCPCLPage(1080, 1040, 1, 1); strCmd += blesdk.addCPCLSETMAG(3, 3); blesdk.addCPCLSETBOLD('bold'); strCmd += blesdk.addCPCLLocation(2); strCmd += blesdk.addCPCLText('0', '30', '24', '0', 0, '沧州明珠商贸城--快衣店'); strCmd += blesdk.addCPCLSETMAG(2, 2); strCmd += blesdk.addCPCLLocation(0); blesdk.addCPCLSETBOLD('bold'); strCmd += blesdk.addCPCLText('50', '150', '24', '0', 0, '收货人:' + (0, _global.maskShopName)(this.sales.userName)); strCmd += blesdk.addCPCLSETMAG(2, 2); strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLText('50', '230', '24', '0', 0, '电话:' + (0, _global.maskPhone)(this.order.phone)); strCmd += blesdk.addCPCLText('50', '310', '24', '0', 0, '编号:' + this.sales.id); if (this.sales.province) { strCmd += blesdk.addCPCLSETMAG(2, 2); blesdk.addCPCLSETBOLD('bold'); strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLText('50', '390', '24', '0', 0, this.sales.province + '/' + this.sales.city + '/' + this.sales.area); } strCmd += blesdk.addCPCLSETMAG(2, 2); strCmd += blesdk.addCPCLLocation(0); if (type == 'confirm') { strCmd += blesdk.addCPCLText('50', '470', '24', '0', 0, "*****"); } else { if (this.sales.receiveAddress) { if (this.sales.receiveAddress.length > 20) { var position = 20; var part1 = this.sales.receiveAddress.substring(0, position); var part2 = this.sales.receiveAddress.substring(position); strCmd += blesdk.addCPCLText('50', '470', '24', '0', 0, part1); strCmd += blesdk.addCPCLText('50', '550', '24', '0', 0, part2); } else { strCmd += blesdk.addCPCLText('50', '470', '24', '0', 0, this.sales.receiveAddress); } } } strCmd += blesdk.addCPCLSETMAG(2, 2); strCmd += blesdk.addCPCLLocation(0); blesdk.addCPCLSETBOLD('bold'); strCmd += blesdk.addCPCLText('0', '600', '24', '0', 0, '——————————————————————————————'); strCmd += blesdk.addCPCLText('50', '680', '24', '0', 0, '发货方式:' + (this.sales.companyName ? this.sales.companyName : '暂无')); strCmd += blesdk.addCPCLSETMAG(2, 2); strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLText('0', '760', '24', '0', 0, '——————————————————————————————'); strCmd += blesdk.addCPCLText('50', '840', '24', '0', 0, '店铺:' + this.sales.shopName); strCmd += blesdk.addCPCLText('50', '920', '24', '0', 0, this.sales.createByPhone); var yNum = 920; strCmd += blesdk.addCPCLSETMAG(1, 1); strCmd += blesdk.addCPCLLocation(0); for (var i = 0; i < this.addressArr.length; i++) { strCmd += blesdk.addCPCLText('50', yNum += 60, '24', '0', 0, this.addressArr[i]); } strCmd += blesdk.addCPCLLocation(0); strCmd += blesdk.addCPCLPrint(); this.bufferData.push(strCmd); this.xierushuju(this.bufferData); this.$nextTick(function () { _this15.bufferData = []; uni.hideLoading(); }); }, downloadImg: function downloadImg() { var that = this; var _loop5 = function _loop5(i) { uni.showLoading({ title: '保存中...', mask: true }); uni.downloadFile({ url: that.list[i].productPicture, success: function success(res) { uni.saveImageToPhotosAlbum({ filePath: res.tempFilePath, success: function success() { var _loop6 = function _loop6(m) { uni.downloadFile({ url: that.list[i].productPictures[m].productPicture, success: function success(res) { uni.saveImageToPhotosAlbum({ filePath: res.tempFilePath, success: function success() { if (that.list[i].productPictures.length == m + 1) { uni.hideLoading(); } }, fail: function fail() { uni.hideLoading(); } }); }, fail: function fail() { uni.hideLoading(); } }); }; for (var m = 0; m < that.list[i].productPictures.length; m++) { _loop6(m); } setTimeout(function (res) { uni.hideLoading(); }, 1000); }, fail: function fail(err) { uni.hideLoading(); } }); }, fail: function fail() { uni.hideLoading(); } }); }; for (var i = 0; i < that.list.length; i++) { _loop5(i); } }, createQRCode: function createQRCode(qrCodeText) { var that = this; // 生成二维码图片 QRCode.toDataURL(qrCodeText, { errorCorrectionLevel: 'H' }, function (err, url) { if (err) console.error(err); that.qrCodeImage = url; }); }, xierushuju: function xierushuju() { var that = this; //写入数据 if (this.defaultText == '打印小票') { that.$emit('onPrintSmall'); } else if (this.defaultText == '确认打印') { that.$emit('goPrint'); } else { that.$emit('onPrint'); } that.$nextTick(function () { var dataStr = ''; for (var m = 0; m < that.bufferData.length; m++) { dataStr += that.bufferData[m]; } var maxChunk = that.deviceType == 'android' ? 20 : 180; var delay = that.deviceType == 'android' ? 20 : 180; var buffer = _printUtilGBK.default.strToGBKByte(dataStr); for (var i = 0, j = 0, length = buffer.byteLength; i < length; i += maxChunk, j++) { var subPackage = buffer.slice(i, i + maxChunk <= length ? i + maxChunk : length); setTimeout(that._writeBLECharacteristicValue, j * delay, subPackage); } }); return; }, _writeBLECharacteristicValue: function _writeBLECharacteristicValue(buffer) { var that = this; wx.writeBLECharacteristicValue({ deviceId: uni.getStorageSync('deviceId'), serviceId: uni.getStorageSync('serviceId'), characteristicId: uni.getStorageSync('characteristicId'), value: buffer, success: function success(res) {}, fail: function fail(res) { wx.closeBLEConnection({ deviceId: uni.getStorageSync('deviceId'), success: function success(res) {} }); if (uni.getStorageSync('deviceId')) { that.xierushuju(); } else { that.jiantingshebei(); } } }); uni.hideLoading(); }, //打印贴包单 onPrint: function onPrint(opt) { var that = this; uni.showModal({ title: "提示", content: "要隐藏客户信息吗?", cancelText: '不隐藏', confirmText: '隐藏', success: function success(res) { if (res.confirm) { that.goPrint('confirm'); } if (res.cancel) { that.goPrint('cancel'); } } }); }, bigFWHPic: function bigFWHPic() { uni.previewImage({ urls: [this.FWHPic] }); }, //计算打印机当前行高度 countPrint: function countPrint() { // if ((this.yNum + 50) >= 1040) { // return this.yNum += 50 // } else { return this.yNum += 40; // } }, //截取 slicePrint: function slicePrint(val) { var name = ''; if (typeof val == 'string') { var newObj = JSON.parse(val); for (var as in newObj) { name += newObj[as] + '/'; } } return name; }, makeCall: function makeCall(phone) { uni.makePhoneCall({ phoneNumber: phone + '' }); }, changeAddress: function changeAddress(e) { this.changeA = e.detail.value; }, //点击图片放大 showImage: function showImage() { uni.previewImage({ urls: [this.orderXd.orderPicture], current: this.orderXd.orderPicture }); }, getNoPay: function getNoPay(en) { if (en != undefined) { if (0 < en && en <= this.sales.noEarn) { this.sales.noEarn = this.sales.newEarn - en; } else { uni.showToast({ title: '请输入正确金额', icon: "none" }); } } }, //发货方式选择 goPopleList: function goPopleList(popleType) { uni.navigateTo({ url: '/package1/index/peopleList?popleType=' + popleType }); }, //退款接口 getReturnOrder: function getReturnOrder(id) { var _this16 = this; return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() { var that; return _regenerator.default.wrap(function _callee5$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: that = _this16; _context5.next = 3; return _this16.tui.request("/app/return/list", "post", { remark: 3, saleId: id }, false, false).then(function (res) { if (res.code == 200 && res.result != null && res.result != undefined) { if (res.result != '') { _this16.inventoryList = res.result; _this16.returnPrice = 0; _this16.returnNum = 0; _this16.inventoryList.forEach(function (item) { _this16.returnPrice += item.totalAmount; _this16.returnNum += item.productCount; _this16.tui.request("/app/return/get/" + item.id, "GET", null, false, false).then(function (res) { if (res.code == 200 && res.result != null && res.result != undefined) { var _that$shopList; that.returnList.push(res.result); (_that$shopList = that.shopList).push.apply(_that$shopList, (0, _toConsumableArray2.default)(res.result.saleDetailDTOList)); for (var j = 0; j < res.result.saleDetailDTOList.length; j++) { var isZiMu = false; var isNumber = false; var colorList = new Map(); var sizeNumList = []; if (res.result.saleDetailDTOList[j].stockLogList1.length > 0) { for (var m = 0; m < res.result.saleDetailDTOList[j].stockLogList1.length; m++) { var attr = res.result.saleDetailDTOList[j].stockLogList1[m].attributeList; var newObj = JSON.parse(attr); for (var as in newObj) { if (as == '尺码' && that.isLetterOrDigit(newObj[as].replace(/码/g, '')) == 'Letter') { isZiMu = true; } if (as == '尺码' && that.isLetterOrDigit(newObj[as].replace(/码/g, '')) == 'Digit') { isNumber = true; } if (as == '尺码' && sizeNumList.indexOf(newObj[as].replace(/码/g, '')) == -1) { sizeNumList.push(newObj[as].replace(/码/g, '')); } if (as == '颜色') { if (colorList.has(newObj[as])) { colorList.get(newObj[as]).push(res.result.saleDetailDTOList[j].stockLogList1[m]); } else { var listChild = []; listChild.push(res.result.saleDetailDTOList[j].stockLogList1[m]); colorList.set(newObj[as], listChild); } } } } } var newStockList = []; if (isNumber) { sizeNumList = sizeNumList.sort(function (a, b) { return a - b; }); colorList.forEach(function (value, key) { for (var j = 0; j < sizeNumList.length; j++) { for (var m = 0; m < value.length; m++) { var newObj = JSON.parse(value[m].attributeList); var size = ''; var color = ''; for (var as in newObj) { if (as == '尺码') { size = newObj[as].replace(/码/g, ''); } } if (size == sizeNumList[j]) { newStockList.push(value[m]); value.splice(m, 1); break; } } } if (value.length > 0) { newStockList = newStockList.concat(value); } }); res.result.saleDetailDTOList[j].stockLogList1 = newStockList; } if (isZiMu) { colorList.forEach(function (value, key) { for (var j = 0; j < that.lettrList.length; j++) { for (var m = 0; m < value.length; m++) { var newObj = JSON.parse(value[m].attributeList); var size = ''; var color = ''; for (var as in newObj) { if (as == '尺码') { size = newObj[as].replace(/码/g, ''); } } if (size == that.lettrList[j]) { newStockList.push(value[m]); value.splice(m, 1); break; } } } if (value.length > 0) { newStockList = newStockList.concat(value); } }); res.result.saleDetailDTOList[j].stockLogList1 = newStockList; } var isTure = true; res.result.saleDetailDTOList[j].productCount = 0; for (var _m = 0; _m < res.result.saleDetailDTOList[j].stockLogList1.length; _m++) { res.result.saleDetailDTOList[j].productCount += res.result.saleDetailDTOList[j].stockLogList1[_m].productCount; res.result.saleDetailDTOList[j].stockLogList1[_m].isReturn = true; res.result.saleDetailDTOList[j].stockLogList1[_m].discountAmount = res.result.saleDetailDTOList[j].discountAmount; var tableData = { productSn: '【退】' + res.result.saleDetailDTOList[j].productSn, productName: res.result.saleDetailDTOList[j].productName, productCount: res.result.saleDetailDTOList[j].stockLogList1[_m].productCount, attributeList: res.result.saleDetailDTOList[j].stockLogList1[_m].attributeList, discountAmount: res.result.saleDetailDTOList[j].discountAmount }; that.listHeng.push(tableData); } for (var i = 0; i < that.newData.length; i++) { if (that.newData[i].productId == res.result.saleDetailDTOList[j].productId) { var _that$newData$i$stock; isTure = false; (_that$newData$i$stock = that.newData[i].stockLogList1).push.apply(_that$newData$i$stock, (0, _toConsumableArray2.default)(res.result.saleDetailDTOList[j].stockLogList1)); } } if (isTure) { that.newData.push(res.result.saleDetailDTOList[j]); } } _this16.$nextTick(function () { setTimeout(function (res) { var that = _this16; for (var _i11 = 0; _i11 < _this16.newData.length; _i11++) { that.newData[_i11].sizeList = []; var isZiMu = false; var isNumber = false; var sizeNumList = []; var notNum = []; that.newData[_i11].sizePrintList = new Map(); for (var _j = 0; _j < that.newData[_i11].stockLogList1.length; _j++) { var discountAmount = that.newData[_i11].discountAmount; var _newObj = JSON.parse(that.newData[_i11].stockLogList1[_j].attributeList); var printSize = new Map(); var color = ''; var statusAttr = '[销] '; if (that.newData[_i11].stockLogList1[_j].isReturn) { statusAttr = '[退] '; discountAmount = that.newData[_i11].stockLogList1[_j].discountAmount; } else if (that.newData[_i11].stockLogList1[_j].isPurchasedBefore == 1 && that.order.name != '散客') { statusAttr = '[补] '; } for (var _as in _newObj) { if (_as == '颜色') { color = statusAttr + _newObj[_as]; if (that.newData[_i11].sizePrintList.has(color) == true) { printSize = that.newData[_i11].sizePrintList.get(color); } else { that.newData[_i11].sizePrintList.set(color, printSize); } } if (_as == '尺码') { if (_newObj[_as].indexOf('码') != -1) { if (that.newData[_i11].sizeList.indexOf(_newObj[_as].substr(0, _newObj[_as].indexOf('码'))) == -1) { that.newData[_i11].sizeList.push(_newObj[_as].substr(0, _newObj[_as].indexOf('码'))); } that.newData[_i11].sizePrintList.get(color).set(_newObj[_as].substr(0, _newObj[_as].indexOf('码')), that.newData[_i11].stockLogList1[_j].productCount + ':' + discountAmount); } else { if (that.newData[_i11].sizeList.indexOf(_newObj[_as]) == -1) { that.newData[_i11].sizeList.push(_newObj[_as]); } that.newData[_i11].sizePrintList.get(color).set(_newObj[_as], that.newData[_i11].stockLogList1[_j].productCount + ':' + discountAmount); } } if (_as == '尺码' && that.isLetterOrDigit(_newObj[_as].replace(/码/g, '')) == 'Letter') { isZiMu = true; } if (_as == '尺码' && that.isLetterOrDigit(_newObj[_as].replace(/码/g, '')) == 'Digit') { isNumber = true; } if (_as == '尺码' && sizeNumList.indexOf(_newObj[_as].replace(/码/g, '')) == -1) { if (_as == '尺码' && that.isLetterOrDigit(_newObj[_as].replace(/码/g, '')) == 'Digit') { sizeNumList.push(_newObj[_as].replace(/码/g, '')); } else { if (notNum.indexOf(_newObj[_as].replace(/码/g, '')) == -1) { notNum.push(_newObj[_as].replace(/码/g, '')); } } } } } if (notNum.length > 0) { sizeNumList = sizeNumList.concat(notNum); } if (isZiMu) { var _newStockList = []; for (var j = 0; j < that.lettrList.length; j++) { for (var m = 0; m < that.newData[_i11].sizeList.length; m++) { if (that.newData[_i11].sizeList[m] == that.lettrList[j]) { _newStockList.push(that.newData[_i11].sizeList[m]); that.newData[_i11].sizeList.splice(m, 1); break; } } } if (that.newData[_i11].sizeList.length > 0) { _newStockList = _newStockList.concat(that.newData[_i11].sizeList); } that.newData[_i11].sizeList = _newStockList; } if (isNumber) { var _newStockList2 = []; sizeNumList = sizeNumList.sort(function (a, b) { return a - b; }); for (var j = 0; j < sizeNumList.length; j++) { for (var m = 0; m < that.newData[_i11].sizeList.length; m++) { if (that.newData[_i11].sizeList[m] == sizeNumList[j]) { _newStockList2.push(that.newData[_i11].sizeList[m]); that.newData[_i11].sizeList.splice(m, 1); break; } } } if (that.newData[_i11].sizeList.length > 0) { _newStockList2 = _newStockList2.concat(that.newData[_i11].sizeList); } that.newData[_i11].sizeList = _newStockList2; } //this.newData[i].sizeList = [...new Set(this.newData[i].sizeList)] } }, 500); setTimeout(function (res) { _this16.getPrintHeight(); }, 1000); }); } }).catch(function (res) {}); }); } else { for (var i = 0; i < that.list.length; i++) { for (var z = 0; z < that.list[i].stockLogList1.length; z++) { that.list[i].stockLogList1[z].maxNum = that.list[i].stockLogList1[z].productCount; } } setTimeout(function (res) { var that = _this16; for (var _i12 = 0; _i12 < _this16.newData.length; _i12++) { that.newData[_i12].sizeList = []; var isZiMu = false; var isNumber = false; var sizeNumList = []; var notNum = []; that.newData[_i12].sizePrintList = new Map(); for (var _j2 = 0; _j2 < that.newData[_i12].stockLogList1.length; _j2++) { var discountAmount = that.newData[_i12].discountAmount; var newObj = JSON.parse(that.newData[_i12].stockLogList1[_j2].attributeList); var printSize = new Map(); var color = ''; var statusAttr = '[销] '; if (that.newData[_i12].stockLogList1[_j2].isReturn) { statusAttr = '[退] '; discountAmount = that.newData[_i12].stockLogList1[_j2].discountAmount; } else if (that.newData[_i12].stockLogList1[_j2].isPurchasedBefore == 1 && that.order.name != '散客') { statusAttr = '[补] '; } for (var as in newObj) { if (as == '颜色') { color = statusAttr + newObj[as]; if (that.newData[_i12].sizePrintList.has(color) == true) { printSize = that.newData[_i12].sizePrintList.get(color); } else { that.newData[_i12].sizePrintList.set(color, printSize); } } if (as == '尺码') { if (newObj[as].indexOf('码') != -1) { if (that.newData[_i12].sizeList.indexOf(newObj[as].substr(0, newObj[as].indexOf('码'))) == -1) { that.newData[_i12].sizeList.push(newObj[as].substr(0, newObj[as].indexOf('码'))); } that.newData[_i12].sizePrintList.get(color).set(newObj[as].substr(0, newObj[as].indexOf('码')), that.newData[_i12].stockLogList1[_j2].productCount + ':' + discountAmount); } else { if (that.newData[_i12].sizeList.indexOf(newObj[as]) == -1) { that.newData[_i12].sizeList.push(newObj[as]); } that.newData[_i12].sizePrintList.get(color).set(newObj[as], that.newData[_i12].stockLogList1[_j2].productCount + ':' + discountAmount); } } if (as == '尺码' && that.isLetterOrDigit(newObj[as].replace(/码/g, '')) == 'Letter') { isZiMu = true; } if (as == '尺码' && that.isLetterOrDigit(newObj[as].replace(/码/g, '')) == 'Digit') { isNumber = true; } if (as == '尺码' && sizeNumList.indexOf(newObj[as].replace(/码/g, '')) == -1) { if (as == '尺码' && that.isLetterOrDigit(newObj[as].replace(/码/g, '')) == 'Digit') { sizeNumList.push(newObj[as].replace(/码/g, '')); } else { if (notNum.indexOf(newObj[as].replace(/码/g, '')) == -1) { notNum.push(newObj[as].replace(/码/g, '')); } } } } } if (notNum.length > 0) { sizeNumList = sizeNumList.concat(notNum); } if (isZiMu) { var newStockList = []; for (var j = 0; j < that.lettrList.length; j++) { for (var m = 0; m < that.newData[_i12].sizeList.length; m++) { if (that.newData[_i12].sizeList[m] == that.lettrList[j]) { newStockList.push(that.newData[_i12].sizeList[m]); that.newData[_i12].sizeList.splice(m, 1); break; } } } if (that.newData[_i12].sizeList.length > 0) { newStockList = newStockList.concat(that.newData[_i12].sizeList); } that.newData[_i12].sizeList = newStockList; } if (isNumber) { var _newStockList3 = []; sizeNumList = sizeNumList.sort(function (a, b) { return a - b; }); for (var j = 0; j < sizeNumList.length; j++) { for (var m = 0; m < that.newData[_i12].sizeList.length; m++) { if (that.newData[_i12].sizeList[m] == sizeNumList[j]) { _newStockList3.push(that.newData[_i12].sizeList[m]); that.newData[_i12].sizeList.splice(m, 1); break; } } } if (that.newData[_i12].sizeList.length > 0) { _newStockList3 = _newStockList3.concat(that.newData[_i12].sizeList); } that.newData[_i12].sizeList = _newStockList3; } //this.newData[i].sizeList = [...new Set(this.newData[i].sizeList)] } }, 500); _this16.$nextTick(function () { setTimeout(function (res) { _this16.getPrintHeight(); }, 1000); }); } } else { _this16.tui.toast(res.message); } }); case 3: case "end": return _context5.stop(); } } }, _callee5); }))(); }, checkBoxChange: function checkBoxChange() { if (this.radio1 == 2) { this.lbgName = []; this.changeA = ''; } }, open: function open() { this.popupShow = true; }, close: function close() { this.popupShow = false; }, returnGoods: function returnGoods() { if (this.isReturn) { // this.returnAmount = this.sAmout if (this.radio1 == 0 && this.changeA == '') { this.tui.toast("请输入取货地址"); return; } this.$refs.returnClose.val = this.returnAmount; this.$refs.returnDialog.open(); } else { this.isReturn = true; } }, getPrice: function getPrice(price) { price = price || 0; return price.toFixed(2); }, logistics: function logistics() { this.tui.href("/pages/my/logistics/logistics"); }, // 取消订单 cancelOrder: function cancelOrder(type) { var _this17 = this; this.tui.modal("提示", "您确定要取消吗?", true, function (res) { if (res) { var data = {}, url; if (type == 'qxdd') { data = { status: 2, orderId: _this17.sales.id }; url = '/app/sale/status'; } else { if (_this17.sales.status == '0' || _this17.sales.status == '1') { //开单取消配送 data = { status: 4, orderId: _this17.sales.id }; url = '/app/sale/status'; } else { data = { orderId: _this17.inventoryList[0].id }; url = '/app/return/cancelOrder'; } } _this17.tui.request(url, "POST", data, true, true).then(function (res1) { if (res1.code == 200) { _this17.tui.toast("取消成功"); uni.navigateBack(); } else { _this17.tui.toast(res.message); } }).catch(function (res1) {}); } }); } } }; exports.default = _default; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"], __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"])) /***/ }), /***/ 499: /*!***********************************************************************************************!*\ !*** C:/文档/distribution-uni/package1/index/orderDetail.vue?vue&type=style&index=0&lang=scss& ***! \***********************************************************************************************/ /*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_orderDetail_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src??ref--8-oneOf-1-3!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../软件/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./orderDetail.vue?vue&type=style&index=0&lang=scss& */ 500); /* harmony import */ var _HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_orderDetail_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_orderDetail_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__); /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_orderDetail_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_orderDetail_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); /* harmony default export */ __webpack_exports__["default"] = (_HBuilderX_plugins_uniapp_cli_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_HBuilderX_plugins_uniapp_cli_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_stylePostLoader_js_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_2_HBuilderX_plugins_uniapp_cli_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_8_oneOf_1_5_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_orderDetail_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0___default.a); /***/ }), /***/ 500: /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-2!./node_modules/postcss-loader/src??ref--8-oneOf-1-3!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--8-oneOf-1-5!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!C:/文档/distribution-uni/package1/index/orderDetail.vue?vue&type=style&index=0&lang=scss& ***! \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { // extracted by mini-css-extract-plugin if(false) { var cssReload; } /***/ }) },[[493,"common/runtime","common/vendor"]]]); //# sourceMappingURL=../../../.sourcemap/mp-weixin/package1/index/orderDetail.js.map