|
@@ -200,7 +200,7 @@ export default {
|
|
|
showCustomer: false
|
|
showCustomer: false
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
- onLoad () {
|
|
|
|
|
|
|
+ onLoad (option) {
|
|
|
if (!this.getMerchantInfo) {
|
|
if (!this.getMerchantInfo) {
|
|
|
this.initMerchantInfo().then((data) => {
|
|
this.initMerchantInfo().then((data) => {
|
|
|
uni.setNavigationBarTitle({
|
|
uni.setNavigationBarTitle({
|
|
@@ -214,6 +214,14 @@ export default {
|
|
|
}
|
|
}
|
|
|
this.modifyPrice = this.allPrice.toFixed(2);
|
|
this.modifyPrice = this.allPrice.toFixed(2);
|
|
|
this.courier(2);
|
|
this.courier(2);
|
|
|
|
|
+
|
|
|
|
|
+ if(option.customId){
|
|
|
|
|
+ this.form.customId = option.customId
|
|
|
|
|
+ }
|
|
|
|
|
+ if(option.customName){
|
|
|
|
|
+ this.form.customName = option.customName
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
onShow(){
|
|
onShow(){
|
|
|
if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
|
|
if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
|
|
@@ -292,12 +300,10 @@ export default {
|
|
|
if (options.sendType == 2) {
|
|
if (options.sendType == 2) {
|
|
|
options.sendCost = "";
|
|
options.sendCost = "";
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
createOrder({...options,modifyPrice: this.modifyPrice,}).then((res) => {
|
|
createOrder({...options,modifyPrice: this.modifyPrice,}).then((res) => {
|
|
|
- this.resetSelectInfoByType(this.pageType);
|
|
|
|
|
- const {
|
|
|
|
|
- data: { id, orderSn },
|
|
|
|
|
- } = res;
|
|
|
|
|
|
|
+ //删除记忆
|
|
|
|
|
+ this.removeMemory()
|
|
|
|
|
+ const {data: { id, orderSn },} = res;
|
|
|
let url = `/admin/billing/result?orderId=${id}&orderSn=${orderSn}`;
|
|
let url = `/admin/billing/result?orderId=${id}&orderSn=${orderSn}`;
|
|
|
uni.redirectTo({
|
|
uni.redirectTo({
|
|
|
url: url,
|
|
url: url,
|
|
@@ -308,62 +314,59 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
affirmFormSubmit () {
|
|
affirmFormSubmit () {
|
|
|
- let self = this;
|
|
|
|
|
- if(this.isBilling){
|
|
|
|
|
- let rules = [
|
|
|
|
|
- {
|
|
|
|
|
- name: "customId",
|
|
|
|
|
- rule: ["required"],
|
|
|
|
|
- msg: ["请选择客户"],
|
|
|
|
|
- },
|
|
|
|
|
- ];
|
|
|
|
|
- let checkRes = formUtil.validation(this.form, rules);
|
|
|
|
|
- if (checkRes) {
|
|
|
|
|
- this.$msg(checkRes);
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- uni.showModal({
|
|
|
|
|
- title: "提示",
|
|
|
|
|
- content: "确认开单?",
|
|
|
|
|
- success: function (res) {
|
|
|
|
|
- if (res.confirm) {
|
|
|
|
|
- self.formSubmit();
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
- }else{
|
|
|
|
|
- let price = 0;
|
|
|
|
|
- let product = this.selectList.map((ele) => {
|
|
|
|
|
- price += ele.bigCount * Number(ele.bigPrice);
|
|
|
|
|
- price += ele.smallCount * Number(ele.smallPrice);
|
|
|
|
|
- return {
|
|
|
|
|
- productId: ele.id,
|
|
|
|
|
- bigNum: ele.bigCount,
|
|
|
|
|
- smallNum: ele.smallCount,
|
|
|
|
|
- classId: ele.classId,
|
|
|
|
|
- itemId: ele.itemId,
|
|
|
|
|
- price: ele.userPrice>0?ele.userPrice:price,
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
- console.log(product)
|
|
|
|
|
- // formData.product = JSON.stringify(product);
|
|
|
|
|
- uni.showModal({
|
|
|
|
|
- title: "提示",
|
|
|
|
|
- content: "确认报损?",
|
|
|
|
|
- success: function (res) {
|
|
|
|
|
- if (res.confirm) {
|
|
|
|
|
- wastage({product:JSON.stringify(product)}).then((res) => {
|
|
|
|
|
- self.resetSelectInfoByType(self.pageType);
|
|
|
|
|
- const {data: { id, orderSn },} = res;
|
|
|
|
|
- let url = `/admin/billing/result?title=报损成功&orderId=${id}&orderSn=${orderSn}`;
|
|
|
|
|
- uni.redirectTo({url: url,success: (result) => { },fail: () => { },complete: () => { },
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ let self = this;
|
|
|
|
|
+ if(this.isBilling){
|
|
|
|
|
+ let rules = [
|
|
|
|
|
+ {
|
|
|
|
|
+ name: "customId",
|
|
|
|
|
+ rule: ["required"],
|
|
|
|
|
+ msg: ["请选择客户"],
|
|
|
|
|
+ },
|
|
|
|
|
+ ];
|
|
|
|
|
+ let checkRes = formUtil.validation(this.form, rules);
|
|
|
|
|
+ if (checkRes) {
|
|
|
|
|
+ this.$msg(checkRes);
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ uni.showModal({
|
|
|
|
|
+ title: "提示",
|
|
|
|
|
+ content: "确认开单?",
|
|
|
|
|
+ success: function (res) {
|
|
|
|
|
+ if (res.confirm) {
|
|
|
|
|
+ self.formSubmit();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ }else{
|
|
|
|
|
+ let price = 0;
|
|
|
|
|
+ let product = this.selectList.map((ele) => {
|
|
|
|
|
+ price += ele.bigCount * Number(ele.bigPrice);
|
|
|
|
|
+ price += ele.smallCount * Number(ele.smallPrice);
|
|
|
|
|
+ return {
|
|
|
|
|
+ productId: ele.id,
|
|
|
|
|
+ bigNum: ele.bigCount,
|
|
|
|
|
+ smallNum: ele.smallCount,
|
|
|
|
|
+ classId: ele.classId,
|
|
|
|
|
+ itemId: ele.itemId,
|
|
|
|
|
+ price: ele.userPrice>0?ele.userPrice:price,
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+ uni.showModal({
|
|
|
|
|
+ title: "提示",
|
|
|
|
|
+ content: "确认报损?",
|
|
|
|
|
+ success: function (res) {
|
|
|
|
|
+ if (res.confirm) {
|
|
|
|
|
+ wastage({product:JSON.stringify(product)}).then((res) => {
|
|
|
|
|
+ //删除记忆
|
|
|
|
|
+ this.removeMemory()
|
|
|
|
|
+ const {data: { id, orderSn },} = res;
|
|
|
|
|
+ let url = `/admin/billing/result?title=报损成功&orderId=${id}&orderSn=${orderSn}`;
|
|
|
|
|
+ uni.redirectTo({url: url,success: (result) => { },fail: () => { },complete: () => { },});
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
// 表单验证
|
|
// 表单验证
|
|
|
async formSubmit (e) {
|
|
async formSubmit (e) {
|