You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6663 lines
315 KiB
6663 lines
315 KiB
(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["package1/AI/voiceInventory"],{
|
|
|
|
/***/ 557:
|
|
/*!********************************************************************************!*\
|
|
!*** C:/文档/distribution-uni/main.js?{"page":"package1%2FAI%2FvoiceInventory"} ***!
|
|
\********************************************************************************/
|
|
/*! 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 _voiceInventory = _interopRequireDefault(__webpack_require__(/*! ./package1/AI/voiceInventory.vue */ 558));
|
|
// @ts-ignore
|
|
wx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;
|
|
createPage(_voiceInventory.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"]))
|
|
|
|
/***/ }),
|
|
|
|
/***/ 558:
|
|
/*!*************************************************************!*\
|
|
!*** C:/文档/distribution-uni/package1/AI/voiceInventory.vue ***!
|
|
\*************************************************************/
|
|
/*! no static exports found */
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
"use strict";
|
|
__webpack_require__.r(__webpack_exports__);
|
|
/* harmony import */ var _voiceInventory_vue_vue_type_template_id_46f5b38a___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./voiceInventory.vue?vue&type=template&id=46f5b38a& */ 559);
|
|
/* harmony import */ var _voiceInventory_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./voiceInventory.vue?vue&type=script&lang=js& */ 561);
|
|
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _voiceInventory_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 _voiceInventory_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
|
/* harmony import */ var _voiceInventory_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./voiceInventory.vue?vue&type=style&index=0&lang=scss& */ 563);
|
|
/* 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"])(
|
|
_voiceInventory_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
|
|
_voiceInventory_vue_vue_type_template_id_46f5b38a___WEBPACK_IMPORTED_MODULE_0__["render"],
|
|
_voiceInventory_vue_vue_type_template_id_46f5b38a___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
|
|
false,
|
|
null,
|
|
null,
|
|
null,
|
|
false,
|
|
_voiceInventory_vue_vue_type_template_id_46f5b38a___WEBPACK_IMPORTED_MODULE_0__["components"],
|
|
renderjs
|
|
)
|
|
|
|
component.options.__file = "package1/AI/voiceInventory.vue"
|
|
/* harmony default export */ __webpack_exports__["default"] = (component.exports);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 559:
|
|
/*!********************************************************************************************!*\
|
|
!*** C:/文档/distribution-uni/package1/AI/voiceInventory.vue?vue&type=template&id=46f5b38a& ***!
|
|
\********************************************************************************************/
|
|
/*! 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_voiceInventory_vue_vue_type_template_id_46f5b38a___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!./voiceInventory.vue?vue&type=template&id=46f5b38a& */ 560);
|
|
/* 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_voiceInventory_vue_vue_type_template_id_46f5b38a___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_voiceInventory_vue_vue_type_template_id_46f5b38a___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_voiceInventory_vue_vue_type_template_id_46f5b38a___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_voiceInventory_vue_vue_type_template_id_46f5b38a___WEBPACK_IMPORTED_MODULE_0__["components"]; });
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 560:
|
|
/*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
|
!*** ./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/AI/voiceInventory.vue?vue&type=template&id=46f5b38a& ***!
|
|
\********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
|
/*! 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 = {
|
|
uniIcons: function () {
|
|
return Promise.all(/*! import() | uni_modules/uni-icons/components/uni-icons/uni-icons */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-icons/components/uni-icons/uni-icons.vue */ 1065))
|
|
},
|
|
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))
|
|
},
|
|
uGrid: function () {
|
|
return Promise.all(/*! import() | uni_modules/uview-ui/components/u-grid/u-grid */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u-grid/u-grid")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u-grid/u-grid.vue */ 1041))
|
|
},
|
|
uGridItem: function () {
|
|
return Promise.all(/*! import() | uni_modules/uview-ui/components/u-grid-item/u-grid-item */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u-grid-item/u-grid-item")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u-grid-item/u-grid-item.vue */ 1049))
|
|
},
|
|
uIcon: function () {
|
|
return Promise.all(/*! import() | uni_modules/uview-ui/components/u-icon/u-icon */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uview-ui/components/u-icon/u-icon")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uview-ui/components/u-icon/u-icon.vue */ 1140))
|
|
},
|
|
uniDatetimePicker: function () {
|
|
return Promise.all(/*! import() | uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker */[__webpack_require__.e("common/vendor"), __webpack_require__.e("uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker")]).then(__webpack_require__.bind(null, /*! @/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue */ 1195))
|
|
},
|
|
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))
|
|
},
|
|
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))
|
|
},
|
|
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))
|
|
},
|
|
}
|
|
} 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(Array.from(_vm.carList), function (value, key) {
|
|
var $orig = _vm.__get_orig(value)
|
|
var g0 =
|
|
value[1].productPictures != "" ? value[1].productPictures.length : null
|
|
var g1 = value[1].isNew ? _vm.carList.get(value[0]) : null
|
|
var g2 = value[1].isNew ? _vm.carList.get(value[0]) : null
|
|
var l0 = _vm.__map(
|
|
Array.from(value[1].stockLogList),
|
|
function (values, keys) {
|
|
var $orig = _vm.__get_orig(values)
|
|
var m0 = _vm.numData(values[0])
|
|
var m1 = _vm.numData(values[0])
|
|
return {
|
|
$orig: $orig,
|
|
m0: m0,
|
|
m1: m1,
|
|
}
|
|
}
|
|
)
|
|
return {
|
|
$orig: $orig,
|
|
g0: g0,
|
|
g1: g1,
|
|
g2: g2,
|
|
l0: l0,
|
|
}
|
|
})
|
|
var g3 =
|
|
_vm.userType == 0 && _vm.zhiqianqiankuan < 0
|
|
? Math.abs(_vm.zhiqianqiankuan)
|
|
: null
|
|
var g4 =
|
|
_vm.leijiqiankuan < 0 && _vm.userType == 0
|
|
? Math.abs(_vm.leijiqiankuan)
|
|
: null
|
|
var g5 =
|
|
_vm.leijiqiankuan < 0 && _vm.userType == 0
|
|
? Math.abs(_vm.leijiqiankuan)
|
|
: null
|
|
var g6 = _vm.noPay < 0 && _vm.userType == 0 ? Math.abs(_vm.noPay) : null
|
|
var g7 = _vm.noPay < 0 && _vm.userType == 0 ? Math.abs(_vm.noPay) : null
|
|
var l2 = Array.from(_vm.carList)
|
|
if (!_vm._isMounted) {
|
|
_vm.e0 = function ($event, value) {
|
|
var _temp = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp2 = _temp.eventParams || _temp["event-params"],
|
|
value = _temp2.value
|
|
var _temp, _temp2
|
|
return _vm.uploadFilePromise(value)
|
|
}
|
|
_vm.e1 = function ($event, value) {
|
|
var _temp3 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp4 = _temp3.eventParams || _temp3["event-params"],
|
|
value = _temp4.value
|
|
var _temp3, _temp4
|
|
return _vm.uploadFilePromise(value)
|
|
}
|
|
_vm.e2 = function ($event, value) {
|
|
var _temp5 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp6 = _temp5.eventParams || _temp5["event-params"],
|
|
value = _temp6.value
|
|
var _temp5, _temp6
|
|
return _vm.getZhuBigImage(value[1].productPicture)
|
|
}
|
|
_vm.e3 = function ($event, value) {
|
|
var _temp7 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp8 = _temp7.eventParams || _temp7["event-params"],
|
|
value = _temp8.value
|
|
var _temp7, _temp8
|
|
return _vm.uploadFilePromise(value)
|
|
}
|
|
_vm.e4 = function ($event, value) {
|
|
var _temp9 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp10 = _temp9.eventParams || _temp9["event-params"],
|
|
value = _temp10.value
|
|
var _temp9, _temp10
|
|
return _vm.getZhuBigImage(value[1].productPicture)
|
|
}
|
|
_vm.e5 = function ($event, value) {
|
|
var _temp11 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp12 = _temp11.eventParams || _temp11["event-params"],
|
|
value = _temp12.value
|
|
var _temp11, _temp12
|
|
return _vm.uploadFilePromise(value)
|
|
}
|
|
_vm.e6 = function ($event, value) {
|
|
var _temp13 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp14 = _temp13.eventParams || _temp13["event-params"],
|
|
value = _temp14.value
|
|
var _temp13, _temp14
|
|
return _vm.uploadFilePromise(value)
|
|
}
|
|
_vm.e7 = function ($event, value) {
|
|
var _temp15 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp16 = _temp15.eventParams || _temp15["event-params"],
|
|
value = _temp16.value
|
|
var _temp15, _temp16
|
|
$event.stopPropagation()
|
|
return _vm.delShop(value[0])
|
|
}
|
|
_vm.e8 = function ($event, value) {
|
|
var _temp17 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp18 = _temp17.eventParams || _temp17["event-params"],
|
|
value = _temp18.value
|
|
var _temp17, _temp18
|
|
return _vm.toggle("mergePopup", value[0])
|
|
}
|
|
_vm.e9 = function ($event, value) {
|
|
var _temp19 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp20 = _temp19.eventParams || _temp19["event-params"],
|
|
value = _temp20.value
|
|
var _temp19, _temp20
|
|
return _vm.pictureAdd(value[0])
|
|
}
|
|
_vm.e10 = function ($event, value) {
|
|
var _temp21 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp22 = _temp21.eventParams || _temp21["event-params"],
|
|
value = _temp22.value
|
|
var _temp21, _temp22
|
|
return _vm.getName($event, value[0])
|
|
}
|
|
_vm.e11 = function ($event, value) {
|
|
var _temp23 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp24 = _temp23.eventParams || _temp23["event-params"],
|
|
value = _temp24.value
|
|
var _temp23, _temp24
|
|
return _vm.getName($event, value[0])
|
|
}
|
|
_vm.e12 = function ($event, value) {
|
|
var _temp25 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp26 = _temp25.eventParams || _temp25["event-params"],
|
|
value = _temp26.value
|
|
var _temp25, _temp26
|
|
$event = $event.target.value
|
|
return _vm.__set_model(_vm.carList.get(value[0]), "productSn", $event, [])
|
|
}
|
|
_vm.e13 = function ($event, value) {
|
|
var _temp27 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp28 = _temp27.eventParams || _temp27["event-params"],
|
|
value = _temp28.value
|
|
var _temp27, _temp28
|
|
return _vm.sninput($event, value[0])
|
|
}
|
|
_vm.e14 = function ($event, value) {
|
|
var _temp29 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp30 = _temp29.eventParams || _temp29["event-params"],
|
|
value = _temp30.value
|
|
var _temp29, _temp30
|
|
return _vm.getSnIsRepeat($event, value[0])
|
|
}
|
|
_vm.e15 = function ($event, value) {
|
|
var _temp31 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp32 = _temp31.eventParams || _temp31["event-params"],
|
|
value = _temp32.value
|
|
var _temp31, _temp32
|
|
$event = $event.target.value
|
|
return _vm.__set_model(value[1], "productSn", $event, [])
|
|
}
|
|
_vm.e16 = function ($event, value) {
|
|
var _temp33 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp34 = _temp33.eventParams || _temp33["event-params"],
|
|
value = _temp34.value
|
|
var _temp33, _temp34
|
|
return _vm.generateSn(value[0])
|
|
}
|
|
_vm.e17 = function ($event, value) {
|
|
var _temp35 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp36 = _temp35.eventParams || _temp35["event-params"],
|
|
value = _temp36.value
|
|
var _temp35, _temp36
|
|
return _vm.toggle("typePopup", value[0])
|
|
}
|
|
_vm.e18 = function ($event, value) {
|
|
var _temp37 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp38 = _temp37.eventParams || _temp37["event-params"],
|
|
value = _temp38.value
|
|
var _temp37, _temp38
|
|
return _vm.clickCollapse($event, value[0])
|
|
}
|
|
_vm.e19 = function ($event, value) {
|
|
var _temp39 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp40 = _temp39.eventParams || _temp39["event-params"],
|
|
value = _temp40.value
|
|
var _temp39, _temp40
|
|
return _vm.obtainPrice($event, "danjia", value[0])
|
|
}
|
|
_vm.e20 = function ($event, value) {
|
|
var _temp41 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp42 = _temp41.eventParams || _temp41["event-params"],
|
|
value = _temp42.value
|
|
var _temp41, _temp42
|
|
$event = $event.target.value
|
|
return _vm.__set_model(value[1], "purchasePrice", $event, [])
|
|
}
|
|
_vm.e21 = function ($event, value) {
|
|
var _temp43 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp44 = _temp43.eventParams || _temp43["event-params"],
|
|
value = _temp44.value
|
|
var _temp43, _temp44
|
|
return _vm.PriceAndWho($event, value[0], "pi")
|
|
}
|
|
_vm.e22 = function ($event, value) {
|
|
var _temp45 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp46 = _temp45.eventParams || _temp45["event-params"],
|
|
value = _temp46.value
|
|
var _temp45, _temp46
|
|
return _vm.obtainPrice($event, "pifa", value[0])
|
|
}
|
|
_vm.e23 = function ($event, value) {
|
|
var _temp47 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp48 = _temp47.eventParams || _temp47["event-params"],
|
|
value = _temp48.value
|
|
var _temp47, _temp48
|
|
$event = $event.target.value
|
|
return _vm.__set_model(value[1], "wholesalePrice", $event, [])
|
|
}
|
|
_vm.e24 = function ($event, value) {
|
|
var _temp49 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp50 = _temp49.eventParams || _temp49["event-params"],
|
|
value = _temp50.value
|
|
var _temp49, _temp50
|
|
return _vm.PriceAndWho($event, value[0])
|
|
}
|
|
_vm.e25 = function ($event, value) {
|
|
var _temp51 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp52 = _temp51.eventParams || _temp51["event-params"],
|
|
value = _temp52.value
|
|
var _temp51, _temp52
|
|
return _vm.obtainPrice($event, "lingshou", value[0])
|
|
}
|
|
_vm.e26 = function ($event, value) {
|
|
var _temp53 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp54 = _temp53.eventParams || _temp53["event-params"],
|
|
value = _temp54.value
|
|
var _temp53, _temp54
|
|
$event = $event.target.value
|
|
return _vm.__set_model(value[1], "lsprice", $event, [])
|
|
}
|
|
_vm.e27 = function ($event, value) {
|
|
var _temp55 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp56 = _temp55.eventParams || _temp55["event-params"],
|
|
value = _temp56.value
|
|
var _temp55, _temp56
|
|
return _vm.addCustomPrice(value[0])
|
|
}
|
|
_vm.e28 = function ($event, value) {
|
|
var _temp57 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp58 = _temp57.eventParams || _temp57["event-params"],
|
|
value = _temp58.value
|
|
var _temp57, _temp58
|
|
return _vm.toggle("oneGoods", value[0])
|
|
}
|
|
_vm.e29 = function ($event, value) {
|
|
var _temp59 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp60 = _temp59.eventParams || _temp59["event-params"],
|
|
value = _temp60.value
|
|
var _temp59, _temp60
|
|
return _vm.AiAddSpec(value[1])
|
|
}
|
|
_vm.e30 = function ($event, value, values) {
|
|
var _temp61 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp62 = _temp61.eventParams || _temp61["event-params"],
|
|
value = _temp62.value,
|
|
values = _temp62.values
|
|
var _temp61, _temp62
|
|
$event.stopPropagation()
|
|
return _vm.delShopSpec(value[0], values[0])
|
|
}
|
|
_vm.e31 = function ($event, value, values) {
|
|
var _temp63 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp64 = _temp63.eventParams || _temp63["event-params"],
|
|
value = _temp64.value,
|
|
values = _temp64.values
|
|
var _temp63, _temp64
|
|
_vm.checkSpec("颜色", value[0], values[0], _vm.numData(values[0])[0])
|
|
}
|
|
_vm.e32 = function ($event, value, values) {
|
|
var _temp65 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp66 = _temp65.eventParams || _temp65["event-params"],
|
|
value = _temp66.value,
|
|
values = _temp66.values
|
|
var _temp65, _temp66
|
|
_vm.checkSpec("尺码", value[0], values[0], _vm.numData(values[0])[1])
|
|
}
|
|
_vm.e33 = function ($event, value, values) {
|
|
var _temp67 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp68 = _temp67.eventParams || _temp67["event-params"],
|
|
value = _temp68.value,
|
|
values = _temp68.values
|
|
var _temp67, _temp68
|
|
return _vm.oneMinusNum(value[0], values[0])
|
|
}
|
|
_vm.e34 = function ($event, value, values) {
|
|
var _temp69 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp70 = _temp69.eventParams || _temp69["event-params"],
|
|
value = _temp70.value,
|
|
values = _temp70.values
|
|
var _temp69, _temp70
|
|
return _vm.mapnumChange($event, value[0], values[0])
|
|
}
|
|
_vm.e35 = function ($event, value, values) {
|
|
var _temp71 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp72 = _temp71.eventParams || _temp71["event-params"],
|
|
value = _temp72.value,
|
|
values = _temp72.values
|
|
var _temp71, _temp72
|
|
return _vm.obtainPrice($event, "mapdanjishu", value[0], values[0])
|
|
}
|
|
_vm.e36 = function ($event, values) {
|
|
var _temp73 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp74 = _temp73.eventParams || _temp73["event-params"],
|
|
values = _temp74.values
|
|
var _temp73, _temp74
|
|
$event = $event.target.value
|
|
return _vm.__set_model(values[1], "productCount", $event, [])
|
|
}
|
|
_vm.e37 = function ($event, value, values) {
|
|
var _temp75 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp76 = _temp75.eventParams || _temp75["event-params"],
|
|
value = _temp76.value,
|
|
values = _temp76.values
|
|
var _temp75, _temp76
|
|
return _vm.onePlusNum(value[0], values[0])
|
|
}
|
|
_vm.e38 = function ($event) {
|
|
return _vm.$refs.addGateDialog.close()
|
|
}
|
|
_vm.e39 = function ($event, value) {
|
|
var _temp77 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp78 = _temp77.eventParams || _temp77["event-params"],
|
|
value = _temp78.value
|
|
var _temp77, _temp78
|
|
return _vm.clickMerge(value[0])
|
|
}
|
|
_vm.e40 = function ($event, value) {
|
|
var _temp79 = arguments[arguments.length - 1].currentTarget.dataset,
|
|
_temp80 = _temp79.eventParams || _temp79["event-params"],
|
|
value = _temp80.value
|
|
var _temp79, _temp80
|
|
return _vm.getZhuBigImage(value[1].productPicture)
|
|
}
|
|
_vm.e41 = function ($event) {
|
|
return _vm.$refs.popup.close()
|
|
}
|
|
_vm.e42 = function ($event) {
|
|
_vm.isChangeHeight = true
|
|
}
|
|
_vm.e43 = function ($event) {
|
|
_vm.isChangeHeight = false
|
|
}
|
|
_vm.e44 = function ($event) {
|
|
return _vm.$refs.voiceBottomPopup.close()
|
|
}
|
|
}
|
|
_vm.$mp.data = Object.assign(
|
|
{},
|
|
{
|
|
$root: {
|
|
l1: l1,
|
|
g3: g3,
|
|
g4: g4,
|
|
g5: g5,
|
|
g6: g6,
|
|
g7: g7,
|
|
l2: l2,
|
|
},
|
|
}
|
|
)
|
|
}
|
|
var recyclableRender = false
|
|
var staticRenderFns = []
|
|
render._withStripped = true
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
/***/ 561:
|
|
/*!**************************************************************************************!*\
|
|
!*** C:/文档/distribution-uni/package1/AI/voiceInventory.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_voiceInventory_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!./voiceInventory.vue?vue&type=script&lang=js& */ 562);
|
|
/* 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_voiceInventory_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_voiceInventory_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_voiceInventory_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_voiceInventory_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_voiceInventory_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 562:
|
|
/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
|
!*** ./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/AI/voiceInventory.vue?vue&type=script&lang=js& ***!
|
|
\*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
|
/*! no static exports found */
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
"use strict";
|
|
/* WEBPACK VAR INJECTION */(function(uni) {
|
|
|
|
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
|
|
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 _vuex = __webpack_require__(/*! vuex */ 32);
|
|
var _global = __webpack_require__(/*! @/utils/global.js */ 214);
|
|
var _base = _interopRequireDefault(__webpack_require__(/*! @/utils/ossUploadFile/base64.js */ 215));
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
//
|
|
|
|
var plugin = requirePlugin("WechatSI");
|
|
var manager = plugin.getRecordRecognitionManager();
|
|
var _default = {
|
|
computed: (0, _vuex.mapState)(['shopName']),
|
|
data: function data() {
|
|
return {
|
|
isVoice: false,
|
|
allChangeNum: 0,
|
|
voiceText: '',
|
|
voiceText1: '',
|
|
khName: [],
|
|
isChangeHeight: false,
|
|
carList: new Map(),
|
|
remark: '',
|
|
voiceGetOneData: false,
|
|
otherPay: '',
|
|
noPay: 0,
|
|
promptImg: '',
|
|
customerCategoryList: [],
|
|
customerCategoryList1: [],
|
|
//存放金额为空的客户分类,用于新增商品
|
|
alreadyPay: '',
|
|
realAmount: 0,
|
|
shouldPay: '',
|
|
userType: '',
|
|
totalAmount: 0,
|
|
customTypeId: '',
|
|
index: '',
|
|
index1: '',
|
|
recordState: false,
|
|
goodsDetail: [],
|
|
temporaryList: [],
|
|
zNum: 0,
|
|
snList: [],
|
|
carList1: [],
|
|
zhuImg: '',
|
|
zhuImgList: [],
|
|
productNum: null,
|
|
prefixRule: '',
|
|
numRule: '',
|
|
yuedikou: 0,
|
|
isChangePriceOk: false,
|
|
leijiqiankuan: 0,
|
|
productId: '',
|
|
oneGoodsId: '',
|
|
showTan: false,
|
|
currentPopupIndex: 0,
|
|
moreData: [],
|
|
goodsId: '',
|
|
pageOldTemList: [],
|
|
oldTemList: [],
|
|
attrList: [],
|
|
goodsList: [],
|
|
mergeId: '',
|
|
newTemList: [],
|
|
pecsList: [],
|
|
single: '',
|
|
childrenId: '',
|
|
isGenerateSnRadio: 1,
|
|
productPictures: [],
|
|
categoryText: '',
|
|
dataObj: new Map(),
|
|
isPlusAndMinus: false,
|
|
indexList: [],
|
|
evalue: [],
|
|
attributeValue: [],
|
|
specifications: '',
|
|
current: 0,
|
|
swiperDotIndex: 0,
|
|
zhiqianqiankuan: 0,
|
|
currentAnchor: '',
|
|
temporaryNum: 0,
|
|
isBottom: false,
|
|
isGenerateSn: [{
|
|
value: '0',
|
|
name: '生成'
|
|
}, {
|
|
value: '1',
|
|
name: '不生成'
|
|
}],
|
|
snName: 'ty',
|
|
defaultList: [{
|
|
name: '颜色',
|
|
value: [{
|
|
value: '均色',
|
|
checked: false
|
|
}, {
|
|
value: '白色',
|
|
checked: false
|
|
}, {
|
|
value: '绿色',
|
|
checked: false
|
|
}, {
|
|
value: '黄色',
|
|
checked: false
|
|
}, {
|
|
value: '卡其色',
|
|
checked: false
|
|
}, {
|
|
value: '黑色',
|
|
checked: false
|
|
}, {
|
|
value: '浅蓝',
|
|
checked: false
|
|
}, {
|
|
value: '蓝色',
|
|
checked: false
|
|
}, {
|
|
value: '灰色',
|
|
checked: false
|
|
}, {
|
|
value: '咖色',
|
|
checked: false
|
|
}, {
|
|
value: '紫色',
|
|
checked: false
|
|
}, {
|
|
value: '红色',
|
|
checked: false
|
|
}, {
|
|
value: '米色',
|
|
checked: false
|
|
}]
|
|
}, {
|
|
name: '尺码',
|
|
value: [{
|
|
value: '均码',
|
|
checked: false
|
|
}, {
|
|
value: 'XS码',
|
|
checked: false
|
|
}, {
|
|
value: 'S码',
|
|
checked: false
|
|
}, {
|
|
value: 'M码',
|
|
checked: false
|
|
}, {
|
|
value: 'L码',
|
|
checked: false
|
|
}, {
|
|
value: 'XL码',
|
|
checked: false
|
|
}, {
|
|
value: '2XL码',
|
|
checked: false
|
|
}, {
|
|
value: '3XL码',
|
|
checked: false
|
|
}, {
|
|
value: '4XL码',
|
|
checked: false
|
|
}, {
|
|
value: '5XL码',
|
|
checked: false
|
|
}]
|
|
}],
|
|
temporary: [] //修改单个规格值临时存放要修改的对象
|
|
};
|
|
},
|
|
|
|
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;
|
|
}
|
|
},
|
|
onShow: function onShow() {
|
|
var _this = this;
|
|
uni.authorize({
|
|
scope: 'scope.record',
|
|
success: function success() {},
|
|
fail: function fail() {
|
|
this.tui.toast("您未授权,语音功能可能会出现错误");
|
|
}
|
|
});
|
|
uni.authorize({
|
|
scope: 'scope.writePhotosAlbum',
|
|
success: function success() {},
|
|
fail: function fail() {
|
|
this.tui.toast("您未授权,图片上传功能可能会出现错误");
|
|
}
|
|
});
|
|
uni.showLoading({
|
|
title: '加载中...'
|
|
});
|
|
var that = this,
|
|
isTrue = false;
|
|
if (this.merge == 1) {
|
|
this.$refs.mergePopup.close();
|
|
if (this.carList.has(this.carList1.id) == true) {
|
|
//跟当前页面有相同的商品
|
|
that.carList.get(that.mergeId).stockLogList.forEach(function (value1, key1) {
|
|
that.carList.get(that.carList1.id).stockLogList.forEach(function (value, key) {
|
|
if (key1 == key) {
|
|
if (that.mergeId != that.carList1.id) {
|
|
that.carList.get(that.carList1.id).stockLogList.get(key).productCount = Number(that.carList.get(that.carList1.id).stockLogList.get(key).productCount) + Number(value1.productCount);
|
|
isTrue = true;
|
|
that.carList.get(that.carList1.id).productCount += Number(value1.productCount);
|
|
}
|
|
}
|
|
});
|
|
if (isTrue == false) {
|
|
that.carList.get(that.carList1.id).stockLogList.set(key1, value1);
|
|
that.carList.get(that.carList1.id).productCount += Number(value1.productCount);
|
|
}
|
|
});
|
|
} else {
|
|
this.carList.get(this.mergeId).productId = this.carList1.id;
|
|
this.carList.get(this.mergeId).id = this.carList1.id;
|
|
this.carList.get(this.mergeId).productName = this.carList1.productName;
|
|
this.carList.get(this.mergeId).productPicture = this.carList1.productPicture;
|
|
this.carList.get(this.mergeId).productSn = this.carList1.productSn;
|
|
this.carList.get(this.mergeId).categoryId = this.carList1.categoryId;
|
|
this.carList.get(this.mergeId).wholesalePrice = this.carList1.wholesalePrice || 0;
|
|
this.carList.get(this.mergeId).lsprice = this.carList1.price || 0;
|
|
this.carList.get(this.mergeId).isNew = false;
|
|
this.carList.set(this.carList1.id, this.carList.get(this.mergeId));
|
|
}
|
|
if (this.mergeId != this.carList1.id) {
|
|
this.carList.delete(this.mergeId);
|
|
}
|
|
that.carList.get(that.carList1.id).price1 = Number(that.carList.get(that.carList1.id).productCount) * that.carList.get(that.carList1.id).purchasePrice;
|
|
this.getAllPrice();
|
|
setTimeout(function (res) {
|
|
uni.hideLoading();
|
|
}, 300);
|
|
this.$forceUpdate();
|
|
this.merge = 0;
|
|
return;
|
|
}
|
|
if (uni.getStorageSync('carList1') != '') {
|
|
this.carList1 = JSON.parse(uni.getStorageSync('carList1'));
|
|
} else {
|
|
this.carList1 = this.carList1;
|
|
}
|
|
if (this.carList1 != '') {
|
|
isTrue = true;
|
|
}
|
|
if (uni.getStorageSync('khName') != '') {
|
|
this.khName = JSON.parse(uni.getStorageSync('khName'));
|
|
} else {
|
|
this.khName = JSON.parse(JSON.stringify(this.khName)) || '';
|
|
}
|
|
if (this.khName != '') {
|
|
if (this.khName.noEarn != null && this.zhiqianqiankuan != this.khName.noEarn) {
|
|
isTrue = true;
|
|
}
|
|
if (this.khName.noEarn == null) {
|
|
this.zhiqianqiankuan = 0;
|
|
} else {
|
|
this.zhiqianqiankuan = this.khName.noEarn;
|
|
}
|
|
}
|
|
setTimeout(function (res) {
|
|
_this.getByCondition();
|
|
}, 500);
|
|
if (this.carList.size == 0) {
|
|
//当前页没有数据
|
|
for (var i = 0; i < this.carList1.length; i++) {
|
|
var obj = {
|
|
purchasePrice: this.userType == 0 ? this.carList1[i].purchasePrice : '',
|
|
//进货价
|
|
price1: 0,
|
|
price: this.carList1[i].price,
|
|
productCount: 0,
|
|
customerCategoryList: this.carList1[i].customerCategoryRule != null ? this.checkPriceRule(this.carList1[i].customerCategoryRule) : this.getNewProductRule(),
|
|
id: this.carList1[i].productId != null ? this.carList1[i].productId : this.carList1[i].id,
|
|
isNew: this.carList1[i].isNew,
|
|
//是否是新商品
|
|
productId: this.carList1[i].productId == null ? '' : this.carList1[i].productId,
|
|
productName: this.carList1[i].productName,
|
|
wholesalePrice: this.carList1[i].wholesalePrice || 0,
|
|
categoryName: this.carList1[i].categoryName,
|
|
categoryId: this.carList1[i].categoryId,
|
|
attrId: this.carList1[i].attrId,
|
|
lsprice: this.carList1[i].price || 0,
|
|
productPicture: this.carList1[i].productPicture,
|
|
productSn: this.carList1[i].productSn,
|
|
productPictures: [],
|
|
stockLogList: new Map(),
|
|
stockLogList1: []
|
|
};
|
|
for (var m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
|
|
var productCount = Number(this.carList1[i].saleDetailQueryDTO[m].productCount);
|
|
if (obj.stockLogList.has(this.carList1[i].saleDetailQueryDTO[m].attributeList) == true) {
|
|
productCount += Number(obj.stockLogList.get(this.carList1[i].saleDetailQueryDTO[m].attributeList).productCount);
|
|
}
|
|
var data1 = {
|
|
productCount: productCount,
|
|
name: this.carList1[i].saleDetailQueryDTO[m].name,
|
|
productNum: this.carList1[i].saleDetailQueryDTO[m].productNum
|
|
};
|
|
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1);
|
|
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount == null ? 0 : Number(this.carList1[i].saleDetailQueryDTO[m].productCount);
|
|
obj.price1 = Number(obj.productCount) * this.carList1[i].purchasePrice;
|
|
}
|
|
var id = this.carList1[i].isNew == true ? this.carList1[i].id : this.carList1[i].productId;
|
|
this.carList.set(id, obj);
|
|
}
|
|
this.carList1 = [];
|
|
} else {
|
|
//当前页有数据
|
|
for (var _i = 0; _i < this.carList1.length; _i++) {
|
|
var _id = this.carList1[_i].isNew == true ? this.carList1[_i].id : this.carList1[_i].productId;
|
|
if (this.carList.has(this.carList1[_i].id) == true) {
|
|
//商品相同
|
|
for (var _m = 0; _m < this.carList1[_i].saleDetailQueryDTO.length; _m++) {
|
|
if (this.carList.get(this.carList1[_i].id).stockLogList.has(this.carList1[_i].saleDetailQueryDTO[_m].attributeList) == true) {
|
|
//规格相同
|
|
|
|
var data1 = {
|
|
productCount: Number(this.carList.get(this.carList1[_i].id).stockLogList.get(this.carList1[_i].saleDetailQueryDTO[_m].attributeList).productCount) + Number(this.carList1[_i].saleDetailQueryDTO[_m].productCount),
|
|
name: this.carList1[_i].saleDetailQueryDTO[_m].name,
|
|
productNum: this.carList1[_i].saleDetailQueryDTO[_m].productNum
|
|
};
|
|
this.carList.get(this.carList1[_i].id).stockLogList.set(this.carList1[_i].saleDetailQueryDTO[_m].attributeList, data1);
|
|
} else {
|
|
//规格不同
|
|
var data1 = {
|
|
productCount: Number(this.carList1[_i].saleDetailQueryDTO[_m].productCount),
|
|
name: this.carList1[_i].saleDetailQueryDTO[_m].name,
|
|
productNum: this.carList1[_i].saleDetailQueryDTO[_m].productNum
|
|
};
|
|
this.carList.get(this.carList1[_i].id).stockLogList.set(this.carList1[_i].saleDetailQueryDTO[_m].attributeList, data1);
|
|
}
|
|
this.carList.get(this.carList1[_i].id).productCount += this.carList1[_i].saleDetailQueryDTO[_m].productCount == null ? 0 : Number(this.carList1[_i].saleDetailQueryDTO[_m].productCount);
|
|
this.carList.get(this.carList1[_i].id).price1 = Number(this.carList.get(this.carList1[_i].id).productCount) * this.carList.get(this.carList1[_i].id).purchasePrice;
|
|
}
|
|
} else {
|
|
//商品不同
|
|
var _obj = {
|
|
purchasePrice: this.userType == 0 ? this.carList1[_i].purchasePrice : '',
|
|
//进货价
|
|
price1: 0,
|
|
price: this.carList1[_i].price,
|
|
productCount: 0,
|
|
customerCategoryList: this.carList1[_i].customerCategoryRule != null ? this.checkPriceRule(this.carList1[_i].customerCategoryRule) : this.getNewProductRule(),
|
|
id: this.carList1[_i].productId != null ? this.carList1[_i].productId : this.carList1[_i].id,
|
|
productId: this.carList1[_i].productId == null ? '' : this.carList1[_i].productId,
|
|
isNew: this.carList1[_i].isNew,
|
|
productName: this.carList1[_i].productName,
|
|
wholesalePrice: this.carList1[_i].wholesalePrice || 0,
|
|
categoryName: this.carList1[_i].categoryName,
|
|
categoryId: this.carList1[_i].categoryId,
|
|
attrId: this.carList1[_i].attrId,
|
|
lsprice: this.carList1[_i].price || 0,
|
|
productPicture: this.carList1[_i].productPicture,
|
|
productSn: this.carList1[_i].productSn,
|
|
stockLogList: new Map(),
|
|
stockLogList1: [],
|
|
productPictures: [],
|
|
name: ''
|
|
};
|
|
for (var _m2 = 0; _m2 < this.carList1[_i].saleDetailQueryDTO.length; _m2++) {
|
|
var data1 = {
|
|
productCount: Number(this.carList1[_i].saleDetailQueryDTO[_m2].productCount),
|
|
name: this.carList1[_i].saleDetailQueryDTO[_m2].name,
|
|
productNum: this.carList1[_i].saleDetailQueryDTO[_m2].productNum
|
|
};
|
|
_obj.stockLogList.set(this.carList1[_i].saleDetailQueryDTO[_m2].attributeList, data1);
|
|
_obj.name = this.carList1[_i].saleDetailQueryDTO[_m2].name;
|
|
_obj.productCount += this.carList1[_i].saleDetailQueryDTO[_m2].productCount == null ? 0 : Number(this.carList1[_i].saleDetailQueryDTO[_m2].productCount);
|
|
_obj.price1 = Number(_obj.productCount) * this.carList1[_i].purchasePrice;
|
|
}
|
|
this.carList.set(_id, _obj);
|
|
}
|
|
}
|
|
}
|
|
this.$nextTick(function () {
|
|
_this.carList1 = [];
|
|
uni.removeStorageSync('carList1');
|
|
uni.removeStorageSync('khName');
|
|
uni.removeStorageSync('hangOrder');
|
|
if (isTrue) {
|
|
_this.getAllPrice();
|
|
}
|
|
if (_this.carList1 != '') {
|
|
setTimeout(function (res) {
|
|
uni.hideLoading();
|
|
}, 2000);
|
|
} else {
|
|
setTimeout(function (res) {
|
|
uni.hideLoading();
|
|
}, 300);
|
|
}
|
|
_this.$forceUpdate();
|
|
});
|
|
},
|
|
onLoad: function onLoad(options) {
|
|
this.userType = uni.getStorageSync('type');
|
|
this.getSnList();
|
|
this.getShopCategory();
|
|
this.getCustomerCategoryList();
|
|
this.getDefaultCategory();
|
|
this.getMonth();
|
|
},
|
|
methods: {
|
|
uploadFile: function uploadFile() {
|
|
var that = this;
|
|
uni.chooseMedia({
|
|
count: 1,
|
|
mediaType: ['image'],
|
|
sourceType: ['album'],
|
|
camera: 'back',
|
|
success: function success(res) {
|
|
uni.compressImage({
|
|
src: res.tempFiles[0].tempFilePath,
|
|
quality: 50,
|
|
success: function success(res1) {
|
|
uni.uploadFile({
|
|
url: that.tui.interfaceUrl() + '/upload/file',
|
|
filePath: res1.tempFilePath,
|
|
name: 'file',
|
|
header: {
|
|
"content-type": "multipart/form-data",
|
|
'accessToken': that.tui.getToken()
|
|
},
|
|
formData: {},
|
|
success: function success(uploadFileRes) {
|
|
var path = JSON.parse(uploadFileRes.data);
|
|
//后端返回的地址,存入图片地址
|
|
that.promptImg = path.result;
|
|
that.$forceUpdate();
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
});
|
|
},
|
|
getMonth: function getMonth() {
|
|
var date = new Date();
|
|
var year = date.getFullYear().toString(); //'年'
|
|
var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : (date.getMonth() + 1).toString(); //'月'
|
|
var da = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate().toString(); //'日'
|
|
this.single = year + '-' + month + '-' + da; //当天
|
|
},
|
|
//店铺规格库
|
|
getShopCategory: function getShopCategory() {
|
|
var _this2 = this;
|
|
this.tui.request("/app/productCategory/getCategoryOfshop", "POST", {}, false, true).then(function (res) {
|
|
if (res.code == 200) {
|
|
//this.specifiList[0] this.defaultList[1] 尺码
|
|
//this.specifiList[1] this.defaultList[0] 颜色
|
|
_this2.specifiList = res.result.productAttributeOfAddVos;
|
|
if (_this2.specifiList[0].attributeName == '尺码') {
|
|
var _loop = function _loop(m) {
|
|
//尺码库
|
|
var isysTrue = true;
|
|
for (var i = 0; i < _this2.defaultList[1].value.length; i++) {
|
|
//合并尺码 默认尺码
|
|
if (_this2.defaultList[1].value[i].value == _this2.specifiList[0].productAttributeValueVoList[m].value) {
|
|
isysTrue = false;
|
|
}
|
|
}
|
|
_this2.$nextTick(function () {
|
|
if (isysTrue) {
|
|
_this2.defaultList[1].value.push(_this2.specifiList[0].productAttributeValueVoList[m]);
|
|
}
|
|
});
|
|
};
|
|
for (var m = 0; m < _this2.specifiList[0].productAttributeValueVoList.length; m++) {
|
|
_loop(m);
|
|
}
|
|
} else {
|
|
var _loop2 = function _loop2(_m3) {
|
|
//颜色库
|
|
var isTrue = true;
|
|
for (var i = 0; i < _this2.defaultList[0].value.length; i++) {
|
|
//合并颜色 默认颜色
|
|
if (_this2.defaultList[0].value[i].value == _this2.specifiList[0].productAttributeValueVoList[_m3].value) {
|
|
isTrue = false;
|
|
}
|
|
}
|
|
_this2.$nextTick(function () {
|
|
if (isTrue) {
|
|
_this2.defaultList[0].value.push(_this2.specifiList[0].productAttributeValueVoList[_m3]);
|
|
}
|
|
});
|
|
};
|
|
for (var _m3 = 0; _m3 < _this2.specifiList[0].productAttributeValueVoList.length; _m3++) {
|
|
_loop2(_m3);
|
|
}
|
|
}
|
|
if (_this2.specifiList[1].attributeName == '尺码') {
|
|
var _loop3 = function _loop3(_m4) {
|
|
//尺码库
|
|
var isysTrue = true;
|
|
for (var i = 0; i < _this2.defaultList[1].value.length; i++) {
|
|
//合并尺码 默认尺码
|
|
if (_this2.defaultList[1].value[i].value == _this2.specifiList[1].productAttributeValueVoList[_m4].value) {
|
|
isysTrue = false;
|
|
}
|
|
}
|
|
_this2.$nextTick(function () {
|
|
if (isysTrue) {
|
|
_this2.defaultList[1].value.push(_this2.specifiList[1].productAttributeValueVoList[_m4]);
|
|
}
|
|
});
|
|
};
|
|
for (var _m4 = 0; _m4 < _this2.specifiList[1].productAttributeValueVoList.length; _m4++) {
|
|
_loop3(_m4);
|
|
}
|
|
} else {
|
|
var _loop4 = function _loop4(_m5) {
|
|
//颜色库
|
|
var isTrue = true;
|
|
for (var i = 0; i < _this2.defaultList[0].value.length; i++) {
|
|
//合并颜色 默认颜色
|
|
if (_this2.defaultList[0].value[i].value == _this2.specifiList[1].productAttributeValueVoList[_m5].value) {
|
|
isTrue = false;
|
|
}
|
|
}
|
|
_this2.$nextTick(function () {
|
|
if (isTrue) {
|
|
_this2.defaultList[0].value.push(_this2.specifiList[1].productAttributeValueVoList[_m5]);
|
|
}
|
|
});
|
|
};
|
|
for (var _m5 = 0; _m5 < _this2.specifiList[1].productAttributeValueVoList.length; _m5++) {
|
|
_loop4(_m5);
|
|
}
|
|
}
|
|
} else {
|
|
_this2.tui.toast(res.message);
|
|
}
|
|
}).catch(function (res) {});
|
|
},
|
|
//获取客户分类
|
|
getCustomerCategoryList: function getCustomerCategoryList() {
|
|
var _this3 = this;
|
|
this.tui.request("/app/customerCategory/getCustomerCategoryListByShopId", "POST", {
|
|
shopId: uni.getStorageSync('shopId')
|
|
}, false, true).then(function (res) {
|
|
if (res.code == 200) {
|
|
if (res.result.length > 0) {
|
|
for (var i = 0; i < res.result.length; i++) {
|
|
var data = {
|
|
categoryName: res.result[i].categoryName,
|
|
categoryId: res.result[i].id,
|
|
categoryPrice: ""
|
|
};
|
|
_this3.customerCategoryList[i] = data;
|
|
_this3.customerCategoryList1[i] = data;
|
|
}
|
|
} else {
|
|
_this3.customerCategoryList = null;
|
|
_this3.customerCategoryList1 = null;
|
|
}
|
|
} else {
|
|
_this3.tui.toast(res.message);
|
|
}
|
|
}).catch(function (res) {});
|
|
},
|
|
//店铺默认分类
|
|
getDefaultCategory: function getDefaultCategory() {
|
|
var _this4 = this;
|
|
this.tui.request("/app/productCategory/getDefaultCategory", "POST", {}, false, true).then(function (res) {
|
|
if (res.code == 200) {
|
|
_this4.categoryList = res.result;
|
|
} else {
|
|
_this4.tui.toast(res.message);
|
|
}
|
|
}).catch(function (res) {});
|
|
},
|
|
//进入页面,查询货号列表
|
|
getSnList: function getSnList() {
|
|
var _this5 = this;
|
|
// snList
|
|
this.snList = [];
|
|
this.snName = '';
|
|
this.tui.request("/app/productSn/getProductSnByShopId", "POST", {}, false, true).then(function (res1) {
|
|
if (res1.code == 200) {
|
|
if (res1.result != '') {
|
|
for (var i = 0; i < res1.result.length; i++) {
|
|
var data = {
|
|
text: '前缀:' + res1.result[i].snPre + ',位数:' + res1.result[i].snSufLength,
|
|
value: res1.result[i].snPre
|
|
};
|
|
_this5.snList.push(data);
|
|
}
|
|
_this5.snName = res1.result[0].snPre;
|
|
}
|
|
} else {
|
|
_this5.tui.toast(res.message);
|
|
}
|
|
_this5.$forceUpdate();
|
|
}).catch(function (res) {});
|
|
},
|
|
//根据规则生成货号
|
|
startGetSn: function startGetSn() {
|
|
var _this6 = this;
|
|
var that = this;
|
|
uni.showLoading({
|
|
title: '加载中...',
|
|
mask: true
|
|
});
|
|
that.$refs.SNDialog.close();
|
|
if (this.prefixRule == '') {
|
|
this.tui.toast('请输入货号生成前缀规则');
|
|
return;
|
|
}
|
|
if (this.numRule == '') {
|
|
this.tui.toast('请输入货号生成位数规则');
|
|
return;
|
|
}
|
|
this.tui.request("/app/productSn/addAndGetNewProductSn", "POST", {
|
|
snPre: this.prefixRule,
|
|
snSufLength: this.numRule
|
|
}, false, false).then(function (res1) {
|
|
if (res1.code == 200) {
|
|
// this.snList = res1.result
|
|
if (res1.message == '货号前缀已存在!') {
|
|
//被删除,调启用方法
|
|
uni.showModal({
|
|
title: "提示",
|
|
content: "货号前缀已存在!",
|
|
success: function success(res) {
|
|
if (res.confirm) {
|
|
that.tui.request("/app/productSn/useAgainProductSn", "POST", {
|
|
id: res1.result.id
|
|
}, false, true).then(function (res2) {
|
|
if (res2.code == 200) {
|
|
that.tui.toast('成功');
|
|
that.prefixRule = '';
|
|
that.numRule = '';
|
|
setTimeout(function (res) {
|
|
that.getSnList();
|
|
}, 1000);
|
|
} else {
|
|
that.tui.toast(res2.message);
|
|
}
|
|
that.$forceUpdate();
|
|
}).catch(function (res) {});
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
if (that.zhuImgList != [] && that.zhuImgList.length > 0) {
|
|
for (var i = 0; i < that.zhuImgList.length; i++) {
|
|
that.upLoadFile(that.zhuImgList[i], i + 1);
|
|
}
|
|
setTimeout(function (res) {
|
|
that.zhuImgList = [];
|
|
}, 2000);
|
|
} else {
|
|
_this6.addPageGoods(_this6.zhuImg, res1.result);
|
|
}
|
|
that.getSnList();
|
|
}
|
|
} else {
|
|
_this6.tui.toast(res.message);
|
|
}
|
|
}).catch(function (res) {});
|
|
this.$nextTick(function () {
|
|
uni.hideLoading();
|
|
});
|
|
},
|
|
//生成货号弹出层
|
|
generateSn: function generateSn(id) {
|
|
var _this7 = this;
|
|
if (this.snList.length > 0) {
|
|
this.tui.request("/app/productSn/getNewProductSn", "POST", {
|
|
snPre: this.snName
|
|
}, false, true).then(function (res1) {
|
|
if (res1.code == 200) {
|
|
_this7.tui.request('/app/product/getByProductSn', "post", {
|
|
productSn: res1.result
|
|
}, false, true).then(function (res) {
|
|
if (res.code == 200) {
|
|
if (res.result != '') {
|
|
_this7.generateSn(value);
|
|
} else {
|
|
_this7.carList.get(id).productSn = res1.result;
|
|
_this7.$forceUpdate();
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
_this7.tui.toast(res.message);
|
|
}
|
|
}).catch(function (res) {});
|
|
} else {
|
|
this.zhuImg = '';
|
|
this.$refs.SNDialog.open('center');
|
|
}
|
|
},
|
|
addSn: function addSn() {
|
|
this.$refs.SNDialog.open('center');
|
|
},
|
|
AiVoice: function AiVoice() {
|
|
var _this8 = this;
|
|
if (this.carList.size == 0) {
|
|
//当前页没有数据
|
|
for (var i = 0; i < this.carList1.length; i++) {
|
|
var obj = {
|
|
purchasePrice: this.userType == 0 ? this.carList1[i].purchasePrice : '',
|
|
//进货价
|
|
price1: 0,
|
|
price: this.carList1[i].price,
|
|
productCount: 0,
|
|
customerCategoryList: this.carList1[i].customerCategoryList != null ? this.carList1[i].customerCategoryList : this.getNewProductRule(),
|
|
id: this.carList1[i].productId != null ? this.carList1[i].productId : this.carList1[i].id,
|
|
isNew: this.carList1[i].isNew,
|
|
//是否是新商品
|
|
productId: this.carList1[i].productId == null ? '' : this.carList1[i].productId,
|
|
productName: this.carList1[i].productName,
|
|
wholesalePrice: this.carList1[i].wholesalePrice || 0,
|
|
categoryName: this.carList1[i].categoryName,
|
|
categoryId: this.carList1[i].categoryId,
|
|
attrId: this.carList1[i].attrId,
|
|
lsprice: this.carList1[i].price || 0,
|
|
productPicture: this.carList1[i].productPicture,
|
|
productSn: this.carList1[i].productSn,
|
|
stockLogList: new Map(),
|
|
productPictures: [],
|
|
stockLogList1: []
|
|
};
|
|
for (var m = 0; m < this.carList1[i].saleDetailQueryDTO.length; m++) {
|
|
var productCount = Number(this.carList1[i].saleDetailQueryDTO[m].productCount);
|
|
if (obj.stockLogList.has(this.carList1[i].saleDetailQueryDTO[m].attributeList) == true) {
|
|
productCount += Number(obj.stockLogList.get(this.carList1[i].saleDetailQueryDTO[m].attributeList).productCount);
|
|
}
|
|
var data1 = {
|
|
productCount: productCount,
|
|
name: this.carList1[i].saleDetailQueryDTO[m].name,
|
|
productNum: this.carList1[i].saleDetailQueryDTO[m].productNum
|
|
};
|
|
obj.stockLogList.set(this.carList1[i].saleDetailQueryDTO[m].attributeList, data1);
|
|
obj.productCount += this.carList1[i].saleDetailQueryDTO[m].productCount == null ? 0 : Number(this.carList1[i].saleDetailQueryDTO[m].productCount);
|
|
obj.price1 = Number(obj.productCount) * this.carList1[i].purchasePrice;
|
|
}
|
|
var id = this.carList1[i].isNew == true ? this.carList1[i].id : this.carList1[i].productId;
|
|
this.carList.set(id, obj);
|
|
// that.carList.get(id).price = that.carList.get(id).purchasePrice *
|
|
// that.carList.get(id).productCount;
|
|
}
|
|
|
|
this.carList1 = [];
|
|
} else {
|
|
//当前页有数据
|
|
for (var _i2 = 0; _i2 < this.carList1.length; _i2++) {
|
|
var _id2 = this.carList1[_i2].isNew == true ? this.carList1[_i2].id : this.carList1[_i2].productId;
|
|
if (this.carList.has(this.carList1[_i2].id) == true) {
|
|
//商品相同
|
|
if (this.carList.get(this.carList1[_i2].id).purchasePrice == '') {
|
|
this.carList.get(this.carList1[_i2].id).purchasePrice = this.carList1[_i2].purchasePrice;
|
|
}
|
|
for (var _m6 = 0; _m6 < this.carList1[_i2].saleDetailQueryDTO.length; _m6++) {
|
|
if (this.carList.get(this.carList1[_i2].id).stockLogList.has(this.carList1[_i2].saleDetailQueryDTO[_m6].attributeList) == true) {
|
|
//规格相同
|
|
var data1 = {
|
|
productCount: Number(this.carList.get(this.carList1[_i2].id).stockLogList.get(this.carList1[_i2].saleDetailQueryDTO[_m6].attributeList).productCount) + Number(this.carList1[_i2].saleDetailQueryDTO[_m6].productCount),
|
|
name: this.carList1[_i2].saleDetailQueryDTO[_m6].name,
|
|
productNum: this.carList1[_i2].saleDetailQueryDTO[_m6].productNum
|
|
};
|
|
this.carList.get(this.carList1[_i2].id).stockLogList.set(this.carList1[_i2].saleDetailQueryDTO[_m6].attributeList, data1);
|
|
} else {
|
|
//规格不同
|
|
var data1 = {
|
|
productCount: Number(this.carList1[_i2].saleDetailQueryDTO[_m6].productCount),
|
|
name: this.carList1[_i2].saleDetailQueryDTO[_m6].name,
|
|
productNum: this.carList1[_i2].saleDetailQueryDTO[_m6].productNum
|
|
};
|
|
this.carList.get(this.carList1[_i2].id).stockLogList.set(this.carList1[_i2].saleDetailQueryDTO[_m6].attributeList, data1);
|
|
}
|
|
this.carList.get(this.carList1[_i2].id).productCount += this.carList1[_i2].saleDetailQueryDTO[_m6].productCount == null ? 0 : Number(this.carList1[_i2].saleDetailQueryDTO[_m6].productCount);
|
|
this.carList.get(this.carList1[_i2].id).price1 = Number(this.carList.get(this.carList1[_i2].id).productCount) * this.carList.get(this.carList1[_i2].id).purchasePrice;
|
|
}
|
|
} else {
|
|
//商品不同
|
|
var _obj2 = {
|
|
purchasePrice: this.userType == 0 ? this.carList1[_i2].purchasePrice : '',
|
|
//进货价
|
|
price1: 0,
|
|
price: this.carList1[_i2].price,
|
|
productCount: 0,
|
|
customerCategoryList: this.carList1[_i2].customerCategoryList != null ? this.carList1[_i2].customerCategoryList : this.getNewProductRule(),
|
|
id: this.carList1[_i2].productId != null ? this.carList1[_i2].productId : this.carList1[_i2].id,
|
|
productId: this.carList1[_i2].productId == null ? '' : this.carList1[_i2].productId,
|
|
isNew: this.carList1[_i2].isNew,
|
|
productName: this.carList1[_i2].productName,
|
|
wholesalePrice: this.carList1[_i2].wholesalePrice || 0,
|
|
categoryName: this.carList1[_i2].categoryName,
|
|
categoryId: this.carList1[_i2].categoryId,
|
|
attrId: this.carList1[_i2].attrId,
|
|
lsprice: this.carList1[_i2].price || 0,
|
|
productPicture: this.carList1[_i2].productPicture,
|
|
productSn: this.carList1[_i2].productSn,
|
|
stockLogList: new Map(),
|
|
stockLogList1: [],
|
|
productPictures: [],
|
|
name: ''
|
|
};
|
|
for (var _m7 = 0; _m7 < this.carList1[_i2].saleDetailQueryDTO.length; _m7++) {
|
|
var data1 = {
|
|
productCount: Number(this.carList1[_i2].saleDetailQueryDTO[_m7].productCount),
|
|
name: this.carList1[_i2].saleDetailQueryDTO[_m7].name,
|
|
productNum: this.carList1[_i2].saleDetailQueryDTO[_m7].productNum
|
|
};
|
|
_obj2.stockLogList.set(this.carList1[_i2].saleDetailQueryDTO[_m7].attributeList, data1);
|
|
_obj2.name = this.carList1[_i2].saleDetailQueryDTO[_m7].name;
|
|
_obj2.productCount += this.carList1[_i2].saleDetailQueryDTO[_m7].productCount == null ? 0 : Number(this.carList1[_i2].saleDetailQueryDTO[_m7].productCount);
|
|
_obj2.price1 = Number(_obj2.productCount) * this.carList1[_i2].purchasePrice;
|
|
}
|
|
this.carList.set(_id2, _obj2);
|
|
}
|
|
// that.carList.get(id).price = that.carList.get(id).purchasePrice *
|
|
// that.carList.get(id).productCount;
|
|
}
|
|
}
|
|
|
|
this.$nextTick(function () {
|
|
_this8.carList1 = [];
|
|
uni.removeStorageSync('carList1');
|
|
_this8.getAllPrice();
|
|
if (_this8.carList1 != '') {
|
|
setTimeout(function (res) {
|
|
uni.hideLoading();
|
|
}, 2000);
|
|
} else {
|
|
setTimeout(function (res) {
|
|
uni.hideLoading();
|
|
}, 300);
|
|
}
|
|
_this8.$forceUpdate();
|
|
});
|
|
},
|
|
numData: function numData(val) {
|
|
var name = [];
|
|
if (typeof val == 'string') {
|
|
var newObj = JSON.parse(val);
|
|
for (var as in newObj) {
|
|
name.push(newObj[as]);
|
|
}
|
|
}
|
|
return name;
|
|
},
|
|
checkSpec: function checkSpec(type, id, attr, value) {
|
|
if (this.carList.get(id).categoryId == '' || this.carList.get(id).categoryId == null) {
|
|
this.tui.toast('请先选择商品分类');
|
|
return;
|
|
}
|
|
this.temporary = [id, attr, type, value];
|
|
var num = type == '颜色' ? 0 : 1;
|
|
this.getGategoryLowList();
|
|
},
|
|
getScanCodeCategroyId: function getScanCodeCategroyId(num) {
|
|
num = num == '颜色' ? 0 : 1;
|
|
this.isOpenId = num;
|
|
this.goodsId = this.goodsDetail.id;
|
|
this.$refs.inputDialog.open('bottom');
|
|
this.isBottom = true;
|
|
},
|
|
//初始化获取子分类列表
|
|
getGategoryLowList: function getGategoryLowList() {
|
|
var _this9 = this;
|
|
this.attrList = [];
|
|
var num = this.temporary[2] == '颜色' ? 0 : 1;
|
|
this.tui.request("/app/productAttribute/selectByCategoryId", "POST", {
|
|
categoryId: this.carList.get(this.temporary[0]).attrId
|
|
}, false, true).then(function (res1) {
|
|
if (res1.code == 200) {
|
|
_this9.attrList.push(res1.result[num]);
|
|
if (res1.result.length > 0) {
|
|
_this9.attributeValue = [];
|
|
_this9.tui.request("/app/productAttributeValue/selectByAttributeId", "get", {
|
|
id: _this9.attrList[0].id
|
|
}, false, true).then(function (res2) {
|
|
if (res2.code == 200) {
|
|
_this9.attributeValue = res2.result;
|
|
_this9.$forceUpdate();
|
|
} else {
|
|
_this9.tui.toast(res.message);
|
|
}
|
|
}).catch(function (res) {});
|
|
}
|
|
setTimeout(function () {
|
|
_this9.showList = _this9.attrList;
|
|
}, 1000);
|
|
} else {
|
|
_this9.tui.toast(res.message);
|
|
}
|
|
}).catch(function (res) {});
|
|
this.$forceUpdate();
|
|
this.specifications = this.temporary[3];
|
|
this.$refs.getaPopup.open();
|
|
},
|
|
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;
|
|
},
|
|
//点击某一个规格,可修改
|
|
changeSpec: function changeSpec(item) {
|
|
var _this10 = this;
|
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
var that, data, specMap;
|
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
while (1) {
|
|
switch (_context.prev = _context.next) {
|
|
case 0:
|
|
that = _this10;
|
|
if (!(item == '')) {
|
|
_context.next = 4;
|
|
break;
|
|
}
|
|
_this10.tui.toast('请输入要修改的规格值');
|
|
return _context.abrupt("return");
|
|
case 4:
|
|
data = _this10.temporary;
|
|
specMap = new Map(); //新的临时存放值那个更改过的值的map
|
|
_context.next = 8;
|
|
return _this10.carList.get(data[0]).stockLogList.forEach(function (value, key) {
|
|
if (data[2] == '颜色') {
|
|
if (that.numData(key)[0] == data[3]) {
|
|
var stringKey = key.replace(data[3], item); //拿到了更改过的key
|
|
|
|
if (specMap.has(stringKey) == true) {
|
|
data[1] = stringKey;
|
|
specMap.get(stringKey).name = that.sliceMsg(stringKey);
|
|
specMap.get(stringKey).productCount += Number(value.productCount);
|
|
} else {
|
|
data[1] = stringKey;
|
|
specMap.set(stringKey, value);
|
|
specMap.get(stringKey).name = that.sliceMsg(stringKey);
|
|
}
|
|
if (that.carList.get(data[0]).isNew != true) {
|
|
that.tui.request("/app/stock/productCount", "post", {
|
|
productId: that.carList.get(data[0]).productId,
|
|
attributeList: stringKey
|
|
}, false, true).then(function (res) {
|
|
if (res.code == 200) {
|
|
value.productNum = res.result;
|
|
that.$forceUpdate();
|
|
} else {
|
|
that.tui.toast(res.message);
|
|
}
|
|
}).catch(function (res) {});
|
|
}
|
|
} else {
|
|
if (specMap.has(key) == true) {
|
|
specMap.get(key).productCount += Number(value.productCount);
|
|
} else {
|
|
specMap.set(key, value);
|
|
specMap.get(key).name = that.sliceMsg(key);
|
|
}
|
|
}
|
|
} else if (data[2] == '尺码') {
|
|
if (that.numData(key)[1] == data[3]) {
|
|
var _stringKey = key.replace(data[3], item); //拿到了更改过的key
|
|
if (specMap.has(_stringKey) == true) {
|
|
data[1] = _stringKey;
|
|
specMap.get(_stringKey).name = that.sliceMsg(_stringKey);
|
|
specMap.get(_stringKey).productCount += Number(value.productCount);
|
|
} else {
|
|
data[1] = _stringKey;
|
|
specMap.set(_stringKey, value);
|
|
specMap.get(_stringKey).name = that.sliceMsg(_stringKey);
|
|
}
|
|
if (that.carList.get(data[0]).isNew != true) {
|
|
that.tui.request("/app/stock/productCount", "post", {
|
|
productId: that.carList.get(data[0]).productId,
|
|
attributeList: _stringKey
|
|
}, false, true).then(function (res) {
|
|
if (res.code == 200) {
|
|
value.productNum = res.result;
|
|
that.$forceUpdate();
|
|
} else {
|
|
that.tui.toast(res.message);
|
|
}
|
|
}).catch(function (res) {});
|
|
}
|
|
} else {
|
|
if (specMap.has(key) == true) {
|
|
specMap.get(key).productCount += Number(value.productCount);
|
|
} else {
|
|
specMap.set(key, value);
|
|
specMap.get(key).name = that.sliceMsg(key);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
case 8:
|
|
_context.next = 10;
|
|
return that.$nextTick(function () {
|
|
_this10.carList.get(data[0]).stockLogList = specMap;
|
|
_this10.$forceUpdate();
|
|
_this10.$refs.getaPopup.close();
|
|
});
|
|
case 10:
|
|
case "end":
|
|
return _context.stop();
|
|
}
|
|
}
|
|
}, _callee);
|
|
}))();
|
|
},
|
|
updateCate: function updateCate() {
|
|
this.carList.get(this.customTypeId).customerCategoryList = this.customerCategoryList;
|
|
this.$refs.customPopup.close();
|
|
this.$forceUpdate();
|
|
},
|
|
delDefaultCate: function delDefaultCate(index, value, index1) {
|
|
var _this11 = this;
|
|
var data = this.goodsDetail.attributeList[index].value[index1];
|
|
this.goodsDetail.attributeList[index].value.splice(index1, 1);
|
|
this.tui.request("/app/productAttributeValue/delById", "post", {
|
|
attributeId: data.attributeId,
|
|
value: data.value,
|
|
id: data.id
|
|
}, false, true).then(function (res) {
|
|
if (res.code == 200) {
|
|
_this11.getShopCategory();
|
|
uni.showToast({
|
|
title: "删除成功",
|
|
icon: 'none'
|
|
});
|
|
} else {
|
|
uni.showToast({
|
|
title: "删除失败",
|
|
icon: 'none'
|
|
});
|
|
}
|
|
}).catch(function (res) {});
|
|
},
|
|
handleBlur: function handleBlur(e) {
|
|
this.categoryText = e.detail.value;
|
|
},
|
|
inputDialogToggle: function inputDialogToggle(item) {
|
|
this.inputVal = '';
|
|
this.isOpenId = item;
|
|
this.$refs.inputDialog.open('bottom');
|
|
},
|
|
//弹出客户分类弹窗
|
|
addCustomPrice: function addCustomPrice(id) {
|
|
this.customTypeId = id;
|
|
this.customerCategoryList = this.carList.get(id).customerCategoryList;
|
|
this.$refs.customPopup.open();
|
|
},
|
|
getByCondition: function getByCondition() {
|
|
var _this12 = this;
|
|
this.tui.request("/app/supplier/getByCondition", "post", {
|
|
searchStr: this.khName.consigneeName,
|
|
pageNumber: 1,
|
|
pageSize: 10
|
|
}, false, true).then(function (res) {
|
|
if (res.code == 200) {
|
|
for (var i = 0; i < res.result.content.length; i++) {
|
|
if (res.result.content[i].id == _this12.khName.id) {
|
|
_this12.khName.noEarn = res.result.content[i].noEarn;
|
|
_this12.zhiqianqiankuan = res.result.content[i].noEarn;
|
|
}
|
|
}
|
|
} else {
|
|
uni.showToast({
|
|
title: res.message,
|
|
icon: 'none'
|
|
});
|
|
}
|
|
}).catch(function (res) {});
|
|
},
|
|
//保存已选
|
|
saveCheck: function saveCheck() {
|
|
this.pageOldTemList = this.temporaryList;
|
|
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
|
|
this.goodsList[i].specs = [];
|
|
for (var m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) {
|
|
this.goodsDetail.attributeList[i].value[m].isChecked = false;
|
|
}
|
|
}
|
|
},
|
|
showPopup: function showPopup(index) {
|
|
this.currentPopupIndex = index;
|
|
this.showTan = true;
|
|
},
|
|
clickGetOne: function clickGetOne(item) {
|
|
var _this13 = this;
|
|
// 如果还有下一个弹出层,则显示下一个
|
|
if (this.currentPopupIndex + 1 < this.moreData.length) {
|
|
this.showTan = false; // 先关闭当前弹出层
|
|
this.voiceText = '';
|
|
this.voiceText1 = '';
|
|
var data = {
|
|
attributeList: '{"颜色":"均色","尺码":"均码"}',
|
|
productCount: Number(item.productCount) || 1,
|
|
productNum: item.defaultStockCount
|
|
};
|
|
item.productId = item.id;
|
|
item.saleDetailQueryDTO = [];
|
|
item.saleDetailQueryDTO.push(data);
|
|
var purchaseDetails = [];
|
|
purchaseDetails.push(item);
|
|
var id = this.oneGoodsId;
|
|
if (this.oneGoodsId) {
|
|
if (this.carList.get(id).productSn != '') {
|
|
for (var j = 0; j < purchaseDetails.length; j++) {
|
|
for (var i = 0; i < purchaseDetails[j].stockLogList1.length; i++) {
|
|
if (this.carList.get(id).productName == '') {
|
|
this.carList.get(id).productName = purchaseDetails[0].productName;
|
|
}
|
|
if (this.carList.get(id).attrId == '') {
|
|
this.carList.get(id).attrId = purchaseDetails[0].attrId;
|
|
}
|
|
if (this.carList.get(id).purchasePrice == '' || this.carList.get(id).purchasePrice == null) {
|
|
if (voiceData.purchasePrice) {
|
|
this.carList.get(id).purchasePrice = voiceData.purchasePrice;
|
|
} else {
|
|
this.carList.get(id).purchasePrice = purchaseDetails[0].purchasePrice;
|
|
}
|
|
}
|
|
if (this.carList.get(id).productPicture == '') {
|
|
this.carList.get(id).productPicture = purchaseDetails[0].productPicture;
|
|
}
|
|
this.carList.get(id).customerCategoryRule = this.checkPriceRule(JSON.parse(purchaseDetails[0].customerCategoryRule));
|
|
purchaseDetails[j].stockLogList1[i].name = this.sliceMsg(purchaseDetails[j].stockLogList1[i].attributeList);
|
|
if (this.carList.get(id).stockLogList.size == 0) {
|
|
this.carList.get(id).stockLogList.set(purchaseDetails[j].stockLogList1[i].attributeList, purchaseDetails[j].stockLogList1[i]);
|
|
} else {
|
|
if (this.carList.get(id).stockLogList.has(purchaseDetails[j].stockLogList1[i].attributeList) == true) {
|
|
this.carList.get(id).stockLogList.get(purchaseDetails[j].stockLogList1[i].attributeList).productCount += Number(purchaseDetails[j].stockLogList1[i].productCount);
|
|
} else {
|
|
this.carList.get(id).stockLogList.set(purchaseDetails[j].stockLogList1[i].attributeList, purchaseDetails[j].stockLogList1[i]);
|
|
}
|
|
}
|
|
this.carList.get(id).productCount += Number(purchaseDetails[j].stockLogList1[i].productCount);
|
|
}
|
|
}
|
|
this.carList.get(id).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productNum = purchaseDetails[0].defaultStockCount;
|
|
if (this.carList.get(id).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 0 && purchaseDetails[0].stockLogList1.length > 0) {
|
|
this.carList.get(id).stockLogList.delete('{"颜色":"均色","尺码":"均码"}');
|
|
}
|
|
this.carList.get(id).price1 = Number(this.carList.get(id).productCount) * this.carList.get(id).purchasePrice;
|
|
} else {
|
|
var isTrue = false;
|
|
this.carList.forEach(function (value, key) {
|
|
if (value.productSn == purchaseDetails[0].productSn) {
|
|
isTrue = true;
|
|
that.tui.toast('该货号被页面其他商品占用,请重新输入!');
|
|
that.carList.get(id).productSn = '';
|
|
setTimeout(function (res) {
|
|
that.$forceUpdate();
|
|
}, 1000);
|
|
throw Error('被占用');
|
|
}
|
|
});
|
|
this.$nextTick(function () {
|
|
if (_this13.carList.get(id).productName == '') {
|
|
_this13.carList.get(id).productName = purchaseDetails[0].productName;
|
|
}
|
|
_this13.carList.get(id).customerCategoryList = purchaseDetails[0].customerCategoryRule != null ? _this13.checkPriceRule(JSON.parse(purchaseDetails[0].customerCategoryRule)) : null;
|
|
if (isTrue == false && _this13.carList.get(id).productSn == '') {
|
|
_this13.carList.get(id).productSn = purchaseDetails[0].productSn;
|
|
}
|
|
if (isTrue == false) {
|
|
if (purchaseDetails[0].productId) {
|
|
_this13.carList.get(id).id = purchaseDetails[0].productId;
|
|
_this13.carList.get(id).productId = purchaseDetails[0].productId;
|
|
_this13.carList.get(id).isNew = false;
|
|
id = purchaseDetails[0].productId;
|
|
} else if (purchaseDetails[0].productSn == '' || purchaseDetails[0].productSn == null) {
|
|
_this13.carList.get(id).id = purchaseDetails[0].productName;
|
|
id = purchaseDetails[0].productName;
|
|
} else if (purchaseDetails[0].productSn == '货号') {
|
|
_this13.carList.get(id).productSn = purchaseDetails[0].productName;
|
|
_this13.carList.get(id).id = purchaseDetails[0].productName;
|
|
id = purchaseDetails[0].productName;
|
|
} else if (purchaseDetails[0].productSn) {
|
|
_this13.carList.get(id).id = purchaseDetails[0].productSn;
|
|
id = purchaseDetails[0].productSn;
|
|
}
|
|
}
|
|
});
|
|
if (this.carList.get(id).purchasePrice == '' || this.carList.get(id).purchasePrice == null) {
|
|
if (this.carList.get(id).purchasePrice) {
|
|
this.carList.get(id).purchasePrice = purchaseDetails[0].purchasePrice;
|
|
} else {
|
|
this.carList.get(id).purchasePrice = purchaseDetails[0].purchasePrice;
|
|
}
|
|
}
|
|
this.carList.get(id).customerCategoryList = purchaseDetails[0].customerCategoryRule != null ? this.checkPriceRule(JSON.parse(purchaseDetails[0].customerCategoryRule)) : this.getNewProductRule();
|
|
if (this.carList.get(id).productPicture == '') {
|
|
this.carList.get(id).productPicture = purchaseDetails[0].productPicture;
|
|
}
|
|
if (purchaseDetails[0].productId) {
|
|
this.carList.get(id).attrId = purchaseDetails[0].attrId;
|
|
this.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice;
|
|
this.carList.get(id).lsPrice = purchaseDetails[0].lsPrice;
|
|
}
|
|
var specMap = new Map(); //新的临时存放值那个更改过的值的map
|
|
this.$nextTick(function () {
|
|
_this13.carList.forEach(function (value, key) {
|
|
if (key != value.id) {
|
|
specMap.set(value.id, value);
|
|
} else {
|
|
specMap.set(key, value);
|
|
}
|
|
});
|
|
_this13.carList = specMap;
|
|
});
|
|
this.$nextTick(function () {
|
|
for (var _j = 0; _j < purchaseDetails.length; _j++) {
|
|
for (var _i3 = 0; _i3 < purchaseDetails[_j].stockLogList1.length; _i3++) {
|
|
purchaseDetails[_j].stockLogList1[_i3].name = _this13.sliceMsg(purchaseDetails[_j].stockLogList1[_i3].attributeList);
|
|
if (_this13.carList.get(id).stockLogList.size == 0) {
|
|
_this13.carList.get(id).stockLogList.set(purchaseDetails[_j].stockLogList1[_i3].attributeList, purchaseDetails[_j].stockLogList1[_i3]);
|
|
} else {
|
|
if (_this13.carList.get(id).stockLogList.has(purchaseDetails[_j].stockLogList1[_i3].attributeList) == true) {
|
|
_this13.carList.get(id).stockLogList.get(purchaseDetails[_j].stockLogList1[_i3].attributeList).productCount += Number(purchaseDetails[_j].stockLogList1[_i3].productCount);
|
|
} else {
|
|
_this13.carList.get(id).stockLogList.set(purchaseDetails[_j].stockLogList1[_i3].attributeList, purchaseDetails[_j].stockLogList1[_i3]);
|
|
}
|
|
}
|
|
_this13.carList.get(id).productCount += Number(purchaseDetails[_j].stockLogList1[_i3].productCount);
|
|
}
|
|
}
|
|
_this13.carList.get(id).price1 = Number(_this13.carList.get(id).productCount) * _this13.carList.get(id).purchasePrice;
|
|
if (_this13.carList.get(id).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 0 && purchaseDetails[0].stockLogList1.length > 0) {
|
|
_this13.carList.get(id).stockLogList.delete('{"颜色":"均色","尺码":"均码"}');
|
|
}
|
|
});
|
|
}
|
|
this.$nextTick(function () {
|
|
_this13.getAllPrice();
|
|
_this13.oneGoodsId = '';
|
|
});
|
|
} else {
|
|
if (purchaseDetails) {
|
|
this.carList1.push(item);
|
|
this.$nextTick(function () {
|
|
_this13.AiVoice();
|
|
});
|
|
} else {
|
|
this.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确");
|
|
}
|
|
}
|
|
setTimeout(function () {
|
|
_this13.showTan = true; // 再显示下一个弹出层
|
|
_this13.currentPopupIndex += 1;
|
|
}, 0);
|
|
} else {
|
|
this.showTan = false; // 如果没有更多弹出层,则关闭最后一个弹出层
|
|
this.voiceText = '';
|
|
this.voiceText1 = '';
|
|
var _data = {
|
|
attributeList: '{"颜色":"均色","尺码":"均码"}',
|
|
productCount: Number(item.productCount) || 1,
|
|
productNum: item.defaultStockCount
|
|
};
|
|
item.productId = item.id;
|
|
item.saleDetailQueryDTO = [];
|
|
item.saleDetailQueryDTO.push(_data);
|
|
var _purchaseDetails = [];
|
|
_purchaseDetails.push(item);
|
|
var _id3 = this.oneGoodsId;
|
|
if (this.oneGoodsId) {
|
|
if (this.carList.get(_id3).productSn != '') {
|
|
for (var _j2 = 0; _j2 < _purchaseDetails.length; _j2++) {
|
|
for (var _i4 = 0; _i4 < _purchaseDetails[_j2].stockLogList1.length; _i4++) {
|
|
if (this.carList.get(_id3).productName == '') {
|
|
this.carList.get(_id3).productName = _purchaseDetails[0].productName;
|
|
}
|
|
if (this.carList.get(_id3).attrId == '') {
|
|
this.carList.get(_id3).attrId = _purchaseDetails[0].attrId;
|
|
}
|
|
if (this.carList.get(_id3).purchasePrice == '' || this.carList.get(_id3).purchasePrice == null) {
|
|
if (voiceData.purchasePrice) {
|
|
this.carList.get(_id3).purchasePrice = voiceData.purchasePrice;
|
|
} else {
|
|
this.carList.get(_id3).purchasePrice = _purchaseDetails[0].purchasePrice;
|
|
}
|
|
}
|
|
if (this.carList.get(_id3).productPicture == '') {
|
|
this.carList.get(_id3).productPicture = _purchaseDetails[0].productPicture;
|
|
}
|
|
this.carList.get(_id3).customerCategoryRule = this.checkPriceRule(JSON.parse(_purchaseDetails[0].customerCategoryRule));
|
|
_purchaseDetails[_j2].stockLogList1[_i4].name = this.sliceMsg(_purchaseDetails[_j2].stockLogList1[_i4].attributeList);
|
|
if (this.carList.get(_id3).stockLogList.size == 0) {
|
|
this.carList.get(_id3).stockLogList.set(_purchaseDetails[_j2].stockLogList1[_i4].attributeList, _purchaseDetails[_j2].stockLogList1[_i4]);
|
|
} else {
|
|
if (this.carList.get(_id3).stockLogList.has(_purchaseDetails[_j2].stockLogList1[_i4].attributeList) == true) {
|
|
this.carList.get(_id3).stockLogList.get(_purchaseDetails[_j2].stockLogList1[_i4].attributeList).productCount += Number(_purchaseDetails[_j2].stockLogList1[_i4].productCount);
|
|
} else {
|
|
this.carList.get(_id3).stockLogList.set(_purchaseDetails[_j2].stockLogList1[_i4].attributeList, _purchaseDetails[_j2].stockLogList1[_i4]);
|
|
}
|
|
}
|
|
this.carList.get(_id3).productCount += Number(_purchaseDetails[_j2].stockLogList1[_i4].productCount);
|
|
}
|
|
}
|
|
this.carList.get(_id3).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productNum = _purchaseDetails[0].defaultStockCount;
|
|
if (this.carList.get(_id3).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 0 && _purchaseDetails[0].stockLogList1.length > 0) {
|
|
this.carList.get(_id3).stockLogList.delete('{"颜色":"均色","尺码":"均码"}');
|
|
}
|
|
this.carList.get(_id3).price1 = Number(this.carList.get(_id3).productCount) * this.carList.get(_id3).purchasePrice;
|
|
} else {
|
|
var _isTrue = false;
|
|
this.carList.forEach(function (value, key) {
|
|
if (value.productSn == _purchaseDetails[0].productSn) {
|
|
_isTrue = true;
|
|
that.tui.toast('该货号被页面其他商品占用,请重新输入!');
|
|
that.carList.get(_id3).productSn = '';
|
|
setTimeout(function (res) {
|
|
that.$forceUpdate();
|
|
}, 1000);
|
|
throw Error('被占用');
|
|
}
|
|
});
|
|
this.$nextTick(function () {
|
|
if (_this13.carList.get(_id3).productName == '') {
|
|
_this13.carList.get(_id3).productName = _purchaseDetails[0].productName;
|
|
}
|
|
_this13.carList.get(_id3).customerCategoryList = _purchaseDetails[0].customerCategoryRule != null ? _this13.checkPriceRule(JSON.parse(_purchaseDetails[0].customerCategoryRule)) : null;
|
|
if (_isTrue == false && _this13.carList.get(_id3).productSn == '') {
|
|
_this13.carList.get(_id3).productSn = _purchaseDetails[0].productSn;
|
|
}
|
|
if (_isTrue == false) {
|
|
if (_purchaseDetails[0].productId) {
|
|
_this13.carList.get(_id3).id = _purchaseDetails[0].productId;
|
|
_this13.carList.get(_id3).productId = _purchaseDetails[0].productId;
|
|
_this13.carList.get(_id3).isNew = false;
|
|
_id3 = _purchaseDetails[0].productId;
|
|
} else if (_purchaseDetails[0].productSn == '' || _purchaseDetails[0].productSn == null) {
|
|
_this13.carList.get(_id3).id = _purchaseDetails[0].productName;
|
|
_id3 = _purchaseDetails[0].productName;
|
|
} else if (_purchaseDetails[0].productSn == '货号') {
|
|
_this13.carList.get(_id3).productSn = _purchaseDetails[0].productName;
|
|
_this13.carList.get(_id3).id = _purchaseDetails[0].productName;
|
|
_id3 = _purchaseDetails[0].productName;
|
|
} else if (_purchaseDetails[0].productSn) {
|
|
_this13.carList.get(_id3).id = _purchaseDetails[0].productSn;
|
|
_id3 = _purchaseDetails[0].productSn;
|
|
}
|
|
}
|
|
});
|
|
if (this.carList.get(_id3).purchasePrice == '' || this.carList.get(_id3).purchasePrice == null) {
|
|
if (_purchaseDetails[0].purchasePrice) {
|
|
this.carList.get(_id3).purchasePrice = _purchaseDetails[0].purchasePrice;
|
|
} else {
|
|
this.carList.get(_id3).purchasePrice = _purchaseDetails[0].purchasePrice;
|
|
}
|
|
}
|
|
this.carList.get(_id3).customerCategoryList = _purchaseDetails[0].customerCategoryRule != null ? this.checkPriceRule(JSON.parse(_purchaseDetails[0].customerCategoryRule)) : this.getNewProductRule();
|
|
if (this.carList.get(_id3).productPicture == '') {
|
|
this.carList.get(_id3).productPicture = _purchaseDetails[0].productPicture;
|
|
}
|
|
if (_purchaseDetails[0].productId) {
|
|
this.carList.get(_id3).attrId = _purchaseDetails[0].attrId;
|
|
this.carList.get(_id3).wholesalePrice = _purchaseDetails[0].wholesalePrice;
|
|
this.carList.get(_id3).lsPrice = _purchaseDetails[0].lsPrice;
|
|
}
|
|
var _specMap = new Map(); //新的临时存放值那个更改过的值的map
|
|
this.$nextTick(function () {
|
|
_this13.carList.forEach(function (value, key) {
|
|
if (key != value.id) {
|
|
_specMap.set(value.id, value);
|
|
} else {
|
|
_specMap.set(key, value);
|
|
}
|
|
});
|
|
_this13.carList = _specMap;
|
|
});
|
|
this.$nextTick(function () {
|
|
for (var _j3 = 0; _j3 < _purchaseDetails.length; _j3++) {
|
|
for (var _i5 = 0; _i5 < _purchaseDetails[_j3].saleDetailQueryDTO.length; _i5++) {
|
|
_purchaseDetails[_j3].saleDetailQueryDTO[_i5].name = _this13.sliceMsg(_purchaseDetails[_j3].saleDetailQueryDTO[_i5].attributeList);
|
|
if (_this13.carList.get(_id3).stockLogList.size == 0) {
|
|
_this13.carList.get(_id3).stockLogList.set(_purchaseDetails[_j3].saleDetailQueryDTO[_i5].attributeList, _purchaseDetails[_j3].saleDetailQueryDTO[_i5]);
|
|
} else {
|
|
if (_this13.carList.get(_id3).stockLogList.has(_purchaseDetails[_j3].saleDetailQueryDTO[_i5].attributeList) == true) {
|
|
_this13.carList.get(_id3).stockLogList.get(_purchaseDetails[_j3].saleDetailQueryDTO[_i5].attributeList).productCount += Number(_purchaseDetails[_j3].saleDetailQueryDTO[_i5].productCount);
|
|
} else {
|
|
_this13.carList.get(_id3).stockLogList.set(_purchaseDetails[_j3].saleDetailQueryDTO[_i5].attributeList, _purchaseDetails[_j3].saleDetailQueryDTO[_i5]);
|
|
}
|
|
}
|
|
_this13.carList.get(_id3).productCount += Number(_purchaseDetails[_j3].saleDetailQueryDTO[_i5].productCount);
|
|
}
|
|
}
|
|
_this13.carList.get(_id3).price1 = Number(_this13.carList.get(_id3).productCount) * _this13.carList.get(_id3).purchasePrice;
|
|
_this13.carList.get(_id3).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productNum = _purchaseDetails[0].defaultStockCount;
|
|
if (_this13.carList.get(_id3).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 0 && _purchaseDetails[0].saleDetailQueryDTO.length > 0) {
|
|
_this13.carList.get(_id3).stockLogList.delete('{"颜色":"均色","尺码":"均码"}');
|
|
}
|
|
});
|
|
}
|
|
this.$nextTick(function () {
|
|
_this13.getAllPrice();
|
|
_this13.oneGoodsId = '';
|
|
_this13.moreData = [];
|
|
});
|
|
} else {
|
|
if (_purchaseDetails) {
|
|
this.moreData = [];
|
|
this.carList1.push(item);
|
|
this.$nextTick(function () {
|
|
_this13.AiVoice();
|
|
});
|
|
} else {
|
|
this.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确");
|
|
}
|
|
}
|
|
}
|
|
},
|
|
//确认语音输入的内容
|
|
setDetail: function setDetail(e) {
|
|
var _this14 = this;
|
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
var that, convertedStr, regexCount, isLanJie, shopId, regex, _loop5, i, callObj, _callObj;
|
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
while (1) {
|
|
switch (_context2.prev = _context2.next) {
|
|
case 0:
|
|
that = _this14;
|
|
if (!(_this14.voiceText == '')) {
|
|
_context2.next = 4;
|
|
break;
|
|
}
|
|
_this14.tui.toast('识别内容不能为空');
|
|
return _context2.abrupt("return");
|
|
case 4:
|
|
convertedStr = _this14.trimWhitespace(_this14.voiceText);
|
|
convertedStr = _this14.convertChineseToArabic(convertedStr);
|
|
if (convertedStr.indexOf('件数') != -1) {
|
|
convertedStr = convertedStr.replace(/件数/g, '数量:');
|
|
}
|
|
if (convertedStr.indexOf('数量') == -1 && convertedStr.indexOf('名称') == -1 && convertedStr.indexOf('单价') == -1 && convertedStr.indexOf('批发价') == -1) {
|
|
convertedStr = convertedStr + ',';
|
|
}
|
|
if (convertedStr.indexOf('点') != -1) {
|
|
convertedStr = _this14.replaceCharAfterNumber(convertedStr, '点', '.');
|
|
}
|
|
if (convertedStr.indexOf(',名称') != -1) {
|
|
convertedStr = convertedStr.replace(/,名称/g, '名称');
|
|
}
|
|
if (convertedStr.indexOf('名称,') != -1) {
|
|
convertedStr = convertedStr.replace(/名称,/g, '名称');
|
|
}
|
|
if (convertedStr.indexOf('名称::') != -1) {
|
|
convertedStr = convertedStr.replace(/名称::/g, '名称');
|
|
}
|
|
if (convertedStr.indexOf('名称:') != -1) {
|
|
convertedStr = convertedStr.replace(/名称:/g, '名称');
|
|
}
|
|
if (convertedStr.indexOf('名称') != -1) {
|
|
convertedStr = convertedStr.replace(/名称/g, ',名称:');
|
|
}
|
|
if (convertedStr.indexOf(',单价') != -1) {
|
|
convertedStr = convertedStr.replace(/,单价/g, '单价');
|
|
}
|
|
if (convertedStr.indexOf('单价,') != -1) {
|
|
convertedStr = convertedStr.replace(/单价,/g, '单价');
|
|
}
|
|
if (convertedStr.indexOf('单价::') != -1) {
|
|
convertedStr = convertedStr.replace(/单价::/g, '单价');
|
|
}
|
|
if (convertedStr.indexOf('单价:') != -1) {
|
|
convertedStr = convertedStr.replace(/单价:/g, '单价');
|
|
}
|
|
if (convertedStr.indexOf('单价') != -1) {
|
|
convertedStr = convertedStr.replace(/单价/g, ',单价:');
|
|
}
|
|
if (convertedStr.indexOf(',数量') != -1) {
|
|
convertedStr = convertedStr.replace(/,数量/g, '数量');
|
|
}
|
|
if (convertedStr.indexOf('数量,') != -1) {
|
|
convertedStr = convertedStr.replace(/数量,/g, '数量');
|
|
}
|
|
if (convertedStr.indexOf('数量::') != -1) {
|
|
convertedStr = convertedStr.replace(/数量::/g, '数量');
|
|
}
|
|
if (convertedStr.indexOf('数量:') != -1) {
|
|
convertedStr = convertedStr.replace(/数量:/g, '数量');
|
|
}
|
|
if (convertedStr.indexOf('数量') != -1) {
|
|
convertedStr = convertedStr.replace(/数量/g, ',数量:');
|
|
}
|
|
if (convertedStr.indexOf(',批发价') != -1) {
|
|
convertedStr = convertedStr.replace(/,批发价/g, '批发价');
|
|
}
|
|
if (convertedStr.indexOf('批发价,') != -1) {
|
|
convertedStr = convertedStr.replace(/批发价,/g, '批发价');
|
|
}
|
|
if (convertedStr.indexOf('批发价::') != -1) {
|
|
convertedStr = convertedStr.replace(/批发价::/g, '批发价');
|
|
}
|
|
if (convertedStr.indexOf('批发价:') != -1) {
|
|
convertedStr = convertedStr.replace(/批发价:/g, '批发价');
|
|
}
|
|
if (convertedStr.indexOf('批发价') != -1) {
|
|
convertedStr = convertedStr.replace(/批发价/g, ',批发价:');
|
|
}
|
|
if (convertedStr.indexOf(',零售价') != -1) {
|
|
convertedStr = convertedStr.replace(/,零售价/g, '零售价');
|
|
}
|
|
if (convertedStr.indexOf('零售价,') != -1) {
|
|
convertedStr = convertedStr.replace(/零售价,/g, '零售价');
|
|
}
|
|
if (convertedStr.indexOf('零售价::') != -1) {
|
|
convertedStr = convertedStr.replace(/零售价::/g, '零售价');
|
|
}
|
|
if (convertedStr.indexOf('零售价:') != -1) {
|
|
convertedStr = convertedStr.replace(/零售价:/g, '零售价');
|
|
}
|
|
if (convertedStr.indexOf('零售价') != -1) {
|
|
convertedStr = convertedStr.replace(/零售价/g, ',零售价:');
|
|
}
|
|
if (convertedStr.startsWith("号")) {
|
|
convertedStr = "货号" + convertedStr.substr(1);
|
|
}
|
|
if (!convertedStr.startsWith("货号")) {
|
|
convertedStr = "货号" + convertedStr;
|
|
}
|
|
if (convertedStr.indexOf('货号,') != -1) {
|
|
convertedStr = convertedStr.replace(/货号,/g, '货号');
|
|
}
|
|
if (convertedStr.indexOf('货号::') != -1) {
|
|
convertedStr = convertedStr.replace(/货号::/g, '货号');
|
|
}
|
|
if (convertedStr.indexOf('货号:') != -1) {
|
|
convertedStr = convertedStr.replace(/货号:/g, '货号');
|
|
}
|
|
convertedStr = _this14.convertStringCorrectly(convertedStr);
|
|
convertedStr = _this14.spliceMsg(convertedStr);
|
|
if (convertedStr.indexOf(',') == 0) {
|
|
convertedStr = convertedStr.substr(1);
|
|
}
|
|
_this14.getMsg = convertedStr;
|
|
regexCount = /-?\d+/g; //兰姐牛仔家没有销,拿,数量,卖,件数,退,走通义千问
|
|
isLanJie = true;
|
|
shopId = uni.getStorageSync('shopId');
|
|
if ((shopId == '1863043415453863936' || shopId == '1855423693308694528' || shopId == '1810179818189361152') && convertedStr.indexOf('数量') == -1) {
|
|
isLanJie = false;
|
|
}
|
|
if (!(convertedStr.indexOf('色') == -1 && convertedStr.indexOf('码') == -1 && isLanJie)) {
|
|
_context2.next = 69;
|
|
break;
|
|
}
|
|
if (!convertedStr.startsWith("货号")) {
|
|
convertedStr = "货号" + convertedStr;
|
|
}
|
|
_context2.prev = 49;
|
|
regex = /货号.*?(?=货号|$)/g;
|
|
convertedStr = convertedStr.match(regex);
|
|
_loop5 = function _loop5(i) {
|
|
// setTimeout(res => {
|
|
if (_this14.voiceGetOneData == true) {
|
|
var _voiceData = _this14.extractInfo(convertedStr[i] + '。');
|
|
if (_voiceData.productSn) {
|
|
_voiceData.productSn = _voiceData.productSn.replace(/[沟勾钩]/g, 'J');
|
|
}
|
|
if (_voiceData.productCount) {
|
|
_voiceData.productCount = Number(_voiceData.productCount.replace(/[^0-9]/g, ""));
|
|
}
|
|
if (_voiceData.purchasePrice) {
|
|
_voiceData.purchasePrice = _this14.replaceCharAfterNumber(_voiceData.purchasePrice, '块', '.');
|
|
if (_voiceData.purchasePrice.indexOf('元') != -1) {
|
|
_voiceData.purchasePrice = _voiceData.purchasePrice.replace(/元/g, '');
|
|
}
|
|
_voiceData.purchasePrice = _voiceData.purchasePrice.replace(/[^0-9.]/g, "");
|
|
}
|
|
if (_voiceData.wholesalePrice) {
|
|
_voiceData.wholesalePrice = _this14.replaceCharAfterNumber(_voiceData.wholesalePrice, '块', '.');
|
|
if (_voiceData.wholesalePrice.indexOf('元') != -1) {
|
|
_voiceData.wholesalePrice = _voiceData.wholesalePrice.replace(/元/g, '');
|
|
}
|
|
_voiceData.wholesalePrice = _voiceData.wholesalePrice.replace(/[^0-9.]/g, '');
|
|
}
|
|
if (_voiceData.lsprice) {
|
|
_voiceData.lsprice = _this14.replaceCharAfterNumber(_voiceData.lsprice, '块', '.');
|
|
if (_voiceData.lsprice.indexOf('元') != -1) {
|
|
_voiceData.lsprice = _voiceData.lsprice.replace(/元/g, '');
|
|
}
|
|
_voiceData.lsprice = _voiceData.lsprice.replace(/[^0-9.]/g, '');
|
|
}
|
|
if (i == convertedStr.length - 1) {
|
|
setTimeout(function (res) {
|
|
_this14.getOneData(_voiceData, true, 200 * (i + 1));
|
|
}, 200 * (i + 1));
|
|
} else {
|
|
setTimeout(function (res) {
|
|
_this14.getOneData(_voiceData, false, 200 * (i + 1));
|
|
}, 200 * (i + 1));
|
|
}
|
|
} else {
|
|
setTimeout(function (res) {
|
|
if (convertedStr[i].indexOf('数量') == -1 && convertedStr[i].indexOf('名称') == -1 && convertedStr[i].indexOf('单价') == -1 && convertedStr[i].indexOf('批发价') == -1 && convertedStr[i].indexOf(',') == -1) {
|
|
convertedStr[i] = convertedStr[i] + ',';
|
|
}
|
|
var voiceData = _this14.extractInfo(convertedStr[i] + '。');
|
|
if (voiceData.productSn) {
|
|
voiceData.productSn = voiceData.productSn.replace(/[沟勾钩]/g, 'J');
|
|
}
|
|
if (voiceData.productCount) {
|
|
voiceData.productCount = voiceData.productCount.match(regexCount);
|
|
}
|
|
if (voiceData.purchasePrice) {
|
|
voiceData.purchasePrice = _this14.replaceCharAfterNumber(voiceData.purchasePrice, '块', '.');
|
|
if (voiceData.purchasePrice.indexOf('元') != -1) {
|
|
voiceData.purchasePrice = voiceData.purchasePrice.replace(/元/g, '');
|
|
}
|
|
voiceData.purchasePrice = voiceData.purchasePrice.replace(/[^0-9.]/g, "");
|
|
}
|
|
if (voiceData.wholesalePrice) {
|
|
voiceData.wholesalePrice = _this14.replaceCharAfterNumber(voiceData.wholesalePrice, '块', '.');
|
|
if (voiceData.wholesalePrice.indexOf('元') != -1) {
|
|
voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/元/g, '');
|
|
}
|
|
voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/[^0-9.]/g, "");
|
|
}
|
|
if (voiceData.lsprice) {
|
|
voiceData.lsprice = _this14.replaceCharAfterNumber(voiceData.lsprice, '块', '.');
|
|
if (voiceData.lsprice.indexOf('元') != -1) {
|
|
voiceData.lsprice = voiceData.lsprice.replace(/元/g, '');
|
|
}
|
|
voiceData.lsprice = voiceData.lsprice.replace(/[^0-9.]/g, "");
|
|
}
|
|
_this14.tui.request('/app/product/getByProductSn', "post", {
|
|
productSn: voiceData.productSn
|
|
}, false, true).then(function (res) {
|
|
if (res.code == 200) {
|
|
if (res.result != '') {
|
|
_this14.voiceText = '';
|
|
_this14.$refs.popup.close();
|
|
_this14.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
|
|
categoryId: res.result[0].attrId
|
|
}, false, true).then(function (res1) {
|
|
if (res1.code == 200) {
|
|
var data = {
|
|
attributeList: '{"颜色":"均色","尺码":"均码"}',
|
|
productCount: Number(voiceData.productCount) || 1,
|
|
stockCount: null
|
|
};
|
|
if (res1.result.stock.length > 0) {
|
|
for (var _i6 = 0; _i6 < res1.result.stock.length; _i6++) {
|
|
if (res1.result.stock[_i6].attributeList == '{"颜色":"均色","尺码":"均码"}') {
|
|
data = {
|
|
attributeList: '{"颜色":"均色","尺码":"均码"}',
|
|
productCount: Number(voiceData.productCount) || 1,
|
|
stockCount: res1.result.stock[_i6].stockCount
|
|
};
|
|
}
|
|
}
|
|
}
|
|
if (voiceData.purchasePrice) {
|
|
voiceData.purchasePrice = _this14.replaceCharAfterNumber(voiceData.purchasePrice, '块', '.');
|
|
if (voiceData.purchasePrice.indexOf('元') != -1) {
|
|
voiceData.purchasePrice = voiceData.purchasePrice.replace(/元/g, '');
|
|
}
|
|
voiceData.purchasePrice = voiceData.purchasePrice.replace(/[^0-9.]/g, "");
|
|
}
|
|
if (voiceData.wholesalePrice) {
|
|
voiceData.wholesalePrice = _this14.replaceCharAfterNumber(voiceData.wholesalePrice, '块', '.');
|
|
if (voiceData.wholesalePrice.indexOf('元') != -1) {
|
|
voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/元/g, '');
|
|
}
|
|
voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/[^0-9.]/g, "");
|
|
}
|
|
res.result[0].productId = res.result[0].id;
|
|
res.result[0].stockLogList1 = [];
|
|
res.result[0].stockLogList1.push(data);
|
|
var purchaseDetails = res.result;
|
|
if (_this14.oneGoodsId) {
|
|
var id = _this14.oneGoodsId;
|
|
if (purchaseDetails.length > 0) {
|
|
if (_this14.carList.get(id).productSn != '') {
|
|
for (var j = 0; j < purchaseDetails.length; j++) {
|
|
for (var _i7 = 0; _i7 < purchaseDetails[j].stockLogList1.length; _i7++) {
|
|
if (_this14.carList.get(id).productName == '') {
|
|
_this14.carList.get(id).productName = purchaseDetails[0].productName;
|
|
}
|
|
if (_this14.carList.get(id).attrId == '') {
|
|
_this14.carList.get(id).attrId = purchaseDetails[0].attrId;
|
|
}
|
|
if (_this14.carList.get(id).purchasePrice == '' || _this14.carList.get(id).purchasePrice == null) {
|
|
if (voiceData.purchasePrice) {
|
|
_this14.carList.get(id).purchasePrice = voiceData.purchasePrice;
|
|
} else {
|
|
_this14.carList.get(id).purchasePrice = purchaseDetails[0].purchasePrice;
|
|
}
|
|
}
|
|
if (_this14.carList.get(id).productPicture == '') {
|
|
_this14.carList.get(id).productPicture = purchaseDetails[0].productPicture;
|
|
}
|
|
_this14.carList.get(id).customerCategoryRule = _this14.checkPriceRule(JSON.parse(purchaseDetails[0].customerCategoryRule));
|
|
purchaseDetails[j].stockLogList1[_i7].name = _this14.sliceMsg(purchaseDetails[j].stockLogList1[_i7].attributeList);
|
|
if (_this14.carList.get(id).stockLogList.size == 0) {
|
|
_this14.carList.get(id).stockLogList.set(purchaseDetails[j].stockLogList1[_i7].attributeList, purchaseDetails[j].stockLogList1[_i7]);
|
|
} else {
|
|
if (_this14.carList.get(id).stockLogList.has(purchaseDetails[j].stockLogList1[_i7].attributeList) == true) {
|
|
_this14.carList.get(id).stockLogList.get(purchaseDetails[j].stockLogList1[_i7].attributeList).productNum = purchaseDetails[j].stockLogList1[_i7].stockCount;
|
|
_this14.carList.get(id).stockLogList.get(purchaseDetails[j].stockLogList1[_i7].attributeList).productCount += Number(purchaseDetails[j].stockLogList1[_i7].productCount);
|
|
} else {
|
|
_this14.carList.get(id).stockLogList.set(purchaseDetails[j].stockLogList1[_i7].attributeList, purchaseDetails[j].stockLogList1[_i7]);
|
|
}
|
|
}
|
|
_this14.carList.get(id).productCount += Number(purchaseDetails[j].stockLogList1[_i7].productCount);
|
|
}
|
|
}
|
|
if (_this14.carList.get(id).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 0 && purchaseDetails[0].stockLogList1.length > 0) {
|
|
_this14.carList.get(id).stockLogList.delete('{"颜色":"均色","尺码":"均码"}');
|
|
}
|
|
_this14.carList.get(id).price1 = Number(_this14.carList.get(id).productCount) * _this14.carList.get(id).purchasePrice;
|
|
} else {
|
|
var isTrue = false;
|
|
_this14.carList.forEach(function (value, key) {
|
|
if (value.productSn == purchaseDetails[0].productSn) {
|
|
isTrue = true;
|
|
that.tui.toast('该货号被页面其他商品占用,请重新输入!');
|
|
that.carList.get(id).productSn = '';
|
|
setTimeout(function (res) {
|
|
that.$forceUpdate();
|
|
}, 1000);
|
|
throw Error('被占用');
|
|
}
|
|
});
|
|
_this14.$nextTick(function () {
|
|
if (_this14.carList.get(id).productName == '') {
|
|
_this14.carList.get(id).productName = purchaseDetails[0].productName;
|
|
}
|
|
_this14.carList.get(id).customerCategoryList = purchaseDetails[0].customerCategoryRule != null ? _this14.checkPriceRule(JSON.parse(purchaseDetails[0].customerCategoryRule)) : null;
|
|
if (isTrue == false && _this14.carList.get(id).productSn == '') {
|
|
_this14.carList.get(id).productSn = purchaseDetails[0].productSn;
|
|
}
|
|
if (isTrue == false) {
|
|
if (purchaseDetails[0].productId) {
|
|
_this14.carList.get(id).id = purchaseDetails[0].productId;
|
|
_this14.carList.get(id).productId = purchaseDetails[0].productId;
|
|
_this14.carList.get(id).isNew = false;
|
|
id = purchaseDetails[0].productId;
|
|
} else if (purchaseDetails[0].productSn == '' || purchaseDetails[0].productSn == null) {
|
|
_this14.carList.get(id).id = purchaseDetails[0].productName;
|
|
id = purchaseDetails[0].productName;
|
|
} else if (purchaseDetails[0].productSn == '货号') {
|
|
_this14.carList.get(id).productSn = purchaseDetails[0].productName;
|
|
_this14.carList.get(id).id = purchaseDetails[0].productName;
|
|
id = purchaseDetails[0].productName;
|
|
} else if (purchaseDetails[0].productSn) {
|
|
_this14.carList.get(id).id = purchaseDetails[0].productSn;
|
|
id = purchaseDetails[0].productSn;
|
|
}
|
|
}
|
|
});
|
|
if (_this14.carList.get(id).purchasePrice == '' || _this14.carList.get(id).purchasePrice == null) {
|
|
if (voiceData.purchasePrice) {
|
|
_this14.carList.get(id).purchasePrice = voiceData.purchasePrice;
|
|
} else {
|
|
_this14.carList.get(id).purchasePrice = purchaseDetails[0].purchasePrice;
|
|
}
|
|
}
|
|
_this14.carList.get(id).customerCategoryList = purchaseDetails[0].customerCategoryRule != null ? _this14.checkPriceRule(JSON.parse(purchaseDetails[0].customerCategoryRule)) : _this14.getNewProductRule();
|
|
if (_this14.carList.get(id).productPicture == '') {
|
|
_this14.carList.get(id).productPicture = purchaseDetails[0].productPicture;
|
|
}
|
|
if (purchaseDetails[0].productId) {
|
|
_this14.carList.get(id).attrId = purchaseDetails[0].attrId;
|
|
_this14.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice;
|
|
_this14.carList.get(id).lsPrice = purchaseDetails[0].lsPrice;
|
|
}
|
|
var specMap = new Map(); //新的临时存放值那个更改过的值的map
|
|
_this14.$nextTick(function () {
|
|
_this14.carList.forEach(function (value, key) {
|
|
if (key != value.id) {
|
|
specMap.set(value.id, value);
|
|
} else {
|
|
specMap.set(key, value);
|
|
}
|
|
});
|
|
_this14.carList = specMap;
|
|
});
|
|
_this14.$nextTick(function () {
|
|
for (var _j4 = 0; _j4 < purchaseDetails.length; _j4++) {
|
|
for (var _i8 = 0; _i8 < purchaseDetails[_j4].stockLogList1.length; _i8++) {
|
|
purchaseDetails[_j4].stockLogList1[_i8].name = _this14.sliceMsg(purchaseDetails[_j4].stockLogList1[_i8].attributeList);
|
|
if (_this14.carList.get(id).stockLogList.size == 0) {
|
|
_this14.carList.get(id).stockLogList.set(purchaseDetails[_j4].stockLogList1[_i8].attributeList, purchaseDetails[_j4].stockLogList1[_i8]);
|
|
} else {
|
|
if (_this14.carList.get(id).stockLogList.has(purchaseDetails[_j4].stockLogList1[_i8].attributeList) == true) {
|
|
_this14.carList.get(id).stockLogList.get(purchaseDetails[_j4].stockLogList1[_i8].attributeList).productNum = purchaseDetails[_j4].stockLogList1[_i8].stockCount;
|
|
_this14.carList.get(id).stockLogList.get(purchaseDetails[_j4].stockLogList1[_i8].attributeList).productCount += Number(purchaseDetails[_j4].stockLogList1[_i8].productCount);
|
|
} else {
|
|
_this14.carList.get(id).stockLogList.set(purchaseDetails[_j4].stockLogList1[_i8].attributeList, purchaseDetails[_j4].stockLogList1[_i8]);
|
|
}
|
|
}
|
|
_this14.carList.get(id).productCount += Number(purchaseDetails[_j4].stockLogList1[_i8].productCount);
|
|
}
|
|
}
|
|
_this14.carList.get(id).price1 = Number(_this14.carList.get(id).productCount) * _this14.carList.get(id).purchasePrice;
|
|
if (_this14.carList.get(id).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 0 && purchaseDetails[0].stockLogList1.length > 0) {
|
|
_this14.carList.get(id).stockLogList.delete('{"颜色":"均色","尺码":"均码"}');
|
|
}
|
|
});
|
|
}
|
|
_this14.$nextTick(function () {
|
|
_this14.getAllPrice();
|
|
_this14.oneGoodsId = '';
|
|
});
|
|
} else {
|
|
_this14.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确");
|
|
}
|
|
} else {
|
|
for (var _i9 = 0; _i9 < purchaseDetails.length; _i9++) {
|
|
var data1 = {
|
|
id: "",
|
|
price: purchaseDetails[_i9].price,
|
|
productCount: 0,
|
|
customerCategoryList: purchaseDetails[_i9].customerCategoryRule != null ? _this14.checkPriceRule(JSON.parse(purchaseDetails[_i9].customerCategoryRule)) : _this14.getNewProductRule(),
|
|
attrId: purchaseDetails[_i9].attrId,
|
|
categoryId: purchaseDetails[_i9].categoryId == '' ? _this14.categoryList.categoryId : purchaseDetails[_i9].categoryId,
|
|
categoryName: purchaseDetails[_i9].categoryName == '' ? _this14.categoryList.categoryName : purchaseDetails[_i9].categoryName,
|
|
wholesalePrice: voiceData.wholesalePrice ? voiceData.wholesalePrice : purchaseDetails[_i9].wholesalePrice,
|
|
purchasePrice: voiceData.purchasePrice ? voiceData.purchasePrice : purchaseDetails[_i9].purchasePrice,
|
|
isNew: purchaseDetails[_i9].productId == null ? true : false,
|
|
productId: purchaseDetails[_i9].productId,
|
|
productName: purchaseDetails[_i9].productName,
|
|
productSn: purchaseDetails[_i9].productSn,
|
|
productPicture: purchaseDetails[_i9].productPicture,
|
|
supplierName: purchaseDetails[_i9].supplierName,
|
|
productPictures: [],
|
|
saleDetailQueryDTO: []
|
|
};
|
|
if (purchaseDetails[_i9].productId) {
|
|
data1.id = purchaseDetails[_i9].productId;
|
|
} else if (purchaseDetails[_i9].productSn == '' || purchaseDetails[_i9].productSn == null) {
|
|
data1.id = purchaseDetails[_i9].productName;
|
|
} else if (purchaseDetails[_i9].productSn == '货号') {
|
|
data1.productSn = purchaseDetails[_i9].productName;
|
|
data1.id = purchaseDetails[_i9].productName;
|
|
} else if (purchaseDetails[_i9].productSn) {
|
|
data1.id = purchaseDetails[_i9].productSn;
|
|
}
|
|
for (var m = 0; m < purchaseDetails[_i9].stockLogList1.length; m++) {
|
|
var list = {
|
|
attributeList: _this14.getAttribute(purchaseDetails[_i9].stockLogList1[m].attributeList),
|
|
productCount: Number(purchaseDetails[_i9].stockLogList1[m].productCount) || Number(purchaseDetails[_i9].stockLogList1[m].productCounts),
|
|
productNum: purchaseDetails[_i9].stockLogList1[m].stockCount,
|
|
name: _this14.sliceMsg(_this14.getAttribute(purchaseDetails[_i9].stockLogList1[m].attributeList)),
|
|
price: purchaseDetails[_i9].stockLogList1[m].purchasePrice
|
|
};
|
|
data1.productCount += Number(purchaseDetails[_i9].stockLogList1[m].productCount);
|
|
data1.saleDetailQueryDTO.push(list);
|
|
}
|
|
_this14.carList1.push(data1);
|
|
}
|
|
if (i == convertedStr.length - 1) {
|
|
_this14.$nextTick(function () {
|
|
setTimeout(function (res) {
|
|
_this14.AiVoice();
|
|
}, 300);
|
|
});
|
|
}
|
|
}
|
|
} else {
|
|
_this14.tui.toast(res1.message);
|
|
}
|
|
}).catch(function (res) {});
|
|
} else {
|
|
_this14.voiceText = '';
|
|
_this14.voiceText1 = '';
|
|
_this14.$refs.popup.close();
|
|
if (voiceData.productCount) {
|
|
var regexZCount = /\d+/g;
|
|
voiceData.productCount = voiceData.productCount[0].match(regexZCount);
|
|
}
|
|
if (voiceData.purchasePrice) {
|
|
voiceData.purchasePrice = _this14.replaceCharAfterNumber(voiceData.purchasePrice, '块', '.');
|
|
if (voiceData.purchasePrice.indexOf('元') != -1) {
|
|
voiceData.purchasePrice = voiceData.purchasePrice.replace(/元/g, '');
|
|
}
|
|
voiceData.purchasePrice = voiceData.purchasePrice.replace(/[^0-9.]/g, "");
|
|
}
|
|
if (voiceData.wholesalePrice) {
|
|
voiceData.wholesalePrice = _this14.replaceCharAfterNumber(voiceData.wholesalePrice, '块', '.');
|
|
if (voiceData.wholesalePrice.indexOf('元') != -1) {
|
|
voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/元/g, '');
|
|
}
|
|
voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/[^0-9.]/g, "");
|
|
}
|
|
if (voiceData.lsprice) {
|
|
voiceData.lsprice = _this14.replaceCharAfterNumber(voiceData.lsprice, '块', '.');
|
|
if (voiceData.lsprice.indexOf('元') != -1) {
|
|
voiceData.lsprice = voiceData.lsprice.replace(/元/g, '');
|
|
}
|
|
voiceData.lsprice = voiceData.lsprice.replace(/[^0-9.]/g, "");
|
|
}
|
|
var data = {
|
|
id: voiceData.productSn ? voiceData.productSn : (0, _global.generateUUID)(),
|
|
productCount: Number(voiceData.productCount) || 0,
|
|
productName: voiceData.productName,
|
|
productSn: voiceData.productSn,
|
|
categoryId: _this14.categoryList.categoryId,
|
|
categoryName: _this14.categoryList.categoryName,
|
|
purchasePrice: voiceData.purchasePrice || 0,
|
|
wholesalePrice: voiceData.wholesalePrice || 0,
|
|
lsprice: voiceData.lsprice || 0,
|
|
stockLogList1: [{
|
|
attributeList: '{"颜色":"均色","尺码":"均码"}',
|
|
productCount: Number(voiceData.productCount) || 1,
|
|
stockCount: null
|
|
}]
|
|
};
|
|
var purchaseDetails = [];
|
|
purchaseDetails.push(data);
|
|
if (_this14.oneGoodsId) {
|
|
var id = _this14.oneGoodsId;
|
|
if (purchaseDetails.length > 0) {
|
|
if (_this14.carList.get(id).productSn != '') {
|
|
for (var j = 0; j < purchaseDetails.length; j++) {
|
|
for (var _i10 = 0; _i10 < purchaseDetails[j].stockLogList1.length; _i10++) {
|
|
if (_this14.carList.get(id).productName == '') {
|
|
_this14.carList.get(id).productName = purchaseDetails[0].productName;
|
|
}
|
|
if (_this14.carList.get(id).productSn == '') {
|
|
_this14.carList.get(id).productSn = purchaseDetails[0].productSn;
|
|
}
|
|
if (_this14.carList.get(id).attrId == '') {
|
|
_this14.carList.get(id).attrId = purchaseDetails[0].attrId;
|
|
}
|
|
if (_this14.carList.get(id).wholesalePrice == '' || _this14.carList.get(id).wholesalePrice == null) {
|
|
_this14.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice;
|
|
}
|
|
if (_this14.carList.get(id).purchasePrice == '' || _this14.carList.get(id).purchasePrice == null) {
|
|
_this14.carList.get(id).purchasePrice = purchaseDetails[0].purchasePrice;
|
|
}
|
|
if (_this14.carList.get(id).productPicture == '') {
|
|
_this14.carList.get(id).productPicture = purchaseDetails[0].productPicture;
|
|
}
|
|
purchaseDetails[j].stockLogList1[_i10].name = _this14.sliceMsg(purchaseDetails[j].stockLogList1[_i10].attributeList);
|
|
if (_this14.carList.get(id).stockLogList.size == 0) {
|
|
_this14.carList.get(id).stockLogList.set(purchaseDetails[j].stockLogList1[_i10].attributeList, purchaseDetails[j].stockLogList1[_i10]);
|
|
} else {
|
|
if (_this14.carList.get(id).stockLogList.has(purchaseDetails[j].stockLogList1[_i10].attributeList) == true) {
|
|
_this14.carList.get(id).stockLogList.get(purchaseDetails[j].stockLogList1[_i10].attributeList).productCount += Number(purchaseDetails[j].stockLogList1[_i10].productCount);
|
|
} else {
|
|
_this14.carList.get(id).stockLogList.set(purchaseDetails[j].stockLogList1[_i10].attributeList, purchaseDetails[j].stockLogList1[_i10]);
|
|
}
|
|
}
|
|
_this14.carList.get(id).productCount += Number(purchaseDetails[j].stockLogList1[_i10].productCount);
|
|
}
|
|
}
|
|
if (_this14.carList.get(id).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 0 && purchaseDetails[0].stockLogList1.length > 0) {
|
|
_this14.carList.get(id).stockLogList.delete('{"颜色":"均色","尺码":"均码"}');
|
|
}
|
|
_this14.carList.get(id).price1 = Number(_this14.carList.get(id).productCount) * _this14.carList.get(id).purchasePrice;
|
|
} else {
|
|
var isTrue = false;
|
|
_this14.carList.forEach(function (value, key) {
|
|
if (value.productSn == purchaseDetails[0].productSn) {
|
|
isTrue = true;
|
|
that.tui.toast('该货号被页面其他商品占用,请重新输入!');
|
|
that.carList.get(id).productSn = '';
|
|
setTimeout(function (res) {
|
|
that.$forceUpdate();
|
|
}, 1000);
|
|
throw Error('被占用');
|
|
}
|
|
});
|
|
_this14.$nextTick(function () {
|
|
if (_this14.carList.get(id).productName == '') {
|
|
_this14.carList.get(id).productName = purchaseDetails[0].productName;
|
|
}
|
|
if (isTrue == false && _this14.carList.get(id).productSn == '') {
|
|
_this14.carList.get(id).productSn = purchaseDetails[0].productSn;
|
|
}
|
|
if (isTrue == false) {
|
|
if (purchaseDetails[0].productId) {
|
|
_this14.carList.get(id).id = purchaseDetails[0].productId;
|
|
_this14.carList.get(id).isNew = false;
|
|
id = purchaseDetails[0].productId;
|
|
} else if (purchaseDetails[0].productSn == '' || purchaseDetails[0].productSn == null) {
|
|
_this14.carList.get(id).id = purchaseDetails[0].productName;
|
|
id = purchaseDetails[0].productName;
|
|
} else if (purchaseDetails[0].productSn == '货号') {
|
|
_this14.carList.get(id).productSn = purchaseDetails[0].productName;
|
|
_this14.carList.get(id).id = purchaseDetails[0].productName;
|
|
id = purchaseDetails[0].productName;
|
|
} else if (purchaseDetails[0].productSn) {
|
|
_this14.carList.get(id).id = purchaseDetails[0].productSn;
|
|
id = purchaseDetails[0].productSn;
|
|
}
|
|
}
|
|
});
|
|
if (_this14.carList.get(id).purchasePrice == '' || _this14.carList.get(id).purchasePrice == null) {
|
|
_this14.carList.get(id).purchasePrice = purchaseDetails[0].purchasePrice;
|
|
}
|
|
if (_this14.carList.get(id).productPicture == '') {
|
|
_this14.carList.get(id).productPicture = purchaseDetails[0].productPicture;
|
|
}
|
|
if (purchaseDetails[0].productId) {
|
|
_this14.carList.get(id).attrId = purchaseDetails[0].attrId;
|
|
_this14.carList.get(id).lsPrice = purchaseDetails[0].lsPrice;
|
|
}
|
|
_this14.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice;
|
|
var specMap = new Map(); //新的临时存放值那个更改过的值的map
|
|
_this14.$nextTick(function () {
|
|
_this14.carList.forEach(function (value, key) {
|
|
if (key != value.id) {
|
|
specMap.set(value.id, value);
|
|
} else {
|
|
specMap.set(key, value);
|
|
}
|
|
});
|
|
_this14.carList = specMap;
|
|
});
|
|
_this14.$nextTick(function () {
|
|
for (var _j5 = 0; _j5 < purchaseDetails.length; _j5++) {
|
|
for (var _i11 = 0; _i11 < purchaseDetails[_j5].stockLogList1.length; _i11++) {
|
|
purchaseDetails[_j5].stockLogList1[_i11].name = _this14.sliceMsg(purchaseDetails[_j5].stockLogList1[_i11].attributeList);
|
|
if (_this14.carList.get(id).stockLogList.size == 0) {
|
|
_this14.carList.get(id).stockLogList.set(purchaseDetails[_j5].stockLogList1[_i11].attributeList, purchaseDetails[_j5].stockLogList1[_i11]);
|
|
} else {
|
|
if (_this14.carList.get(id).stockLogList.has(purchaseDetails[_j5].stockLogList1[_i11].attributeList) == true) {
|
|
_this14.carList.get(id).stockLogList.get(purchaseDetails[_j5].stockLogList1[_i11].attributeList).productCount += Number(purchaseDetails[_j5].stockLogList1[_i11].productCount);
|
|
} else {
|
|
_this14.carList.get(id).stockLogList.set(purchaseDetails[_j5].stockLogList1[_i11].attributeList, purchaseDetails[_j5].stockLogList1[_i11]);
|
|
}
|
|
}
|
|
_this14.carList.get(id).productCount += Number(purchaseDetails[_j5].stockLogList1[_i11].productCount);
|
|
}
|
|
}
|
|
_this14.carList.get(id).price1 = Number(_this14.carList.get(id).productCount) * _this14.carList.get(id).purchasePrice;
|
|
if (_this14.carList.get(id).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 0 && purchaseDetails[0].stockLogList1.length > 0) {
|
|
_this14.carList.get(id).stockLogList.delete('{"颜色":"均色","尺码":"均码"}');
|
|
}
|
|
});
|
|
}
|
|
_this14.$nextTick(function () {
|
|
_this14.getAllPrice();
|
|
_this14.oneGoodsId = '';
|
|
});
|
|
} else {
|
|
_this14.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确");
|
|
}
|
|
} else {
|
|
if (voiceData.purchasePrice) {
|
|
voiceData.purchasePrice = _this14.replaceCharAfterNumber(voiceData.purchasePrice, '块', '.');
|
|
if (voiceData.purchasePrice.indexOf('元') != -1) {
|
|
voiceData.purchasePrice = voiceData.purchasePrice.replace(/元/g, '');
|
|
}
|
|
voiceData.purchasePrice = voiceData.purchasePrice.replace(/[^0-9.]/g, "");
|
|
}
|
|
if (voiceData.wholesalePrice) {
|
|
voiceData.wholesalePrice = _this14.replaceCharAfterNumber(voiceData.wholesalePrice, '块', '.');
|
|
if (voiceData.wholesalePrice.indexOf('元') != -1) {
|
|
voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/元/g, '');
|
|
}
|
|
voiceData.wholesalePrice = voiceData.wholesalePrice.replace(/[^0-9.]/g, "");
|
|
}
|
|
for (var _i12 = 0; _i12 < purchaseDetails.length; _i12++) {
|
|
var _data2 = {
|
|
id: "",
|
|
productCount: 0,
|
|
attrId: purchaseDetails[_i12].attrId,
|
|
categoryId: purchaseDetails[_i12].categoryId == '' ? _this14.categoryList.categoryId : purchaseDetails[_i12].categoryId,
|
|
categoryName: purchaseDetails[_i12].categoryName == '' ? _this14.categoryList.categoryName : purchaseDetails[_i12].categoryName,
|
|
wholesalePrice: voiceData.wholesalePrice ? voiceData.wholesalePrice : purchaseDetails[_i12].wholesalePrice,
|
|
price: voiceData.lsprice ? voiceData.lsprice : purchaseDetails[_i12].lsprice,
|
|
purchasePrice: purchaseDetails[_i12].purchasePrice,
|
|
isNew: purchaseDetails[_i12].productId == null ? true : false,
|
|
productId: purchaseDetails[_i12].productId,
|
|
productName: purchaseDetails[_i12].productName,
|
|
productSn: purchaseDetails[_i12].productSn,
|
|
productPicture: purchaseDetails[_i12].productPicture,
|
|
supplierName: purchaseDetails[_i12].supplierName,
|
|
productPictures: [],
|
|
saleDetailQueryDTO: []
|
|
};
|
|
if (purchaseDetails[_i12].productId) {
|
|
_data2.id = purchaseDetails[_i12].productId;
|
|
} else if (purchaseDetails[_i12].productSn == '' || purchaseDetails[_i12].productSn == null) {
|
|
_data2.id = purchaseDetails[_i12].productName || purchaseDetails[_i12].id;
|
|
} else if (purchaseDetails[_i12].productSn == '货号') {
|
|
_data2.productSn = purchaseDetails[_i12].productName;
|
|
_data2.id = purchaseDetails[_i12].productName || purchaseDetails[_i12].id;
|
|
} else if (purchaseDetails[_i12].productSn) {
|
|
_data2.id = purchaseDetails[_i12].productSn || purchaseDetails[_i12].id;
|
|
}
|
|
for (var m = 0; m < purchaseDetails[_i12].stockLogList1.length; m++) {
|
|
var list = {
|
|
attributeList: _this14.getAttribute(purchaseDetails[_i12].stockLogList1[m].attributeList),
|
|
productCount: Number(purchaseDetails[_i12].stockLogList1[m].productCount) || Number(purchaseDetails[_i12].stockLogList1[m].productCounts),
|
|
productNum: '',
|
|
name: _this14.sliceMsg(_this14.getAttribute(purchaseDetails[_i12].stockLogList1[m].attributeList)),
|
|
price: purchaseDetails[_i12].stockLogList1[m].purchasePrice
|
|
};
|
|
_data2.productCount += Number(purchaseDetails[_i12].stockLogList1[m].productCount);
|
|
_data2.saleDetailQueryDTO.push(list);
|
|
}
|
|
_this14.carList1.push(_data2);
|
|
}
|
|
if (i == convertedStr.length - 1) {
|
|
_this14.$nextTick(function () {
|
|
setTimeout(function (res) {
|
|
_this14.AiVoice();
|
|
}, 300);
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}, 200 * (i + 1));
|
|
}
|
|
};
|
|
for (i = 0; i < convertedStr.length; i++) {
|
|
_loop5(i);
|
|
}
|
|
_this14.$refs.popup.close();
|
|
_this14.$refs.voiceBottomPopup.close();
|
|
_context2.next = 67;
|
|
break;
|
|
case 58:
|
|
_context2.prev = 58;
|
|
_context2.t0 = _context2["catch"](49);
|
|
if (_this14.getMsg.indexOf('色,') != -1) {
|
|
_this14.getMsg = _this14.getMsg.replace(/色,/g, '色');
|
|
}
|
|
if (_this14.getMsg.indexOf('色') != -1) {
|
|
_this14.getMsg = _this14.getMsg.replace(/色/g, '色、');
|
|
}
|
|
if (_this14.getMsg.indexOf('件,') != -1) {
|
|
_this14.getMsg = _this14.getMsg.replace(/件,/g, '件');
|
|
}
|
|
if (_this14.getMsg.indexOf('件') != -1) {
|
|
_this14.getMsg = _this14.getMsg.replace(/件/g, '件,');
|
|
}
|
|
if (_this14.oneGoodsId != '' && !_this14.carList.get(_this14.oneGoodsId).isNew) {
|
|
callObj = {
|
|
productId: _this14.carList.get(_this14.oneGoodsId).productId,
|
|
questionMsg: _this14.getMsg
|
|
};
|
|
} else {
|
|
callObj = {
|
|
questionMsg: _this14.getMsg
|
|
};
|
|
}
|
|
_context2.next = 67;
|
|
return _this14.tui.request("/purchaseOcrPicture/callWithMessageOfPurchase", "POST", callObj, false, true).then(function (res) {
|
|
if (res.code == 200) {
|
|
_this14.voiceText = '';
|
|
_this14.voiceText1 = '';
|
|
_this14.$refs.popup.close();
|
|
_this14.$refs.voiceBottomPopup.close();
|
|
var purchaseDetails = res.result.data.purchaseDetails;
|
|
if (_this14.oneGoodsId) {
|
|
var id = _this14.oneGoodsId;
|
|
if (purchaseDetails.length > 0) {
|
|
if (_this14.carList.get(id).productSn != '') {
|
|
for (var j = 0; j < purchaseDetails.length; j++) {
|
|
if (purchaseDetails[j].purchasePrice == "" || purchaseDetails[j].purchasePrice == null) {
|
|
purchaseDetails[j].purchasePrice = 0;
|
|
}
|
|
if (purchaseDetails[j].wholesalePrice == "" || purchaseDetails[j].wholesalePrice == null) {
|
|
purchaseDetails[j].wholesalePrice = 0;
|
|
}
|
|
if (purchaseDetails[j].price == "" || purchaseDetails[j].price == null) {
|
|
purchaseDetails[j].price = 0;
|
|
}
|
|
for (var _i13 = 0; _i13 < purchaseDetails[j].stockLogList1.length; _i13++) {
|
|
if (purchaseDetails[j].stockLogList1[_i13].productCount == "" || purchaseDetails[j].stockLogList1[_i13].productCount == null) {
|
|
purchaseDetails[j].stockLogList1[_i13].productCount = 0;
|
|
}
|
|
if (_this14.carList.get(id).productName == '') {
|
|
_this14.carList.get(id).productName = purchaseDetails[0].productName;
|
|
}
|
|
if (_this14.carList.get(id).attrId == '') {
|
|
_this14.carList.get(id).attrId = purchaseDetails[0].attrId;
|
|
}
|
|
if (_this14.carList.get(id).purchasePrice == '' || _this14.carList.get(id).purchasePrice == null) {
|
|
_this14.carList.get(id).purchasePrice = purchaseDetails[0].purchasePrice;
|
|
}
|
|
if (_this14.carList.get(id).wholesalePrice == '' || _this14.carList.get(id).wholesalePrice == null) {
|
|
_this14.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice;
|
|
}
|
|
if (_this14.carList.get(id).productPicture == '') {
|
|
_this14.carList.get(id).productPicture = purchaseDetails[0].productPicture;
|
|
}
|
|
purchaseDetails[j].stockLogList1[_i13].name = _this14.sliceMsg(purchaseDetails[j].stockLogList1[_i13].attributeList);
|
|
_this14.carList.get(id).stockLogList.get(purchaseDetails[j].stockLogList1[_i13].attributeList).productNum = purchaseDetails[j].stockLogList1[_i13].stockCount;
|
|
if (_this14.carList.get(id).stockLogList.size == 0) {
|
|
_this14.carList.get(id).stockLogList.set(purchaseDetails[j].stockLogList1[_i13].attributeList, purchaseDetails[j].stockLogList1[_i13]);
|
|
} else {
|
|
if (_this14.carList.get(id).stockLogList.has(purchaseDetails[j].stockLogList1[_i13].attributeList) == true) {
|
|
_this14.carList.get(id).stockLogList.get(purchaseDetails[j].stockLogList1[_i13].attributeList).productCount += Number(purchaseDetails[j].stockLogList1[_i13].productCount);
|
|
} else {
|
|
_this14.carList.get(id).stockLogList.set(purchaseDetails[j].stockLogList1[_i13].attributeList, purchaseDetails[j].stockLogList1[_i13]);
|
|
}
|
|
}
|
|
_this14.carList.get(id).productCount += Number(purchaseDetails[j].stockLogList1[_i13].productCount);
|
|
}
|
|
}
|
|
if (_this14.carList.get(id).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 0 && purchaseDetails[0].stockLogList1.length > 0) {
|
|
_this14.carList.get(id).stockLogList.delete('{"颜色":"均色","尺码":"均码"}');
|
|
}
|
|
_this14.carList.get(id).price1 = Number(_this14.carList.get(id).productCount) * _this14.carList.get(id).purchasePrice;
|
|
} else {
|
|
var isTrue = false;
|
|
_this14.carList.forEach(function (value, key) {
|
|
if (value.productSn == purchaseDetails[0].productSn) {
|
|
isTrue = true;
|
|
that.tui.toast('该货号被页面其他商品占用,请重新输入!');
|
|
that.carList.get(id).productSn = '';
|
|
setTimeout(function (res) {
|
|
that.$forceUpdate();
|
|
}, 2000);
|
|
throw Error('被占用');
|
|
}
|
|
});
|
|
_this14.$nextTick(function () {
|
|
if (_this14.carList.get(id).productName == '') {
|
|
_this14.carList.get(id).productName = purchaseDetails[0].productName;
|
|
}
|
|
_this14.carList.get(id).customerCategoryList = _this14.checkPriceRule(JSON.parse(purchaseDetails[0].customerCategoryRule));
|
|
if (isTrue == false && _this14.carList.get(id).productSn == '') {
|
|
_this14.carList.get(id).productSn = purchaseDetails[0].productSn;
|
|
}
|
|
if (isTrue == false) {
|
|
if (purchaseDetails[0].productId) {
|
|
_this14.carList.get(id).id = purchaseDetails[0].productId;
|
|
_this14.carList.get(id).isNew = false;
|
|
id = purchaseDetails[0].productId;
|
|
} else if (purchaseDetails[0].productSn == '' || purchaseDetails[0].productSn == null) {
|
|
_this14.carList.get(id).id = purchaseDetails[0].productName;
|
|
id = purchaseDetails[0].productName;
|
|
} else if (purchaseDetails[0].productSn == '货号') {
|
|
_this14.carList.get(id).productSn = purchaseDetails[0].productName;
|
|
_this14.carList.get(id).id = purchaseDetails[0].productName;
|
|
id = purchaseDetails[0].productName;
|
|
} else if (purchaseDetails[0].productSn) {
|
|
_this14.carList.get(id).id = purchaseDetails[0].productSn;
|
|
id = purchaseDetails[0].productSn;
|
|
}
|
|
}
|
|
_this14.$forceUpdate();
|
|
});
|
|
if (_this14.carList.get(id).purchasePrice == '' || _this14.carList.get(id).purchasePrice == null) {
|
|
_this14.carList.get(id).purchasePrice = purchaseDetails[0].purchasePrice;
|
|
}
|
|
if (_this14.carList.get(id).productPicture == '') {
|
|
_this14.carList.get(id).productPicture = purchaseDetails[0].productPicture;
|
|
}
|
|
if (purchaseDetails[0].productId) {
|
|
_this14.carList.get(id).attrId = purchaseDetails[0].attrId;
|
|
_this14.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice;
|
|
_this14.carList.get(id).lsPrice = purchaseDetails[0].lsPrice;
|
|
}
|
|
var specMap = new Map(); //新的临时存放值那个更改过的值的map
|
|
_this14.$nextTick(function () {
|
|
_this14.carList.forEach(function (value, key) {
|
|
if (key != value.id) {
|
|
specMap.set(value.id, value);
|
|
} else {
|
|
specMap.set(key, value);
|
|
}
|
|
});
|
|
_this14.carList = specMap;
|
|
});
|
|
_this14.$nextTick(function () {
|
|
for (var _j6 = 0; _j6 < purchaseDetails.length; _j6++) {
|
|
for (var _i14 = 0; _i14 < purchaseDetails[_j6].stockLogList1.length; _i14++) {
|
|
purchaseDetails[_j6].stockLogList1[_i14].name = _this14.sliceMsg(purchaseDetails[_j6].stockLogList1[_i14].attributeList);
|
|
if (_this14.carList.get(id).stockLogList.size == 0) {
|
|
purchaseDetails[_j6].stockLogList1[_i14].productNum = purchaseDetails[_j6].stockLogList1[_i14].stockCount;
|
|
_this14.carList.get(id).stockLogList.set(purchaseDetails[_j6].stockLogList1[_i14].attributeList, purchaseDetails[_j6].stockLogList1[_i14]);
|
|
} else {
|
|
if (_this14.carList.get(id).stockLogList.has(purchaseDetails[_j6].stockLogList1[_i14].attributeList) == true) {
|
|
_this14.carList.get(id).stockLogList.get(purchaseDetails[_j6].stockLogList1[_i14].attributeList).productCount += Number(purchaseDetails[_j6].stockLogList1[_i14].productCount);
|
|
_this14.carList.get(id).stockLogList.get(purchaseDetails[_j6].stockLogList1[_i14].attributeList).productNum = purchaseDetails[_j6].stockLogList1[_i14].stockCount;
|
|
} else {
|
|
_this14.carList.get(id).stockLogList.set(purchaseDetails[_j6].stockLogList1[_i14].attributeList, purchaseDetails[_j6].stockLogList1[_i14]);
|
|
_this14.carList.get(id).stockLogList.get(purchaseDetails[_j6].stockLogList1[_i14].attributeList).productNum = _this14.carList.get(id).stockLogList.get(purchaseDetails[_j6].stockLogList1[_i14].attributeList).stockCount;
|
|
}
|
|
}
|
|
_this14.carList.get(id).productCount += Number(purchaseDetails[_j6].stockLogList1[_i14].productCount);
|
|
}
|
|
}
|
|
_this14.carList.get(id).price1 = Number(_this14.carList.get(id).productCount) * _this14.carList.get(id).purchasePrice;
|
|
if (_this14.carList.get(id).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 0 && purchaseDetails[0].stockLogList1.length > 0) {
|
|
_this14.carList.get(id).stockLogList.delete('{"颜色":"均色","尺码":"均码"}');
|
|
}
|
|
});
|
|
}
|
|
_this14.$nextTick(function () {
|
|
_this14.getAllPrice();
|
|
_this14.oneGoodsId = '';
|
|
});
|
|
} else {
|
|
_this14.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确");
|
|
}
|
|
} else {
|
|
for (var _i15 = 0; _i15 < purchaseDetails.length; _i15++) {
|
|
var data = {
|
|
id: "",
|
|
price: purchaseDetails[_i15].price,
|
|
productCount: 0,
|
|
attrId: purchaseDetails[_i15].attrId,
|
|
customerCategoryList: purchaseDetails[_i15].customerCategoryRule == null ? _this14.getNewProductRule() : _this14.checkPriceRule(JSON.parse(purchaseDetails[_i15].customerCategoryRule)),
|
|
categoryId: purchaseDetails[_i15].categoryId == '' ? _this14.categoryList.categoryId : purchaseDetails[_i15].categoryId,
|
|
categoryName: purchaseDetails[_i15].categoryName == '' ? _this14.categoryList.categoryName : purchaseDetails[_i15].categoryName,
|
|
wholesalePrice: purchaseDetails[_i15].wholesalePrice,
|
|
purchasePrice: purchaseDetails[_i15].purchasePrice,
|
|
isNew: purchaseDetails[_i15].productId == null ? true : false,
|
|
productId: purchaseDetails[_i15].productId,
|
|
productName: purchaseDetails[_i15].productName,
|
|
productSn: purchaseDetails[_i15].productSn,
|
|
productPicture: purchaseDetails[_i15].productPicture,
|
|
supplierName: purchaseDetails[_i15].supplierName,
|
|
productPictures: [],
|
|
saleDetailQueryDTO: []
|
|
};
|
|
if (purchaseDetails[_i15].productId) {
|
|
data.id = purchaseDetails[_i15].productId;
|
|
} else if (purchaseDetails[_i15].productSn == '' || purchaseDetails[_i15].productSn == null) {
|
|
data.id = purchaseDetails[_i15].productName;
|
|
} else if (purchaseDetails[_i15].productSn == '货号') {
|
|
data.productSn = purchaseDetails[_i15].productName;
|
|
data.id = purchaseDetails[_i15].productName;
|
|
} else if (purchaseDetails[_i15].productSn) {
|
|
data.id = purchaseDetails[_i15].productSn;
|
|
}
|
|
for (var m = 0; m < purchaseDetails[_i15].stockLogList1.length; m++) {
|
|
var list = {
|
|
attributeList: _this14.getAttribute(purchaseDetails[_i15].stockLogList1[m].attributeList),
|
|
productCount: Number(purchaseDetails[_i15].stockLogList1[m].productCount) || Number(purchaseDetails[_i15].stockLogList1[m].productCounts),
|
|
productNum: '',
|
|
name: _this14.sliceMsg(_this14.getAttribute(purchaseDetails[_i15].stockLogList1[m].attributeList)),
|
|
price: purchaseDetails[_i15].stockLogList1[m].purchasePrice
|
|
};
|
|
data.productCount += Number(purchaseDetails[_i15].stockLogList1[m].productCount);
|
|
data.saleDetailQueryDTO.push(list);
|
|
}
|
|
_this14.carList1.push(data);
|
|
}
|
|
_this14.$nextTick(function () {
|
|
setTimeout(function (res) {
|
|
_this14.AiVoice();
|
|
}, 300);
|
|
});
|
|
}
|
|
} else {
|
|
uni.showModal({
|
|
title: "提示",
|
|
content: "抱歉:小助手对" + _this14.getMsg + "的部分商品未识别,请检查识别信息是否正确",
|
|
success: function success(res) {}
|
|
});
|
|
}
|
|
}).catch(function (res) {
|
|
_this14.tui.toast(res);
|
|
});
|
|
case 67:
|
|
_context2.next = 76;
|
|
break;
|
|
case 69:
|
|
if (_this14.getMsg.indexOf('色,') != -1) {
|
|
_this14.getMsg = _this14.getMsg.replace(/色,/g, '色');
|
|
}
|
|
if (_this14.getMsg.indexOf('色') != -1) {
|
|
_this14.getMsg = _this14.getMsg.replace(/色/g, '色、');
|
|
}
|
|
if (_this14.getMsg.indexOf('件,') != -1) {
|
|
_this14.getMsg = _this14.getMsg.replace(/件,/g, '件');
|
|
}
|
|
if (_this14.getMsg.indexOf('件') != -1) {
|
|
_this14.getMsg = _this14.getMsg.replace(/件/g, '件,');
|
|
}
|
|
if (_this14.oneGoodsId != '' && !_this14.carList.get(_this14.oneGoodsId).isNew) {
|
|
_callObj = {
|
|
productId: _this14.carList.get(_this14.oneGoodsId).productId,
|
|
questionMsg: _this14.getMsg
|
|
};
|
|
} else {
|
|
_callObj = {
|
|
questionMsg: _this14.getMsg
|
|
};
|
|
}
|
|
_context2.next = 76;
|
|
return _this14.tui.request("/purchaseOcrPicture/callWithMessageOfPurchase", "POST", _callObj, false, true).then(function (res) {
|
|
if (res.code == 200) {
|
|
_this14.voiceText = '';
|
|
_this14.voiceText1 = '';
|
|
_this14.$refs.popup.close();
|
|
_this14.$refs.voiceBottomPopup.close();
|
|
var purchaseDetails = res.result.data.purchaseDetails;
|
|
//千问的单商品语音录入
|
|
if (_this14.oneGoodsId) {
|
|
var id = _this14.oneGoodsId;
|
|
if (purchaseDetails.length > 0) {
|
|
if (_this14.carList.get(id).productSn != '') {
|
|
for (var j = 0; j < purchaseDetails.length; j++) {
|
|
if (purchaseDetails[j].purchasePrice == "" || purchaseDetails[j].purchasePrice == null) {
|
|
purchaseDetails[j].purchasePrice = 0;
|
|
}
|
|
if (purchaseDetails[j].wholesalePrice == "" || purchaseDetails[j].wholesalePrice == null) {
|
|
purchaseDetails[j].wholesalePrice = 0;
|
|
}
|
|
if (purchaseDetails[j].price == "" || purchaseDetails[j].price == null) {
|
|
purchaseDetails[j].price = 0;
|
|
}
|
|
for (var _i16 = 0; _i16 < purchaseDetails[j].stockLogList1.length; _i16++) {
|
|
if (purchaseDetails[j].stockLogList1[_i16].productCount == "" || purchaseDetails[j].stockLogList1[_i16].productCount == null) {
|
|
purchaseDetails[j].stockLogList1[_i16].productCount = 0;
|
|
}
|
|
if (_this14.carList.get(id).productName == '') {
|
|
_this14.carList.get(id).productName = purchaseDetails[0].productName;
|
|
}
|
|
if (_this14.carList.get(id).attrId == '') {
|
|
_this14.carList.get(id).attrId = purchaseDetails[0].attrId;
|
|
}
|
|
if (_this14.carList.get(id).purchasePrice == '' || _this14.carList.get(id).purchasePrice == null) {
|
|
_this14.carList.get(id).purchasePrice = purchaseDetails[0].purchasePrice;
|
|
}
|
|
if (_this14.carList.get(id).wholesalePrice == '' || _this14.carList.get(id).wholesalePrice == null) {
|
|
_this14.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice;
|
|
}
|
|
if (_this14.carList.get(id).productPicture == '') {
|
|
_this14.carList.get(id).productPicture = purchaseDetails[0].productPicture;
|
|
}
|
|
purchaseDetails[j].stockLogList1[_i16].name = _this14.sliceMsg(purchaseDetails[j].stockLogList1[_i16].attributeList);
|
|
purchaseDetails[j].stockLogList1[_i16].productNum = purchaseDetails[j].stockLogList1[_i16].stockCount;
|
|
if (_this14.carList.get(id).stockLogList.size == 0) {
|
|
_this14.carList.get(id).stockLogList.set(purchaseDetails[j].stockLogList1[_i16].attributeList, purchaseDetails[j].stockLogList1[_i16]);
|
|
} else {
|
|
if (_this14.carList.get(id).stockLogList.has(purchaseDetails[j].stockLogList1[_i16].attributeList) == true) {
|
|
_this14.carList.get(id).stockLogList.get(purchaseDetails[j].stockLogList1[_i16].attributeList).productCount += Number(purchaseDetails[j].stockLogList1[_i16].productCount);
|
|
} else {
|
|
_this14.carList.get(id).stockLogList.set(purchaseDetails[j].stockLogList1[_i16].attributeList, purchaseDetails[j].stockLogList1[_i16]);
|
|
}
|
|
}
|
|
_this14.carList.get(id).productCount += Number(purchaseDetails[j].stockLogList1[_i16].productCount);
|
|
}
|
|
}
|
|
_this14.$nextTick(function () {
|
|
_this14.carList.get(id).price1 = Number(_this14.carList.get(id).productCount) * _this14.carList.get(id).purchasePrice;
|
|
_this14.getAllPrice();
|
|
_this14.oneGoodsId = '';
|
|
});
|
|
if (_this14.carList.get(id).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 0 && purchaseDetails[0].stockLogList1.length > 0) {
|
|
_this14.carList.get(id).stockLogList.delete('{"颜色":"均色","尺码":"均码"}');
|
|
}
|
|
} else {
|
|
var isTrue = false;
|
|
_this14.carList.forEach(function (value, key) {
|
|
if (value.productSn == purchaseDetails[0].productSn) {
|
|
isTrue = true;
|
|
that.tui.toast('该货号被页面其他商品占用,请重新输入!');
|
|
that.carList.get(id).productSn = '';
|
|
setTimeout(function (res) {
|
|
that.$forceUpdate();
|
|
}, 2000);
|
|
throw Error('被占用');
|
|
}
|
|
});
|
|
_this14.$nextTick(function () {
|
|
if (_this14.carList.get(id).productName == '') {
|
|
_this14.carList.get(id).productName = purchaseDetails[0].productName;
|
|
}
|
|
if (isTrue == false && _this14.carList.get(id).productSn == '') {
|
|
_this14.carList.get(id).productSn = purchaseDetails[0].productSn;
|
|
}
|
|
if (isTrue == false) {
|
|
if (purchaseDetails[0].productId) {
|
|
_this14.carList.get(id).id = purchaseDetails[0].productId;
|
|
_this14.carList.get(id).isNew = false;
|
|
id = purchaseDetails[0].productId;
|
|
} else if (purchaseDetails[0].productSn == '' || purchaseDetails[0].productSn == null) {
|
|
_this14.carList.get(id).id = purchaseDetails[0].productName;
|
|
id = purchaseDetails[0].productName;
|
|
} else if (purchaseDetails[0].productSn == '货号') {
|
|
_this14.carList.get(id).productSn = purchaseDetails[0].productName;
|
|
_this14.carList.get(id).id = purchaseDetails[0].productName;
|
|
id = purchaseDetails[0].productName;
|
|
} else if (purchaseDetails[0].productSn) {
|
|
_this14.carList.get(id).id = purchaseDetails[0].productSn;
|
|
id = purchaseDetails[0].productSn;
|
|
}
|
|
}
|
|
_this14.$forceUpdate();
|
|
});
|
|
if (_this14.carList.get(id).purchasePrice == '' || _this14.carList.get(id).purchasePrice == null) {
|
|
_this14.carList.get(id).purchasePrice = purchaseDetails[0].purchasePrice;
|
|
}
|
|
_this14.carList.get(id).customerCategoryList = _this14.checkPriceRule(JSON.parse(purchaseDetails[0].customerCategoryRule));
|
|
if (_this14.carList.get(id).wholesalePrice == '' || _this14.carList.get(id).wholesalePrice == null) {
|
|
_this14.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice;
|
|
}
|
|
if (_this14.carList.get(id).lsprice == '' || _this14.carList.get(id).lsprice == null) {
|
|
_this14.carList.get(id).lsprice = purchaseDetails[0].price;
|
|
}
|
|
if (_this14.carList.get(id).productPicture == '') {
|
|
_this14.carList.get(id).productPicture = purchaseDetails[0].productPicture;
|
|
}
|
|
if (purchaseDetails[0].productId) {
|
|
_this14.carList.get(id).productId = purchaseDetails[0].productId;
|
|
_this14.carList.get(id).attrId = purchaseDetails[0].attrId;
|
|
_this14.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice;
|
|
_this14.carList.get(id).lsPrice = purchaseDetails[0].lsPrice;
|
|
}
|
|
var specMap = new Map(); //新的临时存放值那个更改过的值的map
|
|
_this14.$nextTick(function () {
|
|
_this14.carList.forEach(function (value, key) {
|
|
if (key != value.id) {
|
|
specMap.set(value.id, value);
|
|
} else {
|
|
specMap.set(key, value);
|
|
}
|
|
});
|
|
_this14.carList = specMap;
|
|
});
|
|
_this14.$nextTick(function () {
|
|
for (var _j7 = 0; _j7 < purchaseDetails.length; _j7++) {
|
|
for (var _i17 = 0; _i17 < purchaseDetails[_j7].stockLogList1.length; _i17++) {
|
|
purchaseDetails[_j7].stockLogList1[_i17].name = _this14.sliceMsg(purchaseDetails[_j7].stockLogList1[_i17].attributeList);
|
|
if (_this14.carList.get(id).stockLogList.size == 0) {
|
|
_this14.carList.get(id).stockLogList.set(purchaseDetails[_j7].stockLogList1[_i17].attributeList, purchaseDetails[_j7].stockLogList1[_i17]);
|
|
} else {
|
|
if (_this14.carList.get(id).stockLogList.has(purchaseDetails[_j7].stockLogList1[_i17].attributeList) == true) {
|
|
_this14.carList.get(id).stockLogList.get(purchaseDetails[_j7].stockLogList1[_i17].attributeList).productCount += Number(purchaseDetails[_j7].stockLogList1[_i17].productCount);
|
|
_this14.carList.get(id).stockLogList.get(purchaseDetails[_j7].stockLogList1[_i17].attributeList).productNum = purchaseDetails[_j7].stockLogList1[_i17].stockCount;
|
|
} else {
|
|
_this14.carList.get(id).stockLogList.set(purchaseDetails[_j7].stockLogList1[_i17].attributeList, purchaseDetails[_j7].stockLogList1[_i17]);
|
|
_this14.carList.get(id).stockLogList.get(purchaseDetails[_j7].stockLogList1[_i17].attributeList).productNum = _this14.carList.get(id).stockLogList.get(purchaseDetails[_j7].stockLogList1[_i17].attributeList).stockCount;
|
|
}
|
|
}
|
|
_this14.carList.get(id).productCount += Number(purchaseDetails[_j7].stockLogList1[_i17].productCount);
|
|
}
|
|
}
|
|
_this14.carList.get(id).price1 = Number(_this14.carList.get(id).productCount) * _this14.carList.get(id).purchasePrice;
|
|
if (_this14.carList.get(id).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 0 && purchaseDetails[0].stockLogList1.length > 0) {
|
|
_this14.carList.get(id).stockLogList.delete('{"颜色":"均色","尺码":"均码"}');
|
|
}
|
|
});
|
|
_this14.$nextTick(function () {
|
|
_this14.getAllPrice();
|
|
_this14.oneGoodsId = '';
|
|
});
|
|
}
|
|
} else {
|
|
_this14.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确");
|
|
}
|
|
} else {
|
|
for (var _i18 = 0; _i18 < purchaseDetails.length; _i18++) {
|
|
var data = {
|
|
id: "",
|
|
price: purchaseDetails[_i18].price,
|
|
productCount: 0,
|
|
attrId: purchaseDetails[_i18].attrId,
|
|
customerCategoryList: purchaseDetails[_i18].customerCategoryRule == null ? _this14.getNewProductRule() : _this14.checkPriceRule(JSON.parse(purchaseDetails[_i18].customerCategoryRule)),
|
|
categoryId: purchaseDetails[_i18].categoryId == '' ? _this14.categoryList.categoryId : purchaseDetails[_i18].categoryId,
|
|
categoryName: purchaseDetails[_i18].categoryName == '' ? _this14.categoryList.categoryName : purchaseDetails[_i18].categoryName,
|
|
wholesalePrice: purchaseDetails[_i18].wholesalePrice,
|
|
purchasePrice: purchaseDetails[_i18].purchasePrice,
|
|
isNew: purchaseDetails[_i18].productId == null ? true : false,
|
|
productId: purchaseDetails[_i18].productId,
|
|
productName: purchaseDetails[_i18].productName,
|
|
productSn: purchaseDetails[_i18].productSn,
|
|
productPicture: purchaseDetails[_i18].productPicture,
|
|
supplierName: purchaseDetails[_i18].supplierName,
|
|
productPictures: [],
|
|
saleDetailQueryDTO: []
|
|
};
|
|
if (purchaseDetails[_i18].productId) {
|
|
data.id = purchaseDetails[_i18].productId;
|
|
} else if (purchaseDetails[_i18].productSn == '' || purchaseDetails[_i18].productSn == null) {
|
|
data.id = purchaseDetails[_i18].productName;
|
|
} else if (purchaseDetails[_i18].productSn == '货号') {
|
|
data.productSn = purchaseDetails[_i18].productName;
|
|
data.id = purchaseDetails[_i18].productName;
|
|
} else if (purchaseDetails[_i18].productSn) {
|
|
data.id = purchaseDetails[_i18].productSn;
|
|
}
|
|
for (var m = 0; m < purchaseDetails[_i18].stockLogList1.length; m++) {
|
|
var list = {
|
|
attributeList: _this14.getAttribute(purchaseDetails[_i18].stockLogList1[m].attributeList),
|
|
productCount: Number(purchaseDetails[_i18].stockLogList1[m].productCount) || Number(purchaseDetails[_i18].stockLogList1[m].productCounts),
|
|
productNum: purchaseDetails[_i18].stockLogList1[m].stockCount,
|
|
name: _this14.sliceMsg(_this14.getAttribute(purchaseDetails[_i18].stockLogList1[m].attributeList)),
|
|
price: purchaseDetails[_i18].stockLogList1[m].purchasePrice
|
|
};
|
|
data.productCount += Number(purchaseDetails[_i18].stockLogList1[m].productCount);
|
|
data.saleDetailQueryDTO.push(list);
|
|
}
|
|
_this14.carList1.push(data);
|
|
}
|
|
_this14.$nextTick(function () {
|
|
setTimeout(function (res) {
|
|
_this14.AiVoice();
|
|
}, 300);
|
|
});
|
|
}
|
|
} else {
|
|
uni.showModal({
|
|
title: "提示",
|
|
content: "抱歉:小助手对" + _this14.getMsg + "的部分商品未识别,请检查识别信息是否正确",
|
|
success: function success(res) {}
|
|
});
|
|
}
|
|
}).catch(function (res) {
|
|
_this14.tui.toast(res);
|
|
});
|
|
case 76:
|
|
case "end":
|
|
return _context2.stop();
|
|
}
|
|
}
|
|
}, _callee2, null, [[49, 58]]);
|
|
}))();
|
|
},
|
|
checkPriceRule: function checkPriceRule(ruleArr) {
|
|
if (this.customerCategoryList1 != '' && this.customerCategoryList1 != null) {
|
|
if (ruleArr == null) {
|
|
ruleArr = [];
|
|
}
|
|
for (var i = 0; i < this.customerCategoryList1.length; i++) {
|
|
var isHae = false;
|
|
if (ruleArr != null) {
|
|
for (var j = 0; j < ruleArr.length; j++) {
|
|
if (this.customerCategoryList1[i].categoryId == ruleArr[j].categoryId) {
|
|
isHae = true;
|
|
}
|
|
}
|
|
}
|
|
if (isHae == false) {
|
|
ruleArr.push(this.customerCategoryList1[i]);
|
|
}
|
|
}
|
|
}
|
|
return ruleArr;
|
|
},
|
|
getOneData: function getOneData(oneData, type, num) {
|
|
var _this15 = 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:
|
|
_context3.next = 2;
|
|
return setTimeout(function (resAAS) {
|
|
_this15.tui.request('/app/product/getShareList', "post", {
|
|
categoryId: "",
|
|
pageNum: 1,
|
|
pageSize: '1000',
|
|
searchStr: oneData.productSn
|
|
}, false, false).then(function (res) {
|
|
if (res.code == 200) {
|
|
if (res.result.records != '') {
|
|
if (res.result.records.length > 1) {
|
|
for (var i = 0; i < res.result.records.length; i++) {
|
|
if (oneData.wholesalePrice) {
|
|
res.result.records[i].wholesalePrice = oneData.wholesalePrice;
|
|
res.result.records[i].unitPrice = oneData.wholesalePrice;
|
|
res.result.records[i].discountAmount = oneData.wholesalePrice;
|
|
}
|
|
res.result.records[i].productCount = Number(oneData.productCount);
|
|
if (oneData.purchasePrice) {
|
|
res.result.records[i].purchasePrice = oneData.purchasePrice;
|
|
}
|
|
}
|
|
_this15.$nextTick(function () {
|
|
_this15.moreData.push(res.result.records);
|
|
_this15.oneData = oneData;
|
|
});
|
|
} else {
|
|
_this15.voiceText = '';
|
|
_this15.voiceText1 = '';
|
|
_this15.$refs.popup.close();
|
|
_this15.$refs.voiceBottomPopup.close();
|
|
var data = {
|
|
attributeList: '{"颜色":"均色","尺码":"均码"}',
|
|
productCount: Number(oneData.productCount) || 1,
|
|
stockCount: res.result.records[0].defaultStockCount
|
|
};
|
|
res.result.records[0].productId = res.result.records[0].id;
|
|
res.result.records[0].saleDetailQueryDTO = [];
|
|
res.result.records[0].saleDetailQueryDTO.push(data);
|
|
var purchaseDetails = res.result.records;
|
|
if (_this15.oneGoodsId) {
|
|
var id = _this15.oneGoodsId;
|
|
if (purchaseDetails.length > 0) {
|
|
if (_this15.carList.get(id).productSn != '') {
|
|
for (var j = 0; j < purchaseDetails.length; j++) {
|
|
for (var _i19 = 0; _i19 < purchaseDetails[j].saleDetailQueryDTO.length; _i19++) {
|
|
if (_this15.carList.get(id).productName == '') {
|
|
_this15.carList.get(id).productName = purchaseDetails[0].productName;
|
|
}
|
|
_this15.carList.get(id).customerCategoryList = purchaseDetails[0].customerCategoryRule != null ? _this15.checkPriceRule(JSON.parse(purchaseDetails[0].customerCategoryRule)) : _this15.getNewProductRule();
|
|
if (_this15.carList.get(id).attrId == '') {
|
|
_this15.carList.get(id).attrId = purchaseDetails[0].attrId;
|
|
}
|
|
if (_this15.carList.get(id).purchasePrice == '' || _this15.carList.get(id).purchasePrice == null) {
|
|
if (oneData.purchasePrice) {
|
|
_this15.carList.get(id).purchasePrice = oneData.purchasePrice;
|
|
} else {
|
|
_this15.carList.get(id).purchasePrice = purchaseDetails[0].purchasePrice;
|
|
}
|
|
}
|
|
if (_this15.carList.get(id).productPicture == '') {
|
|
_this15.carList.get(id).productPicture = purchaseDetails[0].productPicture;
|
|
}
|
|
purchaseDetails[j].saleDetailQueryDTO[_i19].name = _this15.sliceMsg(purchaseDetails[j].saleDetailQueryDTO[_i19].attributeList);
|
|
if (_this15.carList.get(id).stockLogList.size == 0) {
|
|
_this15.carList.get(id).stockLogList.set(purchaseDetails[j].saleDetailQueryDTO[_i19].attributeList, purchaseDetails[j].saleDetailQueryDTO[_i19]);
|
|
} else {
|
|
if (_this15.carList.get(id).stockLogList.has(purchaseDetails[j].saleDetailQueryDTO[_i19].attributeList) == true) {
|
|
_this15.carList.get(id).stockLogList.get(purchaseDetails[j].saleDetailQueryDTO[_i19].attributeList).productCount += Number(purchaseDetails[j].saleDetailQueryDTO[_i19].productCount);
|
|
} else {
|
|
_this15.carList.get(id).stockLogList.set(purchaseDetails[j].saleDetailQueryDTO[_i19].attributeList, purchaseDetails[j].saleDetailQueryDTO[_i19]);
|
|
}
|
|
}
|
|
_this15.carList.get(id).productCount += Number(purchaseDetails[j].saleDetailQueryDTO[_i19].productCount);
|
|
}
|
|
}
|
|
if (_this15.carList.get(id).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 0 && purchaseDetails[0].saleDetailQueryDTO.length > 0) {
|
|
_this15.carList.get(id).stockLogList.delete('{"颜色":"均色","尺码":"均码"}');
|
|
}
|
|
_this15.carList.get(id).price1 = Number(_this15.carList.get(id).productCount) * _this15.carList.get(id).purchasePrice;
|
|
} else {
|
|
var isTrue = false;
|
|
_this15.carList.forEach(function (value, key) {
|
|
if (value.productSn == purchaseDetails[0].productSn) {
|
|
isTrue = true;
|
|
that.tui.toast('该货号被页面其他商品占用,请重新输入!');
|
|
that.carList.get(id).productSn = '';
|
|
setTimeout(function (resNM) {
|
|
that.$forceUpdate();
|
|
}, 2000);
|
|
throw Error('被占用');
|
|
}
|
|
});
|
|
_this15.$nextTick(function () {
|
|
if (_this15.carList.get(id).productName == '') {
|
|
_this15.carList.get(id).productName = purchaseDetails[0].productName;
|
|
}
|
|
if (isTrue == false && _this15.carList.get(id).productSn == '') {
|
|
_this15.carList.get(id).productSn = purchaseDetails[0].productSn;
|
|
}
|
|
if (isTrue == false) {
|
|
if (purchaseDetails[0].productId) {
|
|
_this15.carList.get(id).id = purchaseDetails[0].productId;
|
|
_this15.carList.get(id).productId = purchaseDetails[0].productId;
|
|
_this15.carList.get(id).isNew = false;
|
|
id = purchaseDetails[0].productId;
|
|
} else if (purchaseDetails[0].productSn == '' || purchaseDetails[0].productSn == null) {
|
|
_this15.carList.get(id).id = purchaseDetails[0].productName;
|
|
id = purchaseDetails[0].productName;
|
|
} else if (purchaseDetails[0].productSn == '货号') {
|
|
_this15.carList.get(id).productSn = purchaseDetails[0].productName;
|
|
_this15.carList.get(id).id = purchaseDetails[0].productName;
|
|
id = purchaseDetails[0].productName;
|
|
} else if (purchaseDetails[0].productSn) {
|
|
_this15.carList.get(id).id = purchaseDetails[0].productSn;
|
|
id = purchaseDetails[0].productSn;
|
|
}
|
|
}
|
|
_this15.$forceUpdate();
|
|
});
|
|
if (_this15.carList.get(id).purchasePrice == '' || _this15.carList.get(id).purchasePrice == null) {
|
|
if (oneData.purchasePrice) {
|
|
_this15.carList.get(id).purchasePrice = oneData.purchasePrice;
|
|
} else {
|
|
_this15.carList.get(id).purchasePrice = purchaseDetails[0].purchasePrice;
|
|
}
|
|
}
|
|
if (_this15.carList.get(id).productPicture == '') {
|
|
_this15.carList.get(id).productPicture = purchaseDetails[0].productPicture;
|
|
}
|
|
if (purchaseDetails[0].productId) {
|
|
_this15.carList.get(id).attrId = purchaseDetails[0].attrId;
|
|
_this15.carList.get(id).wholesalePrice = purchaseDetails[0].wholesalePrice;
|
|
_this15.carList.get(id).lsPrice = purchaseDetails[0].lsPrice;
|
|
}
|
|
var specMap = new Map(); //新的临时存放值那个更改过的值的map
|
|
_this15.$nextTick(function () {
|
|
_this15.carList.forEach(function (value, key) {
|
|
if (key != value.id) {
|
|
specMap.set(value.id, value);
|
|
} else {
|
|
specMap.set(key, value);
|
|
}
|
|
});
|
|
_this15.carList = specMap;
|
|
});
|
|
_this15.$nextTick(function () {
|
|
for (var _j8 = 0; _j8 < purchaseDetails.length; _j8++) {
|
|
for (var _i20 = 0; _i20 < purchaseDetails[_j8].saleDetailQueryDTO.length; _i20++) {
|
|
purchaseDetails[_j8].saleDetailQueryDTO[_i20].name = _this15.sliceMsg(purchaseDetails[_j8].saleDetailQueryDTO[_i20].attributeList);
|
|
if (_this15.carList.get(id).stockLogList.size == 0) {
|
|
_this15.carList.get(id).stockLogList.set(purchaseDetails[_j8].saleDetailQueryDTO[_i20].attributeList, purchaseDetails[_j8].saleDetailQueryDTO[_i20]);
|
|
} else {
|
|
if (_this15.carList.get(id).stockLogList.has(purchaseDetails[_j8].saleDetailQueryDTO[_i20].attributeList) == true) {
|
|
_this15.carList.get(id).stockLogList.get(purchaseDetails[_j8].saleDetailQueryDTO[_i20].attributeList).productCount += Number(purchaseDetails[_j8].saleDetailQueryDTO[_i20].productCount);
|
|
} else {
|
|
_this15.carList.get(id).stockLogList.set(purchaseDetails[_j8].saleDetailQueryDTO[_i20].attributeList, purchaseDetails[_j8].saleDetailQueryDTO[_i20]);
|
|
}
|
|
}
|
|
_this15.carList.get(id).productCount += Number(purchaseDetails[_j8].saleDetailQueryDTO[_i20].productCount);
|
|
}
|
|
}
|
|
_this15.carList.get(id).price1 = Number(_this15.carList.get(id).productCount) * _this15.carList.get(id).purchasePrice;
|
|
_this15.carList.get(id).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productNum = purchaseDetails[0].defaultStockCount;
|
|
if (_this15.carList.get(id).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 0 && purchaseDetails[0].saleDetailQueryDTO.length > 0) {
|
|
_this15.carList.get(id).stockLogList.delete('{"颜色":"均色","尺码":"均码"}');
|
|
}
|
|
});
|
|
}
|
|
_this15.$nextTick(function () {
|
|
_this15.getAllPrice();
|
|
_this15.oneGoodsId = '';
|
|
});
|
|
} else {
|
|
_this15.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确");
|
|
}
|
|
} else {
|
|
// for (let i = 0; i < purchaseDetails.length; i++) {
|
|
var _data3 = {
|
|
id: "",
|
|
price: purchaseDetails[0].price,
|
|
productCount: 0,
|
|
attrId: purchaseDetails[0].attrId,
|
|
customerCategoryList: purchaseDetails[0].customerCategoryRule != null ? _this15.checkPriceRule(JSON.parse(purchaseDetails[0].customerCategoryRule)) : _this15.getNewProductRule(),
|
|
categoryId: purchaseDetails[0].categoryId == '' ? _this15.categoryList.categoryId : purchaseDetails[0].categoryId,
|
|
categoryName: purchaseDetails[0].categoryName == '' ? _this15.categoryList.categoryName : purchaseDetails[0].categoryName,
|
|
wholesalePrice: purchaseDetails[0].wholesalePrice,
|
|
purchasePrice: oneData.purchasePrice ? oneData.purchasePrice : purchaseDetails[0].purchasePrice,
|
|
isNew: purchaseDetails[0].productId == null ? true : false,
|
|
productId: purchaseDetails[0].productId,
|
|
productName: purchaseDetails[0].productName,
|
|
productSn: purchaseDetails[0].productSn,
|
|
productPicture: purchaseDetails[0].productPicture,
|
|
supplierName: purchaseDetails[0].supplierName,
|
|
productPictures: [],
|
|
saleDetailQueryDTO: []
|
|
};
|
|
if (purchaseDetails[0].productId) {
|
|
_data3.id = purchaseDetails[0].productId;
|
|
} else if (purchaseDetails[0].productSn == '' || purchaseDetails[0].productSn == null) {
|
|
_data3.id = purchaseDetails[0].productName;
|
|
} else if (purchaseDetails[0].productSn == '货号') {
|
|
_data3.productSn = purchaseDetails[0].productName;
|
|
_data3.id = purchaseDetails[0].productName;
|
|
} else if (purchaseDetails[0].productSn) {
|
|
_data3.id = purchaseDetails[0].productSn;
|
|
}
|
|
// for (let m = 0; m < purchaseDetails[0].saleDetailQueryDTO.length; m++) {
|
|
var list = {
|
|
attributeList: _this15.getAttribute(purchaseDetails[0].saleDetailQueryDTO[0].attributeList),
|
|
productCount: Number(purchaseDetails[0].saleDetailQueryDTO[0].productCount) || Number(purchaseDetails[0].saleDetailQueryDTO[0].productCounts),
|
|
productNum: purchaseDetails[0].saleDetailQueryDTO[0].stockCount,
|
|
name: _this15.sliceMsg(_this15.getAttribute(purchaseDetails[0].saleDetailQueryDTO[0].attributeList)),
|
|
price: purchaseDetails[0].saleDetailQueryDTO[0].purchasePrice
|
|
};
|
|
_data3.productCount += Number(purchaseDetails[0].saleDetailQueryDTO[0].productCount);
|
|
_data3.saleDetailQueryDTO.push(list);
|
|
// }
|
|
_this15.carList1.push(_data3);
|
|
// }
|
|
uni.showLoading({
|
|
title: '加载中...'
|
|
});
|
|
if (type == true) {
|
|
_this15.$nextTick(function () {
|
|
setTimeout(function (resLK) {
|
|
_this15.AiVoice();
|
|
uni.hideLoading();
|
|
}, 300);
|
|
});
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
// this.$nextTick(() => {
|
|
// setTimeout(ressD => {
|
|
_this15.voiceText = '';
|
|
_this15.voiceText1 = '';
|
|
_this15.$refs.popup.close();
|
|
_this15.$refs.voiceBottomPopup.close();
|
|
if (oneData.productCount) {
|
|
oneData.productCount = Number(oneData.productCount);
|
|
}
|
|
var _data4 = {
|
|
id: oneData.productSn,
|
|
productCount: Number(oneData.productCount) || 0,
|
|
productName: oneData.productName,
|
|
productSn: oneData.productSn,
|
|
customerCategoryList: _this15.getNewProductRule(),
|
|
categoryId: _this15.categoryList.categoryId,
|
|
categoryName: _this15.categoryList.categoryName,
|
|
purchasePrice: oneData.purchasePrice || 0,
|
|
wholesalePrice: oneData.wholesalePrice || 0,
|
|
saleDetailQueryDTO: [{
|
|
attributeList: '{"颜色":"均色","尺码":"均码"}',
|
|
productCount: Number(oneData.productCount) || 1,
|
|
stockCount: null
|
|
}]
|
|
};
|
|
var _purchaseDetails2 = [];
|
|
_purchaseDetails2.push(_data4);
|
|
if (_this15.oneGoodsId) {
|
|
var _id4 = _this15.oneGoodsId;
|
|
if (_purchaseDetails2.length > 0) {
|
|
if (_this15.carList.get(_id4).productSn != '') {
|
|
for (var _j9 = 0; _j9 < _purchaseDetails2.length; _j9++) {
|
|
for (var _i21 = 0; _i21 < _purchaseDetails2[_j9].saleDetailQueryDTO.length; _i21++) {
|
|
if (_this15.carList.get(_id4).productName == '') {
|
|
_this15.carList.get(_id4).productName = _purchaseDetails2[0].productName;
|
|
}
|
|
if (_this15.carList.get(_id4).attrId == '') {
|
|
_this15.carList.get(_id4).attrId = _purchaseDetails2[0].attrId;
|
|
}
|
|
_this15.carList.get(_id4).customerCategoryList = _purchaseDetails2[0].customerCategoryList;
|
|
if (_this15.carList.get(_id4).purchasePrice == '' || _this15.carList.get(_id4).purchasePrice == null) {
|
|
_this15.carList.get(_id4).purchasePrice = _purchaseDetails2[0].purchasePrice;
|
|
}
|
|
if (_this15.carList.get(_id4).productPicture == '') {
|
|
_this15.carList.get(_id4).productPicture = _purchaseDetails2[0].productPicture;
|
|
}
|
|
_purchaseDetails2[_j9].saleDetailQueryDTO[_i21].name = _this15.sliceMsg(_purchaseDetails2[_j9].saleDetailQueryDTO[_i21].attributeList);
|
|
if (_this15.carList.get(_id4).stockLogList.size == 0) {
|
|
_this15.carList.get(_id4).stockLogList.set(_purchaseDetails2[_j9].saleDetailQueryDTO[_i21].attributeList, _purchaseDetails2[_j9].saleDetailQueryDTO[_i21]);
|
|
} else {
|
|
if (_this15.carList.get(_id4).stockLogList.has(_purchaseDetails2[_j9].saleDetailQueryDTO[_i21].attributeList) == true) {
|
|
_this15.carList.get(_id4).stockLogList.get(_purchaseDetails2[_j9].saleDetailQueryDTO[_i21].attributeList).productCount += Number(_purchaseDetails2[_j9].saleDetailQueryDTO[_i21].productCount);
|
|
} else {
|
|
_this15.carList.get(_id4).stockLogList.set(_purchaseDetails2[_j9].saleDetailQueryDTO[_i21].attributeList, _purchaseDetails2[_j9].saleDetailQueryDTO[_i21]);
|
|
}
|
|
}
|
|
_this15.carList.get(_id4).productCount += Number(_purchaseDetails2[_j9].saleDetailQueryDTO[_i21].productCount);
|
|
}
|
|
}
|
|
if (_this15.carList.get(_id4).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 0 && _purchaseDetails2[0].saleDetailQueryDTO.length > 0) {
|
|
_this15.carList.get(_id4).stockLogList.delete('{"颜色":"均色","尺码":"均码"}');
|
|
}
|
|
_this15.carList.get(_id4).price1 = Number(_this15.carList.get(_id4).productCount) * _this15.carList.get(_id4).purchasePrice;
|
|
} else {
|
|
var _isTrue2 = false;
|
|
_this15.carList.forEach(function (value, key) {
|
|
if (value.productSn == _purchaseDetails2[0].productSn) {
|
|
_isTrue2 = true;
|
|
that.tui.toast('该货号被页面其他商品占用,请重新输入!');
|
|
that.carList.get(_id4).productSn = '';
|
|
setTimeout(function (resSLD) {
|
|
that.$forceUpdate();
|
|
}, 2000);
|
|
throw Error('被占用');
|
|
}
|
|
});
|
|
_this15.$nextTick(function () {
|
|
if (_this15.carList.get(_id4).productName == '') {
|
|
_this15.carList.get(_id4).productName = _purchaseDetails2[0].productName;
|
|
}
|
|
_this15.carList.get(_id4).customerCategoryList = _purchaseDetails2[0].customerCategoryList;
|
|
if (_isTrue2 == false && _this15.carList.get(_id4).productSn == '') {
|
|
_this15.carList.get(_id4).productSn = _purchaseDetails2[0].productSn;
|
|
}
|
|
if (_isTrue2 == false) {
|
|
if (_purchaseDetails2[0].productId) {
|
|
_this15.carList.get(_id4).id = _purchaseDetails2[0].productId;
|
|
_this15.carList.get(_id4).isNew = false;
|
|
_id4 = _purchaseDetails2[0].productId;
|
|
} else if (_purchaseDetails2[0].productSn == '' || _purchaseDetails2[0].productSn == null) {
|
|
_this15.carList.get(_id4).id = _purchaseDetails2[0].productName;
|
|
_id4 = _purchaseDetails2[0].productName;
|
|
} else if (_purchaseDetails2[0].productSn == '货号') {
|
|
_this15.carList.get(_id4).productSn = _purchaseDetails2[0].productName;
|
|
_this15.carList.get(_id4).id = _purchaseDetails2[0].productName;
|
|
_id4 = _purchaseDetails2[0].productName;
|
|
} else if (_purchaseDetails2[0].productSn) {
|
|
_this15.carList.get(_id4).id = _purchaseDetails2[0].productSn;
|
|
_id4 = _purchaseDetails2[0].productSn;
|
|
}
|
|
}
|
|
_this15.$forceUpdate();
|
|
});
|
|
if (_this15.carList.get(_id4).purchasePrice == '' || _this15.carList.get(_id4).purchasePrice == null) {
|
|
_this15.carList.get(_id4).purchasePrice = _purchaseDetails2[0].purchasePrice;
|
|
}
|
|
if (_this15.carList.get(_id4).productPicture == '') {
|
|
_this15.carList.get(_id4).productPicture = _purchaseDetails2[0].productPicture;
|
|
}
|
|
if (_purchaseDetails2[0].productId) {
|
|
_this15.carList.get(_id4).attrId = _purchaseDetails2[0].attrId;
|
|
_this15.carList.get(_id4).lsPrice = _purchaseDetails2[0].lsPrice;
|
|
}
|
|
_this15.carList.get(_id4).wholesalePrice = _purchaseDetails2[0].wholesalePrice;
|
|
var _specMap2 = new Map(); //新的临时存放值那个更改过的值的map
|
|
_this15.$nextTick(function () {
|
|
_this15.carList.forEach(function (value, key) {
|
|
if (key != value.id) {
|
|
_specMap2.set(value.id, value);
|
|
} else {
|
|
_specMap2.set(key, value);
|
|
}
|
|
});
|
|
_this15.carList = _specMap2;
|
|
});
|
|
_this15.$nextTick(function () {
|
|
for (var _j10 = 0; _j10 < _purchaseDetails2.length; _j10++) {
|
|
for (var _i22 = 0; _i22 < _purchaseDetails2[_j10].saleDetailQueryDTO.length; _i22++) {
|
|
_purchaseDetails2[_j10].saleDetailQueryDTO[_i22].name = _this15.sliceMsg(_purchaseDetails2[_j10].saleDetailQueryDTO[_i22].attributeList);
|
|
if (_this15.carList.get(_id4).stockLogList.size == 0) {
|
|
_this15.carList.get(_id4).stockLogList.set(_purchaseDetails2[_j10].saleDetailQueryDTO[_i22].attributeList, _purchaseDetails2[_j10].saleDetailQueryDTO[_i22]);
|
|
} else {
|
|
if (_this15.carList.get(_id4).stockLogList.has(_purchaseDetails2[_j10].saleDetailQueryDTO[_i22].attributeList) == true) {
|
|
_this15.carList.get(_id4).stockLogList.get(_purchaseDetails2[_j10].saleDetailQueryDTO[_i22].attributeList).productCount += Number(_purchaseDetails2[_j10].saleDetailQueryDTO[_i22].productCount);
|
|
} else {
|
|
_this15.carList.get(_id4).stockLogList.set(_purchaseDetails2[_j10].saleDetailQueryDTO[_i22].attributeList, _purchaseDetails2[_j10].saleDetailQueryDTO[_i22]);
|
|
}
|
|
}
|
|
_this15.carList.get(_id4).productCount += Number(_purchaseDetails2[_j10].saleDetailQueryDTO[_i22].productCount);
|
|
}
|
|
}
|
|
_this15.carList.get(_id4).price1 = Number(_this15.carList.get(_id4).productCount) * _this15.carList.get(_id4).purchasePrice;
|
|
if (_this15.carList.get(_id4).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount == 0 && _purchaseDetails2[0].saleDetailQueryDTO.length > 0) {
|
|
_this15.carList.get(_id4).stockLogList.delete('{"颜色":"均色","尺码":"均码"}');
|
|
}
|
|
});
|
|
}
|
|
_this15.$nextTick(function () {
|
|
_this15.getAllPrice();
|
|
_this15.oneGoodsId = '';
|
|
});
|
|
} else {
|
|
_this15.tui.toast("抱歉:小助手本次未识别到商品信息,请检查识别信息是否正确");
|
|
}
|
|
} else {
|
|
for (var _i23 = 0; _i23 < _purchaseDetails2.length; _i23++) {
|
|
var _data5 = {
|
|
id: "",
|
|
price: _purchaseDetails2[_i23].price,
|
|
productCount: 0,
|
|
attrId: _purchaseDetails2[_i23].attrId,
|
|
customerCategoryList: _purchaseDetails2[_i23].customerCategoryList,
|
|
categoryId: _purchaseDetails2[_i23].categoryId == '' ? _this15.categoryList.categoryId : _purchaseDetails2[_i23].categoryId,
|
|
categoryName: _purchaseDetails2[_i23].categoryName == '' ? _this15.categoryList.categoryName : _purchaseDetails2[_i23].categoryName,
|
|
wholesalePrice: _purchaseDetails2[_i23].wholesalePrice,
|
|
purchasePrice: _purchaseDetails2[_i23].purchasePrice,
|
|
isNew: _purchaseDetails2[_i23].productId == null ? true : false,
|
|
productId: _purchaseDetails2[_i23].productId,
|
|
productName: _purchaseDetails2[_i23].productName,
|
|
productSn: _purchaseDetails2[_i23].productSn,
|
|
productPicture: _purchaseDetails2[_i23].productPicture,
|
|
supplierName: _purchaseDetails2[_i23].supplierName,
|
|
productPictures: [],
|
|
saleDetailQueryDTO: []
|
|
};
|
|
if (_purchaseDetails2[_i23].productId) {
|
|
_data5.id = _purchaseDetails2[_i23].productId;
|
|
} else if (_purchaseDetails2[_i23].productSn == '' || _purchaseDetails2[_i23].productSn == null) {
|
|
_data5.id = _purchaseDetails2[_i23].productName;
|
|
} else if (_purchaseDetails2[_i23].productSn == '货号') {
|
|
_data5.productSn = _purchaseDetails2[_i23].productName;
|
|
_data5.id = _purchaseDetails2[_i23].productName;
|
|
} else if (_purchaseDetails2[_i23].productSn) {
|
|
_data5.id = _purchaseDetails2[_i23].productSn;
|
|
}
|
|
for (var m = 0; m < _purchaseDetails2[_i23].saleDetailQueryDTO.length; m++) {
|
|
var _list = {
|
|
attributeList: _this15.getAttribute(_purchaseDetails2[_i23].saleDetailQueryDTO[m].attributeList),
|
|
productCount: Number(_purchaseDetails2[_i23].saleDetailQueryDTO[m].productCount) || Number(_purchaseDetails2[_i23].saleDetailQueryDTO[m].productCounts),
|
|
productNum: '',
|
|
name: _this15.sliceMsg(_this15.getAttribute(_purchaseDetails2[_i23].saleDetailQueryDTO[m].attributeList)),
|
|
price: _purchaseDetails2[_i23].saleDetailQueryDTO[m].purchasePrice
|
|
};
|
|
_data5.productCount += Number(_purchaseDetails2[_i23].saleDetailQueryDTO[m].productCount);
|
|
_data5.saleDetailQueryDTO.push(_list);
|
|
}
|
|
_this15.carList1.push(_data5);
|
|
}
|
|
uni.showLoading({
|
|
title: '加载中...'
|
|
});
|
|
if (type == true) {
|
|
_this15.$nextTick(function () {
|
|
setTimeout(function (resDAAS) {
|
|
_this15.AiVoice();
|
|
uni.hideLoading();
|
|
}, 500);
|
|
});
|
|
}
|
|
}
|
|
// }, 200 * (num +1))
|
|
|
|
// })
|
|
}
|
|
|
|
setTimeout(function (res) {
|
|
if (type == true && _this15.moreData.length > 0) {
|
|
_this15.$refs.popup.close();
|
|
_this15.$refs.voiceBottomPopup.close();
|
|
_this15.$refs.oneDataPopup.open();
|
|
_this15.showPopup(0);
|
|
}
|
|
}, 300);
|
|
}
|
|
});
|
|
}, 100);
|
|
case 2:
|
|
case "end":
|
|
return _context3.stop();
|
|
}
|
|
}
|
|
}, _callee3);
|
|
}))();
|
|
},
|
|
delItemSn: function delItemSn(val) {
|
|
var that = this;
|
|
uni.showModal({
|
|
title: "提示",
|
|
content: "确定删除此条货号规则吗?",
|
|
success: function success(res) {
|
|
if (res.confirm) {
|
|
that.tui.request("/app/productSn/checkProductSn", "post", {
|
|
snPre: val.value
|
|
}, false, true).then(function (res1) {
|
|
if (res1.code == 200) {
|
|
that.tui.request("/app/productSn/deleteProductSn", "post", {
|
|
id: res1.result.id
|
|
}, false, true).then(function (res2) {
|
|
if (res2.code == 200) {
|
|
that.tui.toast('删除成功');
|
|
setTimeout(function (res) {
|
|
that.getSnList();
|
|
}, 1000);
|
|
} else {
|
|
uni.showToast({
|
|
title: res2.message,
|
|
icon: 'none'
|
|
});
|
|
}
|
|
}).catch(function (res) {});
|
|
} else {
|
|
uni.showToast({
|
|
title: res1.message,
|
|
icon: 'none'
|
|
});
|
|
}
|
|
}).catch(function (res) {});
|
|
}
|
|
}
|
|
});
|
|
},
|
|
dialogInputConfirm: function dialogInputConfirm(e) {
|
|
if (this.categoryText == '') {
|
|
this.tui.toast("请输入规格值后提交");
|
|
return;
|
|
}
|
|
//this.goodsDetail[0] 颜色
|
|
//this.goodsDetail[1] 尺码
|
|
this.$refs.inputDialog.close();
|
|
var data = {
|
|
isChecked: false,
|
|
value: this.categoryText
|
|
};
|
|
if (this.isOpenId == '0') {
|
|
this.goodsDetail.attributeList[0].value.push(data);
|
|
this.dataObj.set(data.value, '颜色');
|
|
} else if (this.isOpenId == '1') {
|
|
this.goodsDetail.attributeList[1].value.push(data);
|
|
this.dataObj.set(data.value, '尺码');
|
|
}
|
|
this.$refs.clearInput.onClear();
|
|
this.categoryText = '';
|
|
this.$forceUpdate();
|
|
},
|
|
dialogClose: function dialogClose() {
|
|
this.inputVal = '';
|
|
this.$refs.inputDialog.close();
|
|
this.$refs.clearInput.onClear();
|
|
this.categoryText = '';
|
|
},
|
|
//去掉空格和换行
|
|
trimWhitespace: function trimWhitespace(str) {
|
|
return str.replace(/\s+/g, '');
|
|
},
|
|
combination: function combination(arr) {
|
|
var result = [[]];
|
|
arr.map(function (x) {
|
|
var res = [];
|
|
result.map(function (y) {
|
|
x.specs.map(function (z) {
|
|
res.push([].concat((0, _toConsumableArray2.default)(y), [z]));
|
|
});
|
|
});
|
|
result = res;
|
|
});
|
|
return result;
|
|
},
|
|
//获取分类列表
|
|
getGategoryList: function getGategoryList() {
|
|
var _this16 = this;
|
|
this.tui.request("/app/productCategory/list", "get", {}, false, true).then(function (res) {
|
|
if (res.code == 200) {
|
|
_this16.indexList = res.result;
|
|
_this16.$refs.clearInput.onClear();
|
|
_this16.categoryText = "";
|
|
} else {
|
|
_this16.tui.toast(res.message);
|
|
}
|
|
}).catch(function (res) {});
|
|
},
|
|
//扫一扫功能
|
|
scanCodeAdd: function scanCodeAdd() {
|
|
var that = this;
|
|
uni.scanCode({
|
|
success: function success(res) {
|
|
if (res.scanType == "QR_CODE") {
|
|
//二维码
|
|
|
|
var shopId = _base.default.decode(res.result.split(',')[1]);
|
|
if (shopId == uni.getStorageSync('shopId').substring('10', '12')) {
|
|
that.productId = _base.default.decode(res.result.split(',')[0]);
|
|
that.toggle('bottom', _base.default.decode(res.result.split(',')[0]));
|
|
// if (item.saleDetailDTOList) {
|
|
// for (let i = 0; i < item.saleDetailDTOList.length; i++) {
|
|
// this.carList.push(item.saleDetailDTOList[i])
|
|
// }
|
|
// }
|
|
} else {
|
|
that.tui.toast('您的店铺中暂无该商品!');
|
|
}
|
|
} else {
|
|
that.tui.request("/app/product/getByBarcode", "POST", {
|
|
barcode: res.result
|
|
}, false, true).then(function (res1) {
|
|
if (res1.code == 200) {
|
|
that.productId = res1.result[0].id;
|
|
if (res1.result == '') {
|
|
that.tui.toast('您的店铺中暂无该商品!');
|
|
} else {
|
|
that.toggle('bottom', res1.result[0].id);
|
|
// if (item.saleDetailDTOList) {
|
|
// for (let i = 0; i < item.saleDetailDTOList.length; i++) {
|
|
// this.carList.push(item.saleDetailDTOList[i])
|
|
// }
|
|
// }
|
|
}
|
|
} else {
|
|
that.tui.toast(res.message);
|
|
}
|
|
}).catch(function (res) {
|
|
that.tui.toast(res);
|
|
});
|
|
}
|
|
},
|
|
fail: function fail(res) {
|
|
uni.showToast({
|
|
title: '扫描失败',
|
|
icon: 'none'
|
|
});
|
|
}
|
|
});
|
|
},
|
|
getZhuBigImage: function getZhuBigImage(path) {
|
|
var paths = [];
|
|
paths.push(path);
|
|
uni.previewImage({
|
|
urls: paths
|
|
});
|
|
},
|
|
uploadFilePromise: function uploadFilePromise(value) {
|
|
var that = this;
|
|
uni.chooseMedia({
|
|
count: 1,
|
|
mediaType: ['image'],
|
|
sourceType: ['album', 'camera'],
|
|
camera: 'back',
|
|
success: function success(res) {
|
|
uni.compressImage({
|
|
src: res.tempFiles[0].tempFilePath,
|
|
quality: 50,
|
|
success: function success(res1) {
|
|
uni.uploadFile({
|
|
url: that.tui.interfaceUrl() + '/upload/file',
|
|
filePath: res1.tempFilePath,
|
|
name: 'file',
|
|
header: {
|
|
"content-type": "multipart/form-data",
|
|
'accessToken': that.tui.getToken()
|
|
},
|
|
formData: {},
|
|
success: function success(uploadFileRes) {
|
|
that.carList.get(value[0]).productPicture = '';
|
|
var path = JSON.parse(uploadFileRes.data);
|
|
//后端返回的地址,存入图片地址
|
|
that.carList.get(value[0]).productPicture = path.result;
|
|
that.$forceUpdate();
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
});
|
|
},
|
|
goodsAdd: function goodsAdd() {
|
|
uni.navigateTo({
|
|
url: "/package1/inventory/changeGoods1"
|
|
});
|
|
},
|
|
mergeGoods: function mergeGoods() {},
|
|
//上传子图
|
|
uploadZi: function uploadZi(id) {},
|
|
addGategory: function addGategory(e) {
|
|
var _this17 = this;
|
|
var multipleList = [{
|
|
attributeName: '颜色',
|
|
productAttributeValueVoList: [{
|
|
isChecked: true,
|
|
value: "均色"
|
|
}]
|
|
}, {
|
|
attributeName: '尺码',
|
|
productAttributeValueVoList: [{
|
|
isChecked: true,
|
|
value: "均码"
|
|
}]
|
|
}];
|
|
this.tui.request("/app/productCategory/batchSaveCategoryAndAttribute", "post", {
|
|
categoryName: this.categoryText,
|
|
productAttributeOfAddVos: multipleList
|
|
}, false, false).then(function (res) {
|
|
if (res.code == 200) {
|
|
_this17.getGategoryList();
|
|
uni.showToast({
|
|
title: "添加成功",
|
|
icon: 'none'
|
|
});
|
|
} else {
|
|
uni.showToast({
|
|
title: "添加失败",
|
|
icon: 'none'
|
|
});
|
|
}
|
|
_this17.$refs.addGateDialog.close();
|
|
}).catch(function (res) {});
|
|
},
|
|
allChange: function allChange(e) {
|
|
if (this.linshiPrice == e.target.value) {
|
|
this.allChangeNum = e.target.value;
|
|
} else {
|
|
if (e.target.value == '') {
|
|
this.allChangeNum = this.linshiPrice;
|
|
} else {
|
|
this.allChangeNum = e.target.value;
|
|
}
|
|
}
|
|
//监听到输入框改变,给所有的都赋值
|
|
if (this.isPlusAndMinus == false) {
|
|
for (var i = 0; i < this.temporaryList.length; i++) {
|
|
if (this.evalue.length == 0) {
|
|
this.temporaryList[i].productCount = Number(this.allChangeNum);
|
|
} else {
|
|
for (var j = 0; j < this.evalue.length; j++) {
|
|
if (this.evalue[j] == this.temporaryList[i].name) {
|
|
this.temporaryList[i].productCount = Number(this.allChangeNum);
|
|
}
|
|
}
|
|
}
|
|
for (var m = 0; m < this.pageOldTemList.length; m++) {
|
|
if (this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList) {
|
|
this.pageOldTemList[m].productCount = Number(this.temporaryList[i].productCount);
|
|
}
|
|
}
|
|
for (var j = 0; j < this.oldTemList.length; j++) {
|
|
if (this.temporaryList[i].attributeList == this.oldTemList[j].attributeList) {
|
|
this.oldTemList[j].productCount = Number(this.temporaryList[i].productCount);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.isPlusAndMinus == false;
|
|
this.temporaryChange();
|
|
},
|
|
maskClick: function maskClick() {},
|
|
mapMinusNum: function mapMinusNum(index) {
|
|
var _this18 = this;
|
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
while (1) {
|
|
switch (_context4.prev = _context4.next) {
|
|
case 0:
|
|
_this18.temporaryList[index].productCount--;
|
|
_this18.temporaryChange();
|
|
case 2:
|
|
case "end":
|
|
return _context4.stop();
|
|
}
|
|
}
|
|
}, _callee4);
|
|
}))();
|
|
},
|
|
mapPlusNum: function mapPlusNum(index) {
|
|
this.temporaryList[index].productCount++;
|
|
this.temporaryChange();
|
|
},
|
|
oneMinusNum: function oneMinusNum(index, index1) {
|
|
var _this19 = 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 = _this19;
|
|
_this19.carList.get(index).productCount = 0;
|
|
_this19.carList.get(index).returnCount = 0;
|
|
if (_this19.carList.get(index).stockLogList.get(index1).productCount <= 0) {
|
|
_this19.carList.get(index).stockLogList.get(index1).productCount = 0;
|
|
} else {
|
|
_this19.carList.get(index).stockLogList.get(index1).productCount--;
|
|
}
|
|
_context5.next = 6;
|
|
return _this19.carList.get(index).stockLogList.forEach(function (value, key) {
|
|
if (value.productCount < 0) {
|
|
that.carList.get(index).returnCount = Number(that.carList.get(index).returnCount) + Math.abs(value.productCount);
|
|
} else {
|
|
that.carList.get(index).productCount = Number(that.carList.get(index).productCount) + Number(value.productCount);
|
|
}
|
|
});
|
|
case 6:
|
|
_context5.next = 8;
|
|
return _this19.$nextTick(function () {
|
|
// if (that.discountType != 0) { //单品折扣
|
|
that.carList.get(index).price1 = Number(that.carList.get(index).productCount) * that.carList.get(index).purchasePrice;
|
|
// }
|
|
});
|
|
case 8:
|
|
_this19.$forceUpdate();
|
|
_this19.getAllPrice();
|
|
case 10:
|
|
case "end":
|
|
return _context5.stop();
|
|
}
|
|
}
|
|
}, _callee5);
|
|
}))();
|
|
},
|
|
onePlusNum: function onePlusNum(index, index1) {
|
|
var that = this;
|
|
if (this.carList.get(index).stockLogList.get(index1).productCount < 0) {
|
|
this.carList.get(index).stockLogList.get(index1).productCount = 0;
|
|
} else {
|
|
this.carList.get(index).stockLogList.get(index1).productCount++;
|
|
}
|
|
that.carList.get(index).productCount++;
|
|
that.carList.get(index).price1 = Number(that.carList.get(index).productCount) * that.carList.get(index).purchasePrice;
|
|
this.getAllPrice();
|
|
},
|
|
yuyinChange: function yuyinChange() {
|
|
this.isVoice = false;
|
|
},
|
|
numChange: function numChange(e, index) {
|
|
if (this.linshiPrice == e.target.value) {
|
|
this.temporaryList[index].productCount = Number(e.target.value);
|
|
} else {
|
|
if (e.detail.value == '') {
|
|
this.temporaryList[index].productCount = Number(this.linshiPrice);
|
|
} else if (e.detail.value == 0) {
|
|
this.temporaryList[index].productCount = 0;
|
|
} else {
|
|
this.temporaryList[index].productCount = Number(e.detail.value);
|
|
}
|
|
this.$forceUpdate();
|
|
}
|
|
this.temporaryChange();
|
|
},
|
|
mapnumChange: function mapnumChange(e, id, id1) {
|
|
var _this20 = this;
|
|
var that = this;
|
|
this.carList.get(id).productCount = 0;
|
|
this.carList.get(id).returnCount = 0;
|
|
if (this.linshiPrice == e.target.value) {
|
|
this.carList.get(id).stockLogList.get(id1).productCount = Number(e.target.value);
|
|
} else {
|
|
if (e.detail.value == '') {
|
|
this.carList.get(id).stockLogList.get(id1).productCount = Number(this.linshiPrice);
|
|
} else {
|
|
this.carList.get(id).stockLogList.get(id1).productCount = Number(e.detail.value);
|
|
}
|
|
}
|
|
this.carList.get(id).stockLogList.forEach(function (value, key) {
|
|
if (value.productCount < 0) {
|
|
that.carList.get(id).returnCount = Number(that.carList.get(id).returnCount) + Math.abs(value.productCount);
|
|
} else {
|
|
that.carList.get(id).productCount = Number(that.carList.get(id).productCount) + Number(value.productCount);
|
|
}
|
|
});
|
|
this.$nextTick(function () {
|
|
// if (that.discountType != 0) { //单品折扣
|
|
that.carList.get(id).price1 = Number(that.carList.get(id).productCount) * that.carList.get(id).purchasePrice;
|
|
// }
|
|
});
|
|
|
|
this.$nextTick(function () {
|
|
_this20.getAllPrice();
|
|
});
|
|
},
|
|
voiceGetOne: function voiceGetOne() {
|
|
this.voiceGetOneData = !this.voiceGetOneData;
|
|
},
|
|
obtainPrice: function obtainPrice(e, type, num, num1) {
|
|
this.linshiPrice = e.target.value;
|
|
if (type == 'danjia') {
|
|
this.carList.get(num).purchasePrice = '';
|
|
} else if (type == 'pifa') {
|
|
this.carList.get(num).wholesalePrice = '';
|
|
} else if (type == 'lingshou') {
|
|
this.carList.get(num).lsprice = '';
|
|
this.$forceUpdate();
|
|
} else if (type == 'danjishu') {
|
|
this.temporaryList[num].productCount = '';
|
|
this.$forceUpdate();
|
|
} else if (type == 'zongjishu') {
|
|
this.allChangeNum = '';
|
|
} else if (type == 'shouldPay') {
|
|
this.shouldPay = '';
|
|
} else if (type == 'mapdanjishu') {
|
|
this.carList.get(num).stockLogList.get(num1).productCount = '';
|
|
this.$forceUpdate();
|
|
} else if (type == 'alreadyPay') {
|
|
this.alreadyPay = '';
|
|
}
|
|
this.$forceUpdate();
|
|
},
|
|
plusNum: function plusNum() {
|
|
this.isPlusAndMinus == true;
|
|
//监听到点击+的操作,给所有的都+1
|
|
for (var i = 0; i < this.temporaryList.length; i++) {
|
|
if (this.evalue.length == 0) {
|
|
if (this.temporaryList[i].productCount == undefined) {
|
|
this.temporaryList[i].productCount = 1;
|
|
} else {
|
|
this.temporaryList[i].productCount++;
|
|
}
|
|
} else {
|
|
for (var j = 0; j < this.evalue.length; j++) {
|
|
if (this.evalue[j] == this.temporaryList[i].name) {
|
|
if (this.temporaryList[i].productCount == undefined) {
|
|
this.temporaryList[i].productCount = 1;
|
|
} else {
|
|
this.temporaryList[i].productCount++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
for (var m = 0; m < this.pageOldTemList.length; m++) {
|
|
if (this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList) {
|
|
this.pageOldTemList[m].productCount = Number(this.temporaryList[i].productCount);
|
|
}
|
|
}
|
|
for (var j = 0; j < this.oldTemList.length; j++) {
|
|
if (this.temporaryList[i].attributeList == this.oldTemList[j].attributeList) {
|
|
this.oldTemList[j].productCount = Number(this.temporaryList[i].productCount);
|
|
}
|
|
}
|
|
}
|
|
this.temporaryChange();
|
|
},
|
|
minusNum: function minusNum() {
|
|
this.isPlusAndMinus == true;
|
|
//监听到点击-的操作,给所有的都-1
|
|
for (var i = 0; i < this.temporaryList.length; i++) {
|
|
if (this.evalue.length == 0) {
|
|
this.temporaryList[i].productCount--;
|
|
} else {
|
|
for (var j = 0; j < this.evalue.length; j++) {
|
|
if (this.evalue[j] == this.temporaryList[i].name) {
|
|
this.temporaryList[i].productCount--;
|
|
}
|
|
}
|
|
}
|
|
for (var m = 0; m < this.pageOldTemList.length; m++) {
|
|
if (this.temporaryList[i].attributeList == this.pageOldTemList[m].attributeList) {
|
|
this.pageOldTemList[m].productCount = Number(this.temporaryList[i].productCount);
|
|
}
|
|
}
|
|
for (var j = 0; j < this.oldTemList.length; j++) {
|
|
if (this.temporaryList[i].attributeList == this.oldTemList[j].attributeList) {
|
|
this.oldTemList[j].productCount = Number(this.temporaryList[i].productCount);
|
|
}
|
|
}
|
|
}
|
|
this.temporaryChange();
|
|
},
|
|
goChooseGoods: function goChooseGoods() {
|
|
uni.navigateTo({
|
|
url: '/package1/AI/AiChangeGoods'
|
|
});
|
|
},
|
|
longPrec: function longPrec(index, value, index1) {
|
|
var that = this;
|
|
uni.showModal({
|
|
title: "提示",
|
|
content: "确定删除此默认规格吗?",
|
|
success: function success(res) {
|
|
uni.showLoading({
|
|
title: '加载中...'
|
|
});
|
|
if (res.confirm) {
|
|
that.delDefaultCate(index, value, index1);
|
|
}
|
|
setTimeout(function (res) {
|
|
uni.hideLoading();
|
|
}, 500);
|
|
}
|
|
});
|
|
},
|
|
attrNameChange: function attrNameChange(index, data1, index1) {
|
|
var that = this;
|
|
uni.showLoading({
|
|
title: '加载中...'
|
|
});
|
|
this.goodsDetail.attributeList[index].isChecked = !this.goodsDetail.attributeList[index].isChecked;
|
|
this.goodsDetail.attributeList[index].value[index1].isChecked = !this.goodsDetail.attributeList[index].value[index1].isChecked;
|
|
if (this.goodsList[index].specs.indexOf(data1) != -1) {
|
|
this.goodsList[index].specs.splice(this.goodsList[index].specs.indexOf(data1), 1);
|
|
} else {
|
|
this.goodsList[index].specs.push(data1);
|
|
}
|
|
var jishuqi = 0;
|
|
for (var i = 0; i < this.goodsList.length; i++) {
|
|
if (this.goodsList[i].specs.length > 0) {
|
|
jishuqi++;
|
|
}
|
|
}
|
|
var resultList = [];
|
|
if (jishuqi == this.goodsList.length) {
|
|
resultList = this.combination(this.goodsList);
|
|
}
|
|
this.evalue = [];
|
|
var value = [];
|
|
for (var m = 0; m < resultList.length; m++) {
|
|
var name = '';
|
|
var value1 = "{";
|
|
for (var j = 0; j < resultList[m].length; j++) {
|
|
if (j != resultList[m].length - 1) {
|
|
name += resultList[m][j] + '/';
|
|
value1 += '"' + this.dataObj.get(resultList[m][j]) + '":"' + resultList[m][j] + '",';
|
|
} else {
|
|
name += resultList[m][j];
|
|
value1 += '"' + this.dataObj.get(resultList[m][j]) + '":"' + resultList[m][j] + '"';
|
|
}
|
|
}
|
|
value1 += "}";
|
|
value.push(value1);
|
|
this.evalue.push(name);
|
|
}
|
|
if (jishuqi == 0) {
|
|
this.oldTemList = [];
|
|
this.temporaryList = this.pageOldTemList;
|
|
}
|
|
if (this.temporaryList.length == 0) {
|
|
if (jishuqi == this.goodsList.length) {
|
|
for (var i = 0; i < value.length; i++) {
|
|
this.attributeList = {
|
|
attributeList: value[i],
|
|
productCount: Number(this.temporaryNum),
|
|
productNum: this.productNum,
|
|
name: this.evalue[i],
|
|
price: this.purchasePrice
|
|
};
|
|
this.temporaryList.push(this.attributeList);
|
|
}
|
|
}
|
|
} else {
|
|
var newProductCount = 0;
|
|
for (var i = 0; i < value.length; i++) {
|
|
for (var m = 0; m < this.temporaryList.length; m++) {
|
|
if (this.temporaryList[m].attributeList == value[i]) {
|
|
newProductCount = Number(this.temporaryList[m].productCount);
|
|
}
|
|
}
|
|
this.attributeList = {
|
|
attributeList: value[i],
|
|
productCount: newProductCount || 0,
|
|
productNum: this.productNum,
|
|
name: this.evalue[i],
|
|
price: this.purchasePrice
|
|
};
|
|
this.newTemList.push(this.attributeList);
|
|
newProductCount = 0;
|
|
}
|
|
for (var i = 0; i < this.oldTemList.length; i++) {
|
|
var oldAttributeList = '';
|
|
var oldProductCount = '';
|
|
var notChcek = true;
|
|
for (var m = 0; m < this.newTemList.length; m++) {
|
|
if (this.oldTemList[i].attributeList == this.newTemList[m].attributeList) {
|
|
this.newTemList[m].productCount = Number(this.oldTemList[i].productCount);
|
|
notChcek = false;
|
|
}
|
|
}
|
|
if (this.newTemList.length > 0 && notChcek) {
|
|
this.newTemList.push(this.oldTemList[i]);
|
|
}
|
|
}
|
|
for (var i = 0; i < this.pageOldTemList.length; i++) {
|
|
var _oldAttributeList = '';
|
|
var _oldProductCount = '';
|
|
var _notChcek = true;
|
|
for (var m = 0; m < this.newTemList.length; m++) {
|
|
if (this.pageOldTemList[i].attributeList == this.newTemList[m].attributeList) {
|
|
this.newTemList[m].productCount = Number(this.pageOldTemList[i].productCount);
|
|
_notChcek = false;
|
|
}
|
|
}
|
|
if (this.newTemList.length > 0 && _notChcek) {
|
|
this.newTemList.push(this.pageOldTemList[i]);
|
|
}
|
|
}
|
|
}
|
|
this.$nextTick(function () {
|
|
for (var i = 0; i < that.temporaryList.length; i++) {
|
|
for (var m = 0; m < that.pecsList.length; m++) {
|
|
if (that.temporaryList[i].attributeList == that.pecsList[m].attributeList) {
|
|
that.temporaryList[i].productNum = that.pecsList[m].stockCount;
|
|
}
|
|
that.$forceUpdate();
|
|
}
|
|
}
|
|
});
|
|
if (jishuqi != this.goodsList.length) {
|
|
if (this.oldTemList.length == 0 && this.pageOldTemList.length == 0) {
|
|
this.newTemList = [];
|
|
this.temporaryList = [];
|
|
}
|
|
}
|
|
if (this.newTemList.length != 0 && jishuqi == this.goodsList.length) {
|
|
this.temporaryList = this.newTemList;
|
|
this.oldTemList = [];
|
|
this.newTemList = [];
|
|
}
|
|
setTimeout(function (res) {
|
|
uni.hideLoading();
|
|
}, 200);
|
|
},
|
|
clickGategroy: function clickGategroy(item) {
|
|
this.carList.get(this.productId).categoryName = item.categoryName;
|
|
this.carList.get(this.productId).categoryId = item.id;
|
|
this.$forceUpdate();
|
|
this.$refs.typePopup.close();
|
|
},
|
|
changeMore: function changeMore(e) {
|
|
if (e.show == false) {
|
|
this.moreData = [];
|
|
}
|
|
},
|
|
change: function change() {
|
|
this.allChangeNum = 0;
|
|
this.oldTemList = [];
|
|
},
|
|
lunbochange: function lunbochange(e) {
|
|
this.current = e.detail.current;
|
|
},
|
|
//弹出商品规格选择
|
|
toggle: function toggle(type, id) {
|
|
if (type == 'bottom') {
|
|
uni.showLoading({
|
|
title: '加载中...'
|
|
});
|
|
this.allChangeNum = 0;
|
|
this.getById(id);
|
|
} else if (type == 'typePopup') {
|
|
this.productId = id;
|
|
this.getGategoryList();
|
|
this.$refs.typePopup.open();
|
|
} else if (type == 'addGateDialog') {
|
|
this.$refs.addGateDialog.open("bottom");
|
|
} else if (type == "mergePopup") {
|
|
this.mergeId = id;
|
|
this.$refs.mergePopup.open();
|
|
} else if (type == 'center') {
|
|
this.initRecord();
|
|
this.voiceText = '';
|
|
this.voiceText1 = '';
|
|
this.$refs.popup.open(type);
|
|
} else if (type == 'voiceBottom') {
|
|
this.initRecord();
|
|
this.voiceText = '';
|
|
this.voiceText1 = '';
|
|
this.$refs.voiceBottomPopup.open('bottom');
|
|
} else if (type == 'oneGoods') {
|
|
this.oneGoodsId = id;
|
|
this.initRecord();
|
|
this.voiceText = '';
|
|
this.voiceText1 = '';
|
|
this.$refs.popup.open('center');
|
|
}
|
|
},
|
|
//按住语音识别,开始
|
|
kaishi: function kaishi() {
|
|
if (this.isVoice == false) {
|
|
this.recordState = true;
|
|
uni.vibrateShort();
|
|
manager.start({
|
|
duration: 60000,
|
|
lang: "zh_CN"
|
|
});
|
|
}
|
|
},
|
|
//松开语音识别,结束
|
|
jieshu: function jieshu() {
|
|
this.recordState = false;
|
|
manager.stop();
|
|
},
|
|
isCharPrecededByNumber: function isCharPrecededByNumber(str, char) {
|
|
var regex = new RegExp("\\d".concat(char), 'g');
|
|
return regex.test(str);
|
|
},
|
|
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);
|
|
});
|
|
},
|
|
//查询货号的后面第一个中文字符是不是“数量”,是返回true
|
|
isQuantityFollowsProductCode: function isQuantityFollowsProductCode(str) {
|
|
var afterProductCode = str.split('货号')[1];
|
|
if (!afterProductCode || afterProductCode.indexOf('数量') === -1) {
|
|
return false;
|
|
}
|
|
var beforeQuantity = afterProductCode.split('数量')[0];
|
|
var containsChineseCharacter = /[^\u4e00-\u9fa5]/.test(beforeQuantity);
|
|
return !containsChineseCharacter;
|
|
},
|
|
extractInfo: function extractInfo(str) {
|
|
var info = {};
|
|
var regexes = [{
|
|
name: 'productSn',
|
|
regex: /货号(.*?),/
|
|
}, {
|
|
name: 'productCount',
|
|
regex: /,数量:(.*?),/
|
|
}, {
|
|
name: 'productCount',
|
|
regex: /,数量:(.*?)。/
|
|
}, {
|
|
name: 'purchasePrice',
|
|
regex: /,单价:(.*?),/
|
|
}, {
|
|
name: 'purchasePrice',
|
|
regex: /,单价:(.*?)。/
|
|
}, {
|
|
name: 'productName',
|
|
regex: /,名称:(.*?),/
|
|
}, {
|
|
name: 'productName',
|
|
regex: /,名称:(.*?)。/
|
|
}, {
|
|
name: 'wholesalePrice',
|
|
regex: /,批发价:(.*?),/
|
|
}, {
|
|
name: 'wholesalePrice',
|
|
regex: /,批发价:(.*?)。/
|
|
}, {
|
|
name: 'lsprice',
|
|
regex: /,零售价:(.*?),/
|
|
}, {
|
|
name: 'lsprice',
|
|
regex: /,零售价:(.*?)。/
|
|
}];
|
|
regexes.forEach(function (_ref) {
|
|
var name = _ref.name,
|
|
regex = _ref.regex;
|
|
var match = str.match(regex);
|
|
if (match && match[1]) {
|
|
// 去除可能的前后空格
|
|
info[name] = match[1].trim();
|
|
}
|
|
});
|
|
if (info.productCount && info.productCount.indexOf(',') != -1) {
|
|
info.productCount = info.productCount.split(',')[0];
|
|
}
|
|
if (info.purchasePrice && info.purchasePrice.indexOf(',') != -1) {
|
|
info.purchasePrice = info.purchasePrice.split(',')[0];
|
|
}
|
|
if (info.productName && info.productName.indexOf(',') != -1) {
|
|
info.productName = info.productName.split(',')[0];
|
|
}
|
|
if (info.wholesalePrice && info.wholesalePrice.indexOf(',') != -1) {
|
|
info.wholesalePrice = info.wholesalePrice.split(',')[0];
|
|
}
|
|
if (info.lsprice && info.lsprice.indexOf(',') != -1) {
|
|
info.lsprice = info.lsprice.split(',')[0];
|
|
}
|
|
return info;
|
|
},
|
|
//语音识别功能初始化
|
|
initRecord: function initRecord() {
|
|
var _this21 = this;
|
|
var that = this;
|
|
manager.stop();
|
|
// 识别结束事件
|
|
manager.onStop = function (res) {
|
|
var convertedStr = _this21.spliceMsg(_this21.convertChineseToArabic(res.result));
|
|
convertedStr = _this21.removeSpacesAndCommas(convertedStr);
|
|
convertedStr = _this21.removePunctuationAndSpaces(convertedStr);
|
|
if (convertedStr.indexOf('点') != -1) {
|
|
convertedStr = that.replaceCharAfterNumber(convertedStr, '点', '.');
|
|
}
|
|
if (convertedStr.indexOf(',名称') != -1) {
|
|
convertedStr = convertedStr.replace(/,名称/g, '名称');
|
|
}
|
|
if (convertedStr.indexOf('名称,') != -1) {
|
|
convertedStr = convertedStr.replace(/名称,/g, '名称');
|
|
}
|
|
if (convertedStr.indexOf('名称') != -1) {
|
|
convertedStr = convertedStr.replace(/名称/g, ',名称:');
|
|
}
|
|
if (convertedStr.indexOf(',单价') != -1) {
|
|
convertedStr = convertedStr.replace(/,单价/g, '单价');
|
|
}
|
|
if (convertedStr.indexOf('单价,') != -1) {
|
|
convertedStr = convertedStr.replace(/单价,/g, '单价');
|
|
}
|
|
if (convertedStr.indexOf('单价') != -1) {
|
|
convertedStr = convertedStr.replace(/单价/g, ',单价:');
|
|
}
|
|
if (convertedStr.indexOf(',数量') != -1) {
|
|
convertedStr = convertedStr.replace(/,数量/g, '数量');
|
|
}
|
|
if (convertedStr.indexOf('数量,') != -1) {
|
|
convertedStr = convertedStr.replace(/数量,/g, '数量');
|
|
}
|
|
if (convertedStr.indexOf('数量') != -1) {
|
|
convertedStr = convertedStr.replace(/数量/g, ',数量:');
|
|
}
|
|
if (convertedStr.indexOf(',批发价') != -1) {
|
|
convertedStr = convertedStr.replace(/,批发价/g, '批发价');
|
|
}
|
|
if (convertedStr.indexOf('批发价,') != -1) {
|
|
convertedStr = convertedStr.replace(/批发价,/g, '批发价');
|
|
}
|
|
if (convertedStr.indexOf('批发价::') != -1) {
|
|
convertedStr = convertedStr.replace(/批发价::/g, '批发价');
|
|
}
|
|
if (convertedStr.indexOf('批发价:') != -1) {
|
|
convertedStr = convertedStr.replace(/批发价:/g, '批发价');
|
|
}
|
|
if (convertedStr.indexOf('批发价') != -1) {
|
|
convertedStr = convertedStr.replace(/批发价/g, ',批发价:');
|
|
}
|
|
if (convertedStr.startsWith("号")) {
|
|
convertedStr = "货号" + convertedStr.substr(1);
|
|
}
|
|
if (!convertedStr.startsWith("货号")) {
|
|
convertedStr = "货号" + convertedStr;
|
|
}
|
|
if (convertedStr.indexOf('货号,') != -1) {
|
|
convertedStr = convertedStr.replace(/货号,/g, '货号');
|
|
}
|
|
if (convertedStr.indexOf('货号::') != -1) {
|
|
convertedStr = convertedStr.replace(/货号::/g, '货号');
|
|
}
|
|
if (convertedStr.indexOf('货号:') != -1) {
|
|
convertedStr = convertedStr.replace(/货号:/g, '货号');
|
|
}
|
|
if (convertedStr.indexOf('货号') != -1) {
|
|
convertedStr = convertedStr.replace(/货号/g, '货号:');
|
|
}
|
|
convertedStr = convertedStr.replace(/[沟勾钩]/g, 'J');
|
|
convertedStr = _this21.convertStringCorrectly(convertedStr);
|
|
if (convertedStr.indexOf(',') == 0) {
|
|
convertedStr = convertedStr.substr(1);
|
|
}
|
|
if (that.voiceText == '' || that.voiceText == null) {
|
|
that.voiceText = convertedStr;
|
|
that.voiceText1 = convertedStr;
|
|
} else {
|
|
that.voiceText += '\n' + convertedStr;
|
|
that.voiceText1 = convertedStr + '\n' + that.voiceText1;
|
|
}
|
|
};
|
|
|
|
// 识别错误事件
|
|
manager.onError = function (res) {
|
|
if (res.retcode == '-30011') {
|
|
that.isVoice = true;
|
|
}
|
|
if (res.retcode == '-30004') {
|
|
// uni.hideLoading()
|
|
that.isVoice = false;
|
|
uni.hideToast();
|
|
uni.showToast({
|
|
title: "未识别到声音信息,请重新录入",
|
|
icon: 'none'
|
|
});
|
|
}
|
|
if (res.retcode == '-40001') {
|
|
uni.showToast({
|
|
title: '使用次数超限制,请联系管理员!',
|
|
icon: 'none'
|
|
});
|
|
}
|
|
};
|
|
},
|
|
getAttribute: function getAttribute(str) {
|
|
str = str.replace(/"色"(?![^{]*": *"色")/g, '"均色"');
|
|
str = str.replace(/"码"(?![^{]*": *"码")/g, '"均码"');
|
|
return str;
|
|
},
|
|
//清空语音输入的文字
|
|
clearText: function clearText() {
|
|
this.voiceText = '';
|
|
this.voiceText1 = '';
|
|
},
|
|
getText: function getText(e) {
|
|
this.voiceText = e.detail.value;
|
|
},
|
|
//正则匹配处理“2十9”等情况
|
|
convertStringCorrectly: function convertStringCorrectly(str) {
|
|
var regexForSingleTen = /(\d+)十(?!\d)/g;
|
|
var regexForFollowedByDigit = /(\d+)十(?=\d)/g;
|
|
var step1Result = str.replace(regexForSingleTen, '$10');
|
|
var finalResult = step1Result.replace(regexForFollowedByDigit, '$1');
|
|
return finalResult;
|
|
},
|
|
spliceMsg: function spliceMsg(res) {
|
|
var regex = /嗯|啊|儿|阿|恩/g;
|
|
return res.replace(regex, '');
|
|
},
|
|
convertChineseToArabic: function convertChineseToArabic(str) {
|
|
var chineseNumToArabic = {
|
|
// '零': 0,
|
|
'幺': 1,
|
|
'一': 1,
|
|
'二': 2,
|
|
'两': 2,
|
|
'三': 3,
|
|
'四': 4,
|
|
'五': 5,
|
|
'六': 6,
|
|
'七': 7,
|
|
'八': 8,
|
|
'九': 9,
|
|
'杠': '-',
|
|
'刚': '-',
|
|
'军色': '均色',
|
|
'叉': 'X',
|
|
'井': '#',
|
|
'时间': '10件',
|
|
'事件': '10件',
|
|
'世间': '10件',
|
|
'实践': '10件',
|
|
'实件': '10件',
|
|
'实价': '10件',
|
|
'议价': '1件',
|
|
'衣架': '1件',
|
|
'景': '#',
|
|
'警': '#',
|
|
'颈': '#',
|
|
'括号': '货号',
|
|
'名城': '名称',
|
|
'明城': '名称',
|
|
'名成': '名称',
|
|
'名程': '名称',
|
|
'上移': '上衣',
|
|
'时1': '11',
|
|
'时2': '12',
|
|
'时3': '13',
|
|
'时4': '14',
|
|
'时5': '15',
|
|
'时6': '16',
|
|
'时7': '17',
|
|
'时8': '18',
|
|
'时9': '19'
|
|
};
|
|
var regex = /(幺|一|二|两|三|四|五|六|七|八|九|杠|刚|军色|叉|井|时间|衣架|议价|实价|事件|世间|实践|实件|景|警|颈|括号|名城|名程|名成|明城|上移|时1|时2|时3|时4|时5|时6|时7|时8|时9)/g;
|
|
return str.replace(regex, function (match) {
|
|
return chineseNumToArabic[match];
|
|
});
|
|
},
|
|
//合并已有
|
|
clickMerge: function clickMerge(value, key) {
|
|
var that = this;
|
|
this.carList.get(this.mergeId).stockLogList.forEach(function (values, keys) {
|
|
if (that.carList.get(value).stockLogList.has(keys)) {
|
|
that.carList.get(value).stockLogList.get(keys).productCount += Number(that.carList.get(that.mergeId).stockLogList.get(keys).productCount);
|
|
} else {
|
|
that.carList.get(value).stockLogList.set(keys, that.carList.get(that.mergeId).stockLogList.get(keys));
|
|
}
|
|
that.carList.get(value).productCount += Number(that.carList.get(that.mergeId).stockLogList.get(keys).productCount);
|
|
that.carList.get(value).price1 = Number(that.carList.get(value).productCount) * that.carList.get(value).purchasePrice;
|
|
});
|
|
this.carList.delete(this.mergeId);
|
|
this.$forceUpdate();
|
|
this.getAllPrice();
|
|
this.$refs.mergePopup.close();
|
|
},
|
|
AiAddSpec: function AiAddSpec(value) {
|
|
this.getById(value, 1);
|
|
},
|
|
pictureAdd: function pictureAdd(id, huan) {
|
|
var that = this;
|
|
uni.showLoading({
|
|
title: '加载中...',
|
|
mask: true
|
|
});
|
|
if (id != '') {
|
|
//上传多图
|
|
this.childrenId = id;
|
|
if (this.carList.get(id).productPictures.length > 0 && huan != 'huan') {
|
|
this.productPictures = this.carList.get(id).productPictures;
|
|
this.$refs.showImgDiaLog.open();
|
|
uni.hideLoading();
|
|
return;
|
|
} else if (huan == 'huan') {
|
|
this.$refs.showImgDiaLog.close();
|
|
}
|
|
} else {
|
|
this.childrenId = '';
|
|
}
|
|
uni.chooseMedia({
|
|
count: 9,
|
|
mediaType: ['image'],
|
|
sourceType: ['album'],
|
|
success: function success(res) {
|
|
if (that.childrenId != '') {
|
|
that.carList.get(that.childrenId).productPictures = [];
|
|
}
|
|
for (var i = 0; i < res.tempFiles.length; i++) {
|
|
that.upLoadFile(res.tempFiles[i].tempFilePath, i + 1);
|
|
that.zhuImgList.push(res.tempFiles[i].tempFilePath);
|
|
}
|
|
},
|
|
fail: function fail(err) {
|
|
uni.hideLoading();
|
|
}
|
|
});
|
|
uni.hideLoading();
|
|
},
|
|
upLoadFile: function upLoadFile(path, time) {
|
|
var _this22 = this;
|
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
var that, hiver_token;
|
|
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
while (1) {
|
|
switch (_context6.prev = _context6.next) {
|
|
case 0:
|
|
that = _this22;
|
|
hiver_token = uni.getStorageSync("hiver_token");
|
|
_context6.next = 4;
|
|
return uni.compressImage({
|
|
src: path,
|
|
quality: 50,
|
|
success: function success(res1) {
|
|
uni.uploadFile({
|
|
url: that.tui.interfaceUrl() + '/upload/file',
|
|
filePath: res1.tempFilePath,
|
|
name: 'file',
|
|
header: {
|
|
"content-type": "multipart/form-data",
|
|
'accessToken': hiver_token
|
|
},
|
|
formData: {},
|
|
success: function success(uploadFileRes) {
|
|
var pathData = JSON.parse(uploadFileRes.data);
|
|
if (that.childrenId != '') {
|
|
var data = {
|
|
productPicture: pathData.result
|
|
};
|
|
that.carList.get(that.childrenId).productPictures.push(data);
|
|
that.$forceUpdate();
|
|
} else {
|
|
setTimeout(function () {
|
|
that.isSnList(pathData.result);
|
|
}, 100 * time);
|
|
|
|
// that.addPageGoods(pathData.result)
|
|
}
|
|
},
|
|
|
|
fail: function fail(err) {
|
|
uni.hideLoading();
|
|
uni.showToast({
|
|
title: JSON.stringify(err),
|
|
icon: 'none'
|
|
});
|
|
}
|
|
});
|
|
}
|
|
});
|
|
case 4:
|
|
_context6.next = 6;
|
|
return setTimeout(function (res) {
|
|
uni.hideLoading();
|
|
}, 1000);
|
|
case 6:
|
|
case "end":
|
|
return _context6.stop();
|
|
}
|
|
}
|
|
}, _callee6);
|
|
}))();
|
|
},
|
|
removeSpacesAndCommas: function removeSpacesAndCommas(str) {
|
|
// 正则表达式匹配所有空格和逗号
|
|
var regex = /[ ,,]/g; // 注意这里的空格和全角空格(全角逗号也包括在内)
|
|
|
|
// 使用replace()方法替换匹配到的空格和逗号为空字符串
|
|
return str.replace(regex, '');
|
|
},
|
|
//通过商品id查询商品详细信息
|
|
getById: function getById(id, current) {
|
|
var _this23 = this;
|
|
var that = this;
|
|
uni.showLoading({
|
|
title: '加载中...'
|
|
});
|
|
this.isBottom = false;
|
|
//判断isNew,新商品直接调店铺颜色库
|
|
if (current == 1) {
|
|
that.goodsDetail = id;
|
|
that.goodsDetail.attributeList = [];
|
|
if (this.goodsDetail.isNew) {
|
|
this.goodsList = [];
|
|
that.goodsDetail.attributeList = this.defaultList;
|
|
for (var i = 0; i < that.goodsDetail.attributeList.length; i++) {
|
|
for (var m = 0; m < that.goodsDetail.attributeList[i].value.length; m++) {
|
|
that.dataObj.set(that.goodsDetail.attributeList[i].value[m].value, that.goodsDetail.attributeList[i].name);
|
|
}
|
|
var specs1 = {
|
|
specs: []
|
|
};
|
|
that.goodsList.push(specs1);
|
|
}
|
|
this.$refs.shopPopup.open('bottom');
|
|
} else {
|
|
that.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
|
|
categoryId: that.goodsDetail.attrId
|
|
}, false, true).then(function (res1) {
|
|
if (res1.code == 200) {
|
|
that.goodsList = [];
|
|
if (typeof res1.result.attributeAndValue == 'string') {
|
|
var newObj = JSON.parse(res1.result.attributeAndValue);
|
|
var newArr = [];
|
|
var dataArr = [];
|
|
for (var val in newObj) {
|
|
var valueObj = [];
|
|
for (var i = 0; i < newObj[val].length; i++) {
|
|
valueObj.push({
|
|
value: newObj[val][i],
|
|
isChecked: false
|
|
});
|
|
that.dataObj.set(newObj[val][i], val);
|
|
}
|
|
newArr.push({
|
|
name: val,
|
|
value: valueObj
|
|
});
|
|
}
|
|
that.goodsDetail.attributeList = newArr;
|
|
for (var i = 0; i < that.goodsDetail.attributeList.length; i++) {
|
|
var _specs = {
|
|
specs: []
|
|
};
|
|
that.goodsList.push(_specs);
|
|
}
|
|
} else {
|
|
that.tui.toast('失败了');
|
|
}
|
|
that.getKCList(res1.result.stock);
|
|
} else {
|
|
that.tui.toast(res1.message);
|
|
}
|
|
}).catch(function (res) {});
|
|
}
|
|
this.pageOldTemList = [];
|
|
that.temporaryList = [];
|
|
if (that.carList.size > 0) {
|
|
var isArgin = false;
|
|
var idOrProductId = '';
|
|
if (id.isNew) {
|
|
idOrProductId = id.id;
|
|
} else {
|
|
idOrProductId = id.productId;
|
|
}
|
|
if (that.carList.get(idOrProductId).stockLogList.size == 1) {
|
|
if (that.carList.get(idOrProductId).stockLogList.get('{"颜色":"均色","尺码":"均码"}') != null && that.carList.get(idOrProductId).stockLogList.get('{"颜色":"均色","尺码":"均码"}') != undefined) {
|
|
that.carList.get(idOrProductId).stockLogList.get('{"颜色":"均色","尺码":"均码"}').productCount = 0;
|
|
}
|
|
}
|
|
that.carList.forEach(function (value, key) {
|
|
value.stockLogList1 = [];
|
|
if (isArgin == false) {
|
|
value.stockLogList.forEach(function (values, keys) {
|
|
if (value.stockLogList1.length == 0) {
|
|
var obj = {
|
|
productCount: Number(values.productCount),
|
|
name: values.name,
|
|
attributeList: keys,
|
|
productNum: values.productNum
|
|
};
|
|
value.stockLogList1.push(obj);
|
|
} else {
|
|
for (var i = 0; i < value.stockLogList1.length; i++) {
|
|
if (value.stockLogList1[i].attributeList != keys) {
|
|
if (value.stockLogList1.length == i + 1) {
|
|
var _obj3 = {
|
|
productCount: Number(values.productCount),
|
|
name: values.name,
|
|
attributeList: keys,
|
|
productNum: values.productNum
|
|
};
|
|
value.stockLogList1.push(_obj3);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
if (value.productId == id) {
|
|
that.zNum = Number(value.productCount);
|
|
that.temporaryList = value.stockLogList1;
|
|
that.pageOldTemList = value.stockLogList1;
|
|
that.oldTemList = value.stockLogList1;
|
|
isArgin = true;
|
|
} else {
|
|
if (value.isNew) {
|
|
if (value.id == id.id) {
|
|
that.zNum = Number(value.productCount);
|
|
that.temporaryList = value.stockLogList1;
|
|
that.pageOldTemList = value.stockLogList1;
|
|
that.oldTemList = value.stockLogList1;
|
|
isArgin = true;
|
|
}
|
|
} else {
|
|
if (value.productId == id.productId) {
|
|
that.zNum = Number(value.productCount);
|
|
that.temporaryList = value.stockLogList1;
|
|
that.pageOldTemList = value.stockLogList1;
|
|
that.oldTemList = value.stockLogList1;
|
|
isArgin = true;
|
|
}
|
|
}
|
|
}
|
|
value.stockLogList1 = [];
|
|
}
|
|
});
|
|
that.zNum = 0;
|
|
// that.$nextTick(() => {
|
|
// that.carList.forEach(function(value, key) {
|
|
|
|
// })
|
|
// })
|
|
}
|
|
} else {
|
|
this.tui.request("/app/product/getById/" + id, "POST", {}, false, true).then(function (res) {
|
|
if (res.code == 200) {
|
|
if (res.result.delFlag == 0) {
|
|
that.tui.toast("请将商品上架后再操作!");
|
|
return;
|
|
}
|
|
if (res.result.inStorageStatus == 0) {
|
|
that.tui.toast("请将商品入库后再操作!");
|
|
return;
|
|
}
|
|
that.goodsDetail = res.result;
|
|
that.goodsDetail.attributeList = _this23.defaultList;
|
|
that.tui.request("/app/productAttribute/selectAttributeAndValueByCategoryId", "POST", {
|
|
categoryId: that.goodsDetail.attrId || that.categoryList.attrId
|
|
}, false, true).then(function (res1) {
|
|
if (res1.code == 200) {
|
|
that.goodsList = [];
|
|
if (typeof res1.result.attributeAndValue == 'string') {
|
|
var newObj = JSON.parse(res1.result.attributeAndValue);
|
|
var newArr = [];
|
|
var dataArr = [];
|
|
for (var val in newObj) {
|
|
var valueObj = [];
|
|
for (var i = 0; i < newObj[val].length; i++) {
|
|
valueObj.push({
|
|
value: newObj[val][i],
|
|
isChecked: false
|
|
});
|
|
that.dataObj.set(newObj[val][i], val);
|
|
}
|
|
newArr.push({
|
|
name: val,
|
|
value: valueObj
|
|
});
|
|
}
|
|
that.goodsDetail.attributeList = newArr;
|
|
for (var i = 0; i < that.goodsDetail.attributeList.length; i++) {
|
|
// let oldCheck = false
|
|
// let oldValue = []
|
|
// for (var m = 0; m < that.goodsDetail.attributeList[i].value
|
|
// .length; m++) {
|
|
// if (that.goodsDetail.attributeList[i].value[m]
|
|
// .isChecked == true) {
|
|
// oldCheck = true
|
|
// oldValue.push(that.goodsDetail.attributeList[i]
|
|
// .value[m].value)
|
|
// }
|
|
// }
|
|
var _specs2 = {
|
|
specs: []
|
|
};
|
|
that.goodsList.push(_specs2);
|
|
// oldCheck = false
|
|
// oldValue = []
|
|
}
|
|
} else {
|
|
that.tui.toast('失败了');
|
|
}
|
|
_this23.pageOldTemList = [];
|
|
that.temporaryList = [];
|
|
if (that.carList.size > 0) {
|
|
var _isArgin = false;
|
|
that.carList.forEach(function (value, key) {
|
|
value.stockLogList1 = [];
|
|
if (_isArgin == false) {
|
|
value.stockLogList.forEach(function (values, keys) {
|
|
if (value.stockLogList1.length == 0) {
|
|
var obj = {
|
|
productCount: Number(values.productCount),
|
|
name: values.name,
|
|
attributeList: keys,
|
|
productNum: values.productNum
|
|
};
|
|
value.stockLogList1.push(obj);
|
|
} else {
|
|
for (var i = 0; i < value.stockLogList1.length; i++) {
|
|
if (value.stockLogList1[i].attributeList != keys) {
|
|
if (value.stockLogList1.length == i + 1) {
|
|
var _obj4 = {
|
|
productCount: Number(values.productCount),
|
|
name: values.name,
|
|
attributeList: keys,
|
|
productNum: values.productNum
|
|
};
|
|
value.stockLogList1.push(_obj4);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
if (value.productId == id) {
|
|
that.zNum = Number(value.productCount);
|
|
that.temporaryList = value.stockLogList1;
|
|
that.pageOldTemList = value.stockLogList1;
|
|
that.oldTemList = value.stockLogList1;
|
|
_isArgin = true;
|
|
} else {
|
|
if (value.isNew) {
|
|
if (value.id == id.id) {
|
|
that.zNum = Number(value.productCount);
|
|
that.temporaryList = value.stockLogList1;
|
|
that.pageOldTemList = value.stockLogList1;
|
|
that.oldTemList = value.stockLogList1;
|
|
_isArgin = true;
|
|
}
|
|
} else {
|
|
if (value.productId == id.productId) {
|
|
that.zNum = Number(value.productCount);
|
|
that.temporaryList = value.stockLogList1;
|
|
that.pageOldTemList = value.stockLogList1;
|
|
that.oldTemList = value.stockLogList1;
|
|
_isArgin = true;
|
|
}
|
|
}
|
|
}
|
|
value.stockLogList1 = [];
|
|
}
|
|
});
|
|
that.zNum = 0;
|
|
if (that.carList.get(id)) {
|
|
if (that.carList.get(id).stockLogList1.length == 1) {
|
|
if (that.carList.get(id).stockLogList1[0].attributeList == '{"颜色":"均色","尺码":"均码"}') {
|
|
that.carList.get(id).stockLogList1[0].productCount = 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
// that.$nextTick(() => {
|
|
// that.carList.forEach(function(value, key) {
|
|
|
|
// })
|
|
// })
|
|
}
|
|
|
|
_this23.getKCList(res1.result.stock);
|
|
} else {
|
|
that.tui.toast(res1.message);
|
|
}
|
|
}).catch(function (res) {});
|
|
} else {
|
|
_this23.tui.toast(res.message);
|
|
}
|
|
}).catch(function (res) {});
|
|
}
|
|
uni.hideLoading();
|
|
},
|
|
changeSn: function changeSn() {},
|
|
//新增商品的时候,判断有没有货号生成规则,没有则弹出货号新增弹出层
|
|
isSnList: function isSnList(img) {
|
|
var _this24 = this;
|
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
while (1) {
|
|
switch (_context7.prev = _context7.next) {
|
|
case 0:
|
|
if (!(_this24.isGenerateSnRadio == 1)) {
|
|
_context7.next = 5;
|
|
break;
|
|
}
|
|
_context7.next = 3;
|
|
return _this24.addPageGoods(img, '');
|
|
case 3:
|
|
_context7.next = 13;
|
|
break;
|
|
case 5:
|
|
if (!(_this24.snList.length > 0)) {
|
|
_context7.next = 10;
|
|
break;
|
|
}
|
|
_context7.next = 8;
|
|
return _this24.getNewSn(img);
|
|
case 8:
|
|
_context7.next = 13;
|
|
break;
|
|
case 10:
|
|
_this24.zhuImg = img;
|
|
_this24.$refs.SNDialog.open('center');
|
|
uni.hideLoading();
|
|
case 13:
|
|
case "end":
|
|
return _context7.stop();
|
|
}
|
|
}
|
|
}, _callee7);
|
|
}))();
|
|
},
|
|
//获取新货号
|
|
getNewSn: function getNewSn(img) {
|
|
var _this25 = this;
|
|
this.tui.request("/app/productSn/getNewProductSn", "POST", {
|
|
snPre: this.snName
|
|
}, false, true).then(function (res1) {
|
|
if (res1.code == 200) {
|
|
_this25.tui.request('/app/product/getByProductSn', "post", {
|
|
productSn: res1.result
|
|
}, false, true).then(function (res) {
|
|
if (res.code == 200) {
|
|
if (res.result != '') {
|
|
_this25.generateSn(value);
|
|
} else {
|
|
_this25.addPageGoods(img, res1.result);
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
uni.hideLoading();
|
|
_this25.tui.toast(res.message);
|
|
}
|
|
}).catch(function (res) {
|
|
uni.hideLoading();
|
|
});
|
|
},
|
|
//getNewProductSnMore count/snPre
|
|
addPageGoods: function addPageGoods(path, sn) {
|
|
var obj = {
|
|
id: sn ? sn : (0, _global.generateUUID)(),
|
|
purchasePrice: 0,
|
|
//进货价
|
|
price: 0,
|
|
price1: 0,
|
|
categoryName: this.categoryList.categoryName,
|
|
categoryId: this.categoryList.categoryId,
|
|
productCount: 0,
|
|
productId: "",
|
|
productName: "",
|
|
wholesalePrice: 0,
|
|
customerCategoryList: this.getNewProductRule(),
|
|
lsprice: 0,
|
|
isNew: true,
|
|
productPictures: [],
|
|
productPicture: path ? path : '',
|
|
productSn: sn ? sn : "",
|
|
stockLogList: new Map(),
|
|
stockLogList1: []
|
|
};
|
|
var key = '{"颜色":"均色","尺码":"均码"}';
|
|
var value = {
|
|
name: '均色/均码',
|
|
productCount: 0
|
|
};
|
|
obj.stockLogList.set(key, value);
|
|
this.carList.set(obj.id, obj);
|
|
this.$forceUpdate();
|
|
uni.hideLoading();
|
|
},
|
|
getNewProductRule: function getNewProductRule() {
|
|
var arr = [];
|
|
if (this.customerCategoryList1 != null && this.customerCategoryList1 != '') {
|
|
for (var i = 0; i < this.customerCategoryList1.length; i++) {
|
|
var data = {
|
|
categoryId: this.customerCategoryList1[i].categoryId,
|
|
categoryName: this.customerCategoryList1[i].categoryName,
|
|
categoryPrice: this.customerCategoryList1[i].categoryPrice
|
|
};
|
|
arr.push(data);
|
|
}
|
|
} else {
|
|
arr = null;
|
|
}
|
|
return arr;
|
|
},
|
|
//库存商品详情
|
|
getKCList: function getKCList(list) {
|
|
var that = this;
|
|
this.pecsList = list;
|
|
this.$refs.shopPopup.open('bottom');
|
|
},
|
|
temporaryChange: function temporaryChange(val, item) {
|
|
if (item != '' && item != undefined) {
|
|
for (var m = 0; m < this.pageOldTemList.length; m++) {
|
|
if (item.attributeList == this.pageOldTemList[m].attributeList) {
|
|
this.pageOldTemList[m].productCount = Number(item.productCount);
|
|
break;
|
|
}
|
|
}
|
|
for (var j = 0; j < this.oldTemList.length; j++) {
|
|
if (item.attributeList == this.oldTemList[j].attributeList) {
|
|
this.oldTemList[j].productCount = Number(item.productCount);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
this.zNum = 0;
|
|
for (var i = 0; i < this.temporaryList.length; i++) {
|
|
this.zNum += Number(this.temporaryList[i].productCount) || 0;
|
|
}
|
|
},
|
|
clickClose: function clickClose(e) {
|
|
this.evalue = [];
|
|
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
|
|
this.goodsDetail.attributeList[i].isChecked = false;
|
|
for (var m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) {
|
|
this.goodsDetail.attributeList[i].value[m].isChecked = false;
|
|
}
|
|
}
|
|
this.allChangeNum = 0;
|
|
},
|
|
//弹窗选择规格后,点击弹窗中选好了按钮
|
|
temporaryCheck: function temporaryCheck() {
|
|
uni.showLoading({
|
|
title: '加载中...'
|
|
});
|
|
this.evalue = [];
|
|
var that = this,
|
|
carList1 = [];
|
|
var data = {
|
|
id: this.goodsDetail.productId ? this.goodsDetail.productId : this.goodsDetail.id,
|
|
price: 0,
|
|
num: this.zNum,
|
|
customerCategoryRule: this.goodsDetail.customerCategoryRule != null ? this.checkPriceRule(JSON.parse(this.goodsDetail.customerCategoryRule)) : null,
|
|
productId: this.goodsDetail.productId,
|
|
productName: this.goodsDetail.productName,
|
|
wholesalePrice: this.goodsDetail.wholesalePrice,
|
|
purchasePrice: this.goodsDetail.purchasePrice,
|
|
categoryName: this.goodsDetail.categoryName,
|
|
categoryId: this.goodsDetail.categoryId,
|
|
attrId: this.goodsDetail.attrId,
|
|
lsprice: this.goodsDetail.price,
|
|
productSn: this.goodsDetail.productSn,
|
|
productPicture: this.goodsDetail.productPicture,
|
|
supplierName: this.goodsDetail.supplierName,
|
|
productPictures: [],
|
|
saleDetailQueryDTO: this.temporaryList
|
|
};
|
|
carList1.push(data);
|
|
this.temporaryList = [];
|
|
this.oldTemList = [];
|
|
this.purchasePrice = '';
|
|
this.zPrice = '';
|
|
this.zNum = '';
|
|
for (var i = 0; i < this.goodsDetail.attributeList.length; i++) {
|
|
this.goodsDetail.attributeList[i].isChecked = false;
|
|
for (var m = 0; m < this.goodsDetail.attributeList[i].value.length; m++) {
|
|
this.goodsDetail.attributeList[i].value[m].isChecked = false;
|
|
}
|
|
}
|
|
if (this.carList.size == 0) {
|
|
//当前页没有数据
|
|
for (var _i24 = 0; _i24 < carList1.length; _i24++) {
|
|
var obj = {
|
|
purchasePrice: this.userType == 0 ? this.goodsDetail.purchasePrice : '',
|
|
//进货价
|
|
price: this.goodsDetail.price,
|
|
price1: 0,
|
|
productCount: 0,
|
|
id: carList1[_i24].id,
|
|
productId: carList1[_i24].id,
|
|
customerCategoryList: carList1[_i24].customerCategoryRule != null ? this.checkPriceRule(carList1[_i24].customerCategoryRule) : this.getNewProductRule(),
|
|
wholesalePrice: this.goodsDetail.wholesalePrice,
|
|
categoryName: this.goodsDetail.categoryName,
|
|
categoryId: carList1[_i24].categoryId,
|
|
attrId: carList1[_i24].attrId,
|
|
lsprice: this.goodsDetail.price,
|
|
productName: carList1[_i24].productName,
|
|
productPicture: carList1[_i24].productPicture,
|
|
productSn: carList1[_i24].productSn,
|
|
stockLogList: new Map(),
|
|
productPictures: [],
|
|
stockLogList1: []
|
|
};
|
|
for (var _m8 = 0; _m8 < carList1[_i24].saleDetailQueryDTO.length; _m8++) {
|
|
var data1 = {
|
|
productCount: Number(carList1[_i24].saleDetailQueryDTO[_m8].productCount),
|
|
name: carList1[_i24].saleDetailQueryDTO[_m8].name,
|
|
productNum: carList1[_i24].saleDetailQueryDTO[_m8].productNum
|
|
};
|
|
if (carList1[_i24].saleDetailQueryDTO.length > 1) {
|
|
if (data1.productCount > 0) {
|
|
obj.stockLogList.set(carList1[_i24].saleDetailQueryDTO[_m8].attributeList, data1);
|
|
}
|
|
} else {
|
|
obj.stockLogList.set(carList1[_i24].saleDetailQueryDTO[_m8].attributeList, data1);
|
|
}
|
|
obj.productCount += Number(carList1[_i24].saleDetailQueryDTO[_m8].productCount);
|
|
obj.price1 = Number(obj.productCount) * this.goodsDetail.purchasePrice;
|
|
}
|
|
this.carList.set(carList1[_i24].id, obj);
|
|
}
|
|
carList1 = [];
|
|
} else {
|
|
//当前页有数据
|
|
|
|
for (var _i25 = 0; _i25 < carList1.length; _i25++) {
|
|
if (this.carList.has(carList1[_i25].id) == true) {
|
|
this.carList.get(carList1[_i25].id).stockLogList = new Map();
|
|
}
|
|
if (this.carList.has(carList1[_i25].id) == true) {
|
|
//商品相同
|
|
if (this.carList.get(carList1[_i25].id)) {
|
|
this.carList.get(carList1[_i25].id).productCount = 0;
|
|
}
|
|
for (var _m9 = 0; _m9 < carList1[_i25].saleDetailQueryDTO.length; _m9++) {
|
|
if (this.carList.get(carList1[_i25].id).stockLogList.has(carList1[_i25].saleDetailQueryDTO[_m9].attributeList) == true) {
|
|
//规格相同
|
|
|
|
var data1 = {
|
|
productCount: Number(carList1[_i25].saleDetailQueryDTO[_m9].productCount),
|
|
name: carList1[_i25].saleDetailQueryDTO[_m9].name,
|
|
productNum: carList1[_i25].saleDetailQueryDTO[_m9].productNum
|
|
};
|
|
if (carList1[_i25].saleDetailQueryDTO.length > 1) {
|
|
if (data1.productCount > 0) {
|
|
this.carList.get(carList1[_i25].id).stockLogList.set(carList1[_i25].saleDetailQueryDTO[_m9].attributeList, data1);
|
|
}
|
|
} else {
|
|
this.carList.get(carList1[_i25].id).stockLogList.set(carList1[_i25].saleDetailQueryDTO[_m9].attributeList, data1);
|
|
}
|
|
} else {
|
|
//规格不同
|
|
var data1 = {
|
|
productCount: Number(carList1[_i25].saleDetailQueryDTO[_m9].productCount),
|
|
name: carList1[_i25].saleDetailQueryDTO[_m9].name,
|
|
productNum: carList1[_i25].saleDetailQueryDTO[_m9].productNum
|
|
};
|
|
if (carList1[_i25].saleDetailQueryDTO.length > 1) {
|
|
if (data1.productCount > 0) {
|
|
this.carList.get(carList1[_i25].id).stockLogList.set(carList1[_i25].saleDetailQueryDTO[_m9].attributeList, data1);
|
|
}
|
|
} else {
|
|
this.carList.get(carList1[_i25].id).stockLogList.set(carList1[_i25].saleDetailQueryDTO[_m9].attributeList, data1);
|
|
}
|
|
}
|
|
this.carList.get(carList1[_i25].id).productCount += Number(carList1[_i25].saleDetailQueryDTO[_m9].productCount);
|
|
that.carList.get(carList1[_i25].id).price1 = Number(that.carList.get(carList1[_i25].id).productCount) * that.carList.get(carList1[_i25].id).purchasePrice;
|
|
}
|
|
} else {
|
|
//商品不同
|
|
var _obj5 = {
|
|
purchasePrice: this.userType == 0 ? this.goodsDetail.purchasePrice : '',
|
|
//进货价
|
|
price: this.goodsDetail.price,
|
|
price1: 0,
|
|
productCount: 0,
|
|
productId: carList1[_i25].id,
|
|
categoryId: carList1[_i25].categoryId,
|
|
attrId: carList1[_i25].attrId,
|
|
customerCategoryList: carList1[_i25].customerCategoryRule != null ? this.checkPriceRule(carList1[_i25].customerCategoryRule) : this.getNewProductRule(),
|
|
productName: carList1[_i25].productName,
|
|
wholesalePrice: this.goodsDetail.wholesalePrice,
|
|
lsprice: this.goodsDetail.price,
|
|
productPicture: carList1[_i25].productPicture,
|
|
stockLogList: new Map(),
|
|
productSn: carList1[_i25].productSn,
|
|
stockLogList1: [],
|
|
productPictures: [],
|
|
name: ''
|
|
};
|
|
for (var _m10 = 0; _m10 < carList1[_i25].saleDetailQueryDTO.length; _m10++) {
|
|
var data1 = {
|
|
productCount: Number(carList1[_i25].saleDetailQueryDTO[_m10].productCount),
|
|
name: carList1[_i25].saleDetailQueryDTO[_m10].name,
|
|
productNum: carList1[_i25].saleDetailQueryDTO[_m10].productNum
|
|
};
|
|
if (carList1[_i25].saleDetailQueryDTO.length > 1) {
|
|
if (data1.productCount > 0) {
|
|
_obj5.stockLogList.set(carList1[_i25].saleDetailQueryDTO[_m10].attributeList, data1);
|
|
}
|
|
} else {
|
|
_obj5.stockLogList.set(carList1[_i25].saleDetailQueryDTO[_m10].attributeList, data1);
|
|
}
|
|
_obj5.productCount += Number(carList1[_i25].saleDetailQueryDTO[_m10].productCount);
|
|
_obj5.price1 = _obj5.productCount * this.goodsDetail.purchasePrice;
|
|
}
|
|
this.carList.set(carList1[_i25].id, _obj5);
|
|
}
|
|
}
|
|
carList1 = [];
|
|
}
|
|
this.getAllPrice();
|
|
this.$refs.shopPopup.close();
|
|
this.allChangeNum = 0;
|
|
setTimeout(function (res) {
|
|
uni.hideLoading();
|
|
}, 500);
|
|
},
|
|
changessPrice: function changessPrice(e) {
|
|
if (this.linshiPrice == e.target.value) {
|
|
this.shouldPay = e.target.value;
|
|
} else {
|
|
if (e.target.value == '') {
|
|
this.shouldPay = this.linshiPrice;
|
|
} else {
|
|
this.shouldPay = e.target.value;
|
|
}
|
|
}
|
|
this.alreadyPay = this.shouldPay;
|
|
this.noPay = this.shouldPay - this.alreadyPay;
|
|
},
|
|
//滨海商贸要求已收金额不计算
|
|
checkRealPay: function checkRealPay(realPay) {
|
|
var shopId = uni.getStorageSync('shopId');
|
|
if (shopId == '1838094297858183168' || shopId == '1818888277105709056' || shopId == '1810179818189361152') {
|
|
if (this.isChangePriceOk == false) {
|
|
return 0;
|
|
} else {
|
|
return this.alreadyPay;
|
|
}
|
|
} else {
|
|
if (this.isChangePriceOk == false) {
|
|
return realPay;
|
|
} else {
|
|
return this.alreadyPay;
|
|
}
|
|
}
|
|
},
|
|
sninput: function sninput(e, id) {
|
|
this.carList.get(id).productSn = e.detail.value;
|
|
this.$forceUpdate();
|
|
},
|
|
removePunctuationAndSpaces: function removePunctuationAndSpaces(str) {
|
|
var regex = /[\u3002\uff0c\uff1a\uFF0E\u3001\s,:;]/g;
|
|
return str.replace(regex, '');
|
|
},
|
|
//货号是否重复
|
|
getSnIsRepeat: function getSnIsRepeat(e, id) {
|
|
var _this26 = this;
|
|
var that = this;
|
|
var isTrue = false;
|
|
if (e.detail.value != '') {
|
|
this.tui.request('/app/product/getByProductSn', "post", {
|
|
productSn: e.detail.value
|
|
}, false, true).then(function (res1) {
|
|
if (res1.code == 200) {
|
|
if (res1.result != '') {
|
|
isTrue = true;
|
|
that.tui.toast('当前货号已被商品:“' + res1.result[0].productName + '”占用,请重新输入');
|
|
that.carList.get(id).productSn = '';
|
|
that.carList.get(id).id = '';
|
|
setTimeout(function (res) {
|
|
that.$forceUpdate();
|
|
}, 2000);
|
|
throw Error('11');
|
|
} else {
|
|
_this26.carList.forEach(function (value, key) {
|
|
if (value.id != id) {
|
|
if (value.productSn == e.detail.value) {
|
|
isTrue = true;
|
|
uni.showToast({
|
|
title: "该货号被页面其他商品占用,请重新输入!",
|
|
icon: 'none'
|
|
});
|
|
that.carList.get(id).productSn = '';
|
|
that.carList.get(id).id = '';
|
|
that.$forceUpdate();
|
|
throw Error('11');
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
this.$nextTick(function () {
|
|
if (isTrue == false) {
|
|
if (that.carList.get(id).productId) {
|
|
_this26.carList.get(id).id = that.carList.get(id).productId;
|
|
_this26.carList.get(id).isNew = false;
|
|
id = that.carList.get(id).productId;
|
|
} else if (that.carList.get(id).productSn == '' || that.carList.get(id).productSn == null) {
|
|
_this26.carList.get(id).id = that.carList.get(id).productName;
|
|
id = that.carList.get(id).productName;
|
|
} else if (that.carList.get(id).productSn == '货号') {
|
|
_this26.carList.get(id).productSn = that.carList.get(id).productName;
|
|
_this26.carList.get(id).id = that.carList.get(id).productName;
|
|
id = that.carList.get(id).productName;
|
|
} else if (that.carList.get(id).productSn) {
|
|
_this26.carList.get(id).id = that.carList.get(id).productSn;
|
|
id = that.carList.get(id).productSn;
|
|
}
|
|
_this26.$forceUpdate();
|
|
}
|
|
});
|
|
var specMap = new Map(); //新的临时存放值那个更改过的值的map
|
|
this.$nextTick(function () {
|
|
// if(isTrue == false){
|
|
_this26.carList.forEach(function (value, key) {
|
|
if (key != value.id) {
|
|
if (value.id == '') {
|
|
specMap.set((0, _global.generateUUID)(), value);
|
|
} else {
|
|
specMap.set(value.id, value);
|
|
}
|
|
} else {
|
|
specMap.set(key, value);
|
|
}
|
|
});
|
|
_this26.carList = specMap;
|
|
// }
|
|
});
|
|
}
|
|
},
|
|
getName: function getName(e, id) {
|
|
this.carList.get(id).productName = e.detail.value;
|
|
},
|
|
noReturn: function noReturn() {
|
|
this.yuedikou = 0;
|
|
this.alreadyPay = this.shouldPay;
|
|
this.noPay = this.shouldPay - (this.alreadyPay == '' ? 0 : this.alreadyPay);
|
|
this.noPay = this.noPay.toFixed(2);
|
|
this.leijiqiankuan = (Number(this.zhiqianqiankuan) + Number(this.yuedikou) + Number(this.noPay)).toFixed(2);
|
|
},
|
|
//计算欠款
|
|
changePay: function changePay(e) {
|
|
var _this27 = this;
|
|
this.isChangePriceOk = true;
|
|
if (this.linshiPrice == e.target.value) {
|
|
this.alreadyPay = e.target.value;
|
|
} else if (Number(e.detail.value) > Number(this.shouldPay)) {
|
|
this.alreadyPay = this.shouldPay;
|
|
setTimeout(function (res) {
|
|
_this27.tui.toast("已付金额不能大于应付金额");
|
|
}, 100);
|
|
} else {
|
|
if (e.target.value == '') {
|
|
this.alreadyPay = this.linshiPrice;
|
|
} else {
|
|
this.alreadyPay = e.target.value;
|
|
if (this.shouldPay - this.alreadyPay <= Math.abs(this.zhiqianqiankuan) && this.zhiqianqiankuan < 0) {
|
|
this.yuedikou = this.shouldPay - this.alreadyPay;
|
|
} else if (this.shouldPay - this.alreadyPay > Math.abs(this.zhiqianqiankuan) && this.zhiqianqiankuan < 0) {
|
|
this.yuedikou = Math.abs(this.zhiqianqiankuan);
|
|
}
|
|
}
|
|
}
|
|
this.noPay = this.shouldPay - this.alreadyPay - this.yuedikou;
|
|
this.noPay = this.noPay.toFixed(2);
|
|
this.leijiqiankuan = (Number(this.zhiqianqiankuan) + Number(this.yuedikou) + Number(this.noPay)).toFixed(2);
|
|
},
|
|
//跳转选择供应商
|
|
goPopleList: function goPopleList(popleType) {
|
|
uni.setStorageSync('kaidanBack', true);
|
|
uni.navigateTo({
|
|
url: '/package1/index/peopleList?popleType=' + popleType
|
|
});
|
|
},
|
|
//删除整条商品
|
|
delShop: function delShop(id) {
|
|
var that = this;
|
|
uni.showModal({
|
|
title: "提示",
|
|
content: "确定删除此条商品吗?",
|
|
success: function success(res) {
|
|
if (res.confirm) {
|
|
if (that.carList.has(id) == true) {
|
|
that.carList.delete(id);
|
|
}
|
|
that.getAllPrice();
|
|
that.$forceUpdate();
|
|
}
|
|
}
|
|
});
|
|
},
|
|
//选商品的时候能删除规格
|
|
delCarData: function delCarData(index) {
|
|
this.temporaryList.splice(index, 1);
|
|
this.temporaryChange();
|
|
},
|
|
//删除商品下的某一个规格
|
|
delShopSpec: function delShopSpec(id, name) {
|
|
var that = this;
|
|
uni.showModal({
|
|
title: "提示",
|
|
content: "确定删除此条规格吗?",
|
|
success: function success(res) {
|
|
if (res.confirm) {
|
|
if (that.carList.get(id).stockLogList.size == 1) {
|
|
that.carList.get(id).productCount = Number(that.carList.get(id).stockLogList.get(name).productCount);
|
|
} else {
|
|
that.carList.get(id).productCount -= Number(that.carList.get(id).stockLogList.get(name).productCount);
|
|
}
|
|
var count = Number(that.carList.get(id).stockLogList.get(name).productCount);
|
|
that.carList.get(id).stockLogList.delete(name);
|
|
that.carList.get(id).price1 = Number(that.carList.get(id).productCount) * that.carList.get(id).purchasePrice;
|
|
if (that.carList.get(id).stockLogList.size == 0) {
|
|
var key = '{"颜色":"均色","尺码":"均码"}';
|
|
var _value = {
|
|
name: '均色/均码/',
|
|
productCount: count
|
|
};
|
|
that.carList.get(id).stockLogList.set(key, _value);
|
|
}
|
|
that.getAllPrice();
|
|
}
|
|
that.$forceUpdate();
|
|
}
|
|
});
|
|
},
|
|
gysList: function gysList() {
|
|
var _this28 = this;
|
|
var that = this;
|
|
this.tui.request("/app/supplier/getByCondition", "post", {
|
|
searchStr: '默认供应商',
|
|
pageNumber: 1,
|
|
pageSize: 10
|
|
}, false, true).then(function (res) {
|
|
if (res.code == 200) {
|
|
if (res.result.content.length == 0) {
|
|
that.tui.request("/app/supplier/save", "post", {
|
|
consigneeMobile: '',
|
|
consigneeName: '默认供应商',
|
|
address1: '',
|
|
address: '',
|
|
province: '',
|
|
city: '',
|
|
area: ''
|
|
}, false, true).then(function (res) {
|
|
if (res.code == 200) {
|
|
that.gysList();
|
|
}
|
|
});
|
|
} else {
|
|
that.khName = res.result.content[0];
|
|
that.goRuku();
|
|
}
|
|
} else {
|
|
_this28.tui.toast(res.message);
|
|
}
|
|
});
|
|
},
|
|
filterEmojis: function filterEmojis(text) {
|
|
// 匹配表情符号的正则表达式(包括Unicode范围内的表情)
|
|
var emojiRegex = /[\uD800-\uDBFF][\uDC00-\uDFFF]|[\u2600-\u27FF]|[\uD83C][\uDF00-\uDFFF]|[\uD83D][\uDC00-\uDE4F]/g;
|
|
|
|
// 检查是否包含表情符号
|
|
var hasEmoji = emojiRegex.test(text);
|
|
return hasEmoji;
|
|
},
|
|
goRuku: function goRuku() {
|
|
var _this29 = this;
|
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
var that, purchase, purchaseDetails, arr;
|
|
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
while (1) {
|
|
switch (_context8.prev = _context8.next) {
|
|
case 0:
|
|
that = _this29;
|
|
purchase = {
|
|
id: uni.getStorageSync('AiInventoryId') ? uni.getStorageSync('AiInventoryId') : "",
|
|
alreadyPay: _this29.alreadyPay == '' ? 0 : _this29.alreadyPay,
|
|
//已付金额
|
|
noPay: _this29.noPay == '' ? 0 : _this29.noPay,
|
|
//欠款
|
|
shouldPay: _this29.shouldPay,
|
|
//应付金额
|
|
totalAmount: _this29.totalAmount,
|
|
//总数量
|
|
remark: _this29.remark,
|
|
purchaseTime: _this29.single,
|
|
otherPay: _this29.otherPay == '' ? 0 : _this29.otherPay,
|
|
supplierId: _this29.khName.id,
|
|
//供应商id和姓名
|
|
supplierName: _this29.khName.consigneeName
|
|
};
|
|
purchaseDetails = [];
|
|
arr = [];
|
|
_context8.next = 6;
|
|
return _this29.carList.forEach(function (value, key) {
|
|
arr += 1;
|
|
value.customerCategoryRule = JSON.stringify(value.customerCategoryList);
|
|
var shopId = uni.getStorageSync('shopId');
|
|
// 提钱和沐港,员工入库采购价为零
|
|
if (that.userType == 1 && (shopId == '1853332569559535619' || shopId == '1810179818189361152')) {
|
|
value.purchasePrice = 0;
|
|
} else if (that.userType == 1) {
|
|
value.purchasePrice = '';
|
|
}
|
|
if (that.filterEmojis(value.productName)) {
|
|
uni.showToast({
|
|
title: "第" + arr.length + "款商品品名中的有非法符号,请删除",
|
|
icon: 'none'
|
|
});
|
|
throw Error("11");
|
|
}
|
|
if (value.productSn == '') {
|
|
uni.showToast({
|
|
title: "第" + arr.length + "款商品货号必须维护",
|
|
icon: 'none'
|
|
});
|
|
throw Error("11");
|
|
} else {
|
|
value.price = value.lsprice;
|
|
value.stockLogList1 = [];
|
|
if (value.stockLogList.size == 0) {
|
|
var obj = {
|
|
productCount: 1,
|
|
attributeList: '{"颜色":"均色","尺码":"均码"}'
|
|
};
|
|
value.productCount = 1;
|
|
value.price1 = Number(value.productCount) * value.purchasePrice;
|
|
value.stockLogList1.push(obj);
|
|
} else {
|
|
value.stockLogList.forEach(function (values, keys) {
|
|
if (values.productCount <= 0) {
|
|
that.tui.toast(value.productSn + "的入库数量不能为零~");
|
|
throw Error('error');
|
|
}
|
|
var obj = {
|
|
productCount: Number(values.productCount),
|
|
attributeList: keys
|
|
};
|
|
value.stockLogList1.push(obj);
|
|
});
|
|
}
|
|
purchaseDetails.push(value);
|
|
}
|
|
});
|
|
case 6:
|
|
_context8.next = 8;
|
|
return _this29.goInventory(purchase, purchaseDetails);
|
|
case 8:
|
|
case "end":
|
|
return _context8.stop();
|
|
}
|
|
}
|
|
}, _callee8);
|
|
}))();
|
|
},
|
|
inventorySubmit: function inventorySubmit() {
|
|
var that = this;
|
|
if (this.carList.size == 0) {
|
|
uni.showToast({
|
|
title: "请选择商品后再入库",
|
|
icon: 'none'
|
|
});
|
|
} else if (this.khName == '') {
|
|
uni.showModal({
|
|
title: "提示",
|
|
content: "您没有选择供应商,要使用“默认供应商”入库吗?",
|
|
success: function success(res) {
|
|
if (res.confirm) {
|
|
that.gysList();
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
this.goRuku();
|
|
}
|
|
},
|
|
goInventory: function goInventory(purchase, purchaseDetails) {
|
|
uni.navigateTo({
|
|
url: '/package1/inventory/inventoryConfirm?aiinventory=1&purchase=' + JSON.stringify(purchase) + '&purchaseDetails=' + JSON.stringify(purchaseDetails) + '&zhiqianqiankuan=' + this.zhiqianqiankuan + '&yuedikou=' + this.yuedikou + '&leijiqiankuan=' + this.leijiqiankuan
|
|
});
|
|
},
|
|
//编辑每一个的单价
|
|
clickCollapse: function clickCollapse(e, id) {
|
|
if (this.linshiPrice == e.target.value) {
|
|
this.carList.get(id).purchasePrice = e.target.value;
|
|
} else {
|
|
if (e.detail.value == '') {
|
|
this.carList.get(id).purchasePrice = this.linshiPrice;
|
|
} else {
|
|
this.carList.get(id).purchasePrice = Number(e.detail.value);
|
|
}
|
|
}
|
|
this.carList.get(id).price1 = Number(this.carList.get(id).productCount) * this.carList.get(id).purchasePrice;
|
|
this.getAllPrice();
|
|
},
|
|
//编辑每一个的批和零售
|
|
PriceAndWho: function PriceAndWho(e, id, type) {
|
|
if (type == 'pi') {
|
|
if (this.linshiPrice == e.target.value) {
|
|
this.carList.get(id).wholesalePrice = e.target.value;
|
|
} else {
|
|
if (e.detail.value == '') {
|
|
this.carList.get(id).wholesalePrice = this.linshiPrice;
|
|
} else {
|
|
this.carList.get(id).wholesalePrice = Number(e.detail.value);
|
|
}
|
|
}
|
|
} else {
|
|
if (this.linshiPrice == e.target.value) {
|
|
this.carList.get(id).price = e.target.value;
|
|
this.carList.get(id).lsprice = e.target.value;
|
|
} else {
|
|
if (e.detail.value == '') {
|
|
this.carList.get(id).price = this.linshiPrice;
|
|
this.carList.get(id).lsprice = this.linshiPrice;
|
|
} else {
|
|
this.carList.get(id).price = Number(e.detail.value);
|
|
this.carList.get(id).lsprice = Number(e.detail.value);
|
|
}
|
|
}
|
|
}
|
|
this.$forceUpdate();
|
|
},
|
|
//计算总金额和总数量
|
|
getAllPrice: function getAllPrice() {
|
|
var _this30 = this;
|
|
var that = this;
|
|
this.shouldPay = 0;
|
|
this.totalAmount = 0;
|
|
that.leijiqiankuan = 0;
|
|
that.yuedikou = 0;
|
|
this.carList.forEach(function (value, key) {
|
|
that.shouldPay = that.shouldPay + value.price1;
|
|
that.totalAmount = that.totalAmount + Number(value.productCount);
|
|
});
|
|
this.$nextTick(function () {
|
|
if (parseFloat(that.zhiqianqiankuan) < 0) {
|
|
if (that.shouldPay > Math.abs(that.zhiqianqiankuan)) {
|
|
that.yuedikou = Math.abs(that.zhiqianqiankuan);
|
|
_this30.alreadyPay = _this30.checkRealPay(_this30.shouldPay - Math.abs(that.zhiqianqiankuan));
|
|
} else if (that.shouldPay <= Math.abs(that.zhiqianqiankuan)) {
|
|
that.yuedikou = that.shouldPay;
|
|
that.alreadyPay = 0;
|
|
}
|
|
} else {
|
|
_this30.alreadyPay = _this30.checkRealPay(_this30.shouldPay);
|
|
}
|
|
that.shouldPay = that.shouldPay.toFixed(2);
|
|
that.noPay = _this30.shouldPay - (_this30.alreadyPay == '' ? 0 : _this30.alreadyPay) - that.yuedikou;
|
|
that.noPay = that.noPay.toFixed(2);
|
|
_this30.leijiqiankuan = (Number(_this30.zhiqianqiankuan) + Number(_this30.yuedikou) + Number(_this30.noPay)).toFixed(2);
|
|
_this30.$forceUpdate();
|
|
});
|
|
},
|
|
//选择是否需要自动生成货号
|
|
isChange: function isChange(index) {
|
|
this.isGenerateSnRadio = index;
|
|
},
|
|
//修改已选规格的数量
|
|
GoodsNumChange: function GoodsNumChange(e, index, index1) {
|
|
var that = this;
|
|
this.carList.get(index[0]).stockLogList.get(index1).productCount = Number(e);
|
|
this.carList.get(index[0]).productCount = 0;
|
|
this.carList.get(index[0]).stockLogList.forEach(function (value, key) {
|
|
that.carList.get(index[0]).productCount = Number(that.carList.get(index[0]).productCount) + Number(value.productCount);
|
|
that.carList.get(index[0]).price1 = Number(that.carList.get(index[0]).productCount) * that.carList.get(index[0]).purchasePrice;
|
|
});
|
|
that.getAllPrice();
|
|
}
|
|
}
|
|
};
|
|
exports.default = _default;
|
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
|
|
|
|
/***/ }),
|
|
|
|
/***/ 563:
|
|
/*!***********************************************************************************************!*\
|
|
!*** C:/文档/distribution-uni/package1/AI/voiceInventory.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_voiceInventory_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!./voiceInventory.vue?vue&type=style&index=0&lang=scss& */ 564);
|
|
/* 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_voiceInventory_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_voiceInventory_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_voiceInventory_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_voiceInventory_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_voiceInventory_vue_vue_type_style_index_0_lang_scss___WEBPACK_IMPORTED_MODULE_0___default.a);
|
|
|
|
/***/ }),
|
|
|
|
/***/ 564:
|
|
/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
|
!*** ./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/AI/voiceInventory.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; }
|
|
|
|
|
|
/***/ })
|
|
|
|
},[[557,"common/runtime","common/vendor"]]]);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/package1/AI/voiceInventory.js.map
|