exports.ids = [30,1,26,27];
exports.modules = {

/***/ 160:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return formatPrice; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return round; });
/* unused harmony export transformNumber */
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getUnit; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return getSetup; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getPrint; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getAddon; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getPackaging; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getFright; });
/* harmony import */ var number_precision__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(112);
/* harmony import */ var number_precision__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(number_precision__WEBPACK_IMPORTED_MODULE_0__);
// 商品价格计算相关


// 价格格式化
function formatPrice(value, needSymbol = true) {
  // 不能在最后一步显示之前格式化999 111, 否则可能出现单价1买999个得到999价格被格式化成poa的情况
  if (value === 0) {
    return needSymbol ? '$0.00' : '0.00';
  } else {
    return needSymbol ? `$${value}` : `${value}`;
  }
}

// 简单的乘法换算
function multiply(value, ratio = 100) {
  return parseFloat((value * ratio).toPrecision(12));
}
// 小数处理, 四舍五入, 为toFixed做准备
function round(number, ratio = 100) {
  return Math.round(multiply(number, ratio)) / ratio;
}

/**
 * 将字符串简单转换成数字, 并可数倍转换. 注意, 这个适用于整数倍(商品件数), 非整数的不能用这个处理小数.
 * @param {*} value 目标值
 * @param {*} ratio 倍数, 默认1
 * @returns number | origin, 转换后的数字, 无法转成数字的返回原值
 */
function transformNumber(value, ratio = 1) {
  const v = Number(value);
  if (Number.isNaN(v)) {
    return value;
  } else {
    // 保留两位小数
    return Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["divide"])(Math.trunc(Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(v, ratio), 100)), 100);
  }
}

// unit 单个商品的, 没有乘数量. 因为含有111 999 这些极端值, 没有格式化输出之前直接乘回出问题的.
const getUnit = function (buyNum, index, attributeList, basePriceList) {
  // 算出购买数量位于 价格阶梯的 哪个区间
  const candidate = Object.entries(attributeList).filter(item => buyNum >= item[1]);
  let key = 'website_qty1';
  if (candidate.length) {
    key = candidate.pop()[0];
  }
  return transformNumber(basePriceList[index][key], buyNum);
};

// 打印和附加价格 的steup之和. 商品基础价格现在没有setup了.
const getSetup = function (buyNum, form, additionList) {
  const sum = Object.entries(form).reduce((total, current) => {
    let s = 0;
    // 打印服务表单的数据跟附加服务表单的数据结构不一致, 以数字id字符串键名的是打印服务的数据
    if (/\d+/.test(current[0]) && current[1].enable) {
      const temp = current[1].colorForm.filter(i => i.id === current[1].printService);
      let colorNumber = 1;
      if (temp.length) {
        colorNumber = temp[0].colorNumber;
      }
      const decoration = current[1].decorationList.filter(i => i.id === current[1].printService);
      let setup = 0;
      if (decoration.length) {
        setup = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(Number(decoration[0].website_setup), Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(Number(decoration[0].supplier_setup), colorNumber - 1));
      }
      s = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(s, setup);
    } else if (current[1].length) {
      // 附加服务的表单数据, 有值说明该项有选中了附加服务
      const addition = additionList[current[0]].filter(addition => current[1].includes(addition.id));
      if (addition.length) {
        const temp = addition.reduce((t, c) => {
          let value = Number(c.website_setup);
          if ([5, 6].includes(c.website_setup_id)) {
            // 5是poa, 6是waived. 这种情况一般setup是留空的, 不留空大概是异常数据, 重置0保险一点.
            value = 0;
          }
          return Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(t, Number.isNaN(value) ? 0 : value);
        }, 0);
        s = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(s, temp);
      }
    }
    total = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(total, s);
    return total;
  }, 0);
  return transformNumber(sum);
};

// 打印价格的 阶梯基础价*购买数量.
const getPrint = function (buyNum, form, attributeList) {
  // 算出购买数量位于 价格阶梯的 哪个区间
  const candidate = Object.entries(attributeList).filter(item => buyNum >= item[1]);
  const key = `website_qty${candidate.length}`;
  const key2 = `supplier_qty${candidate.length}`;

  // 如果其中一项为POA, 则‘和’都是POA
  const result = Object.entries(form).reduce((total, current) => {
    if (total === 'POA') {
      return total;
    }
    let sum = 0;
    if (/\d+/.test(current[0]) && current[1].enable) {
      const temp = current[1].colorForm.filter(i => i.id === current[1].printService);
      let colorNumber = 1;
      if (temp.length) {
        colorNumber = temp[0].colorNumber;
      }
      const decoration = current[1].decorationList.filter(i => i.id === current[1].printService);
      // 打印价格的基础价. 其中数字111(代表'-') 和999(代表'POA')
      const p1 = transformNumber(decoration[0][key]);
      if (p1 === 999 || p1 === 111 || typeof p1 !== 'number') {
        return 'POA';
      }
      // 打印价格的附加价
      const p2 = transformNumber(decoration[0][key2]);
      if (p2 === 999 || p2 === 111 || typeof p2 !== 'number') {
        return 'POA';
      }
      let price = 0;
      if (decoration.length) {
        price = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(p1, Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(p2, colorNumber - 1));
      }
      sum = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(sum, price);
    }
    total = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(total, sum);
    return total;
  }, 0);
  return transformNumber(result, buyNum);
};
// 附加服务除了packing之外的总价
const getAddon = function (buyNum, form, attributeList, additionList) {
  // 算出购买数量位于 价格阶梯的 哪个区间
  const candidate = Object.entries(attributeList).filter(item => buyNum >= item[1]);
  const key = `website_qty${candidate.length}`;
  const result = Object.entries(form).reduce((total, current) => {
    if (total === 'POA') {
      return total;
    }
    let sum = 0;
    if (!/\d+/.test(current[0]) && current[0] !== 'packaging') {
      sum = additionList[current[0]].filter(item => current[1].includes(item.id)).reduce((t, c) => {
        if (t === 'POA') {
          return t;
        }
        let temp = transformNumber(c[key]);
        if (temp === 999 || temp === 111 || typeof temp !== 'number') {
          temp = 0;
          return 'POA';
        }
        t = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(t, temp);
        return t;
      }, 0);
    }
    return Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(total, sum);
  }, 0);
  return transformNumber(result, buyNum);
};
// 附加服务中 packing 的价格
const getPackaging = function (buyNum, form, attributeList, additionList) {
  // 算出购买数量位于 价格阶梯的 哪个区间
  const candidate = Object.entries(attributeList).filter(item => buyNum >= item[1]);
  const key = `website_qty${candidate.length}`;
  const result = Object.entries(form).reduce((total, current) => {
    if (total === 'POA') {
      return total;
    }
    let sum = 0;
    if (!/\d+/.test(current[0]) && current[0] === 'packaging') {
      sum = additionList[current[0]].filter(item => current[1].includes(item.id)).reduce((t, c) => {
        if (t === 'POA') {
          return t;
        }
        let temp = transformNumber(c[key]);
        if (temp === 999 || temp === 111 || typeof temp !== 'number') {
          temp = 0;
          return 'POA';
        }
        t = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(t, temp);
        return t;
      }, 0);
    }
    return Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(total, sum);
  }, 0);
  return transformNumber(result, buyNum);
};

// 运费计算. 从product页面抄过来的逻辑. +号是隐式类型转换
const getFright = function (buyNum, config, freight, weight, ratio = 1) {
  // 单独批次数量的总重
  const totalWeight = Math.ceil(Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(+weight.unit_w_local, buyNum));
  const expressFactor = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(1, Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["divide"])(Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(+config.express_freight, +config.fuel), 100));
  const AAEFactor = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(1, Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["divide"])(Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(+config.bag_freight, +config.fuel), 100));
  let frightCost = 0;
  if (freight.type === 1) {
    if (totalWeight > 20) {
      const a1 = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["minus"])(totalWeight, 20);
      const a2 = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(a1, +freight.basic);
      const a3 = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(+freight.pickup, a2);
      frightCost = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(a3, expressFactor);
    } else {
      frightCost = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(+freight.pickup, expressFactor);
    }
  } else if (freight.type === 2) {
    const a1 = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(totalWeight, +freight.basic);
    const a2 = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["plus"])(+freight.pickup, a1);
    frightCost = Object(number_precision__WEBPACK_IMPORTED_MODULE_0__["times"])(a2, AAEFactor);
  } else {
    frightCost = 0;
  }
  return transformNumber(frightCost, ratio);
};

/***/ }),

/***/ 166:
/***/ (function(module, exports) {

// Exports
module.exports = {

};


/***/ }),

/***/ 178:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/product-builder/stepMixin.vue?vue&type=template&id=bbcc9c86&scoped=true
var render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _c('div', {}, []);
};
var staticRenderFns = [];

// CONCATENATED MODULE: ./components/product-builder/stepMixin.vue?vue&type=template&id=bbcc9c86&scoped=true

// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/product-builder/stepMixin.vue?vue&type=script&lang=js
/* 仅用于本目录3个step表单组件的共享逻辑 */
/* harmony default export */ var stepMixinvue_type_script_lang_js = ({
  name: 'StepMixin',
  components: {},
  props: {
    loading: {
      type: Boolean,
      default: false
    },
    priceData: {
      type: Object,
      default: function () {
        return {
          priceList: [],
          attributeList: {},
          additionList: {}
        };
      }
    },
    detail: {
      type: Object,
      default: function () {
        return {
          info: {
            images: []
          }
        };
      }
    },
    preData: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {};
  },
  computed: {},
  watch: {
    form: {
      deep: true,
      handler: function () {
        if (this.loaded) {
          this.$_emitFormData();
        }
      }
    }
  },
  mounted() {},
  methods: {
    // 将this.form 自动传递给父组件
    $_emitFormData() {
      this.$emit('update-form', JSON.parse(JSON.stringify(this.form)));
    }
  }
});
// CONCATENATED MODULE: ./components/product-builder/stepMixin.vue?vue&type=script&lang=js
 /* harmony default export */ var product_builder_stepMixinvue_type_script_lang_js = (stepMixinvue_type_script_lang_js); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(2);

// CONCATENATED MODULE: ./components/product-builder/stepMixin.vue



function injectStyles (context) {
  
  
}

/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  product_builder_stepMixinvue_type_script_lang_js,
  render,
  staticRenderFns,
  false,
  injectStyles,
  "bbcc9c86",
  "c0513676"
  
)

/* harmony default export */ var stepMixin = __webpack_exports__["default"] = (component.exports);

/***/ }),

/***/ 182:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/addAddressDialog.vue?vue&type=template&id=443741dd&scoped=true
var render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _c('div', [_c('el-dialog', {
    attrs: {
      "lock-scroll": false,
      "title": "Add address",
      "visible": _vm.dialogFormVisible,
      "width": "700px"
    },
    on: {
      "update:visible": function ($event) {
        _vm.dialogFormVisible = $event;
      }
    }
  }, [_c('el-form', {
    ref: "ruleForm",
    attrs: {
      "model": _vm.data,
      "rules": _vm.rules
    }
  }, [_c('el-form-item', {
    attrs: {
      "prop": "country"
    }
  }, [_c('label', [_vm._v("Country/Region")]), _vm._v(" "), _c('el-input', {
    model: {
      value: _vm.data.country,
      callback: function ($$v) {
        _vm.$set(_vm.data, "country", $$v);
      },
      expression: "data.country"
    }
  })], 1), _vm._v(" "), _c('el-form-item', {
    attrs: {
      "prop": "name"
    }
  }, [_c('label', [_vm._v("Full name")]), _vm._v(" "), _c('el-input', {
    model: {
      value: _vm.data.name,
      callback: function ($$v) {
        _vm.$set(_vm.data, "name", $$v);
      },
      expression: "data.name"
    }
  })], 1), _vm._v(" "), _c('el-form-item', {
    attrs: {
      "prop": "phone"
    }
  }, [_c('label', [_vm._v("Phone number")]), _vm._v(" "), _c('el-input', {
    model: {
      value: _vm.data.phone,
      callback: function ($$v) {
        _vm.$set(_vm.data, "phone", $$v);
      },
      expression: "data.phone"
    }
  })], 1), _vm._v(" "), _c('el-form-item', {
    attrs: {
      "prop": "address"
    }
  }, [_c('label', [_vm._v("Address")]), _vm._v(" "), _c('el-input', {
    attrs: {
      "placeholder": "Street address,P.O.box,company name,c/o"
    },
    model: {
      value: _vm.data.address,
      callback: function ($$v) {
        _vm.$set(_vm.data, "address", $$v);
      },
      expression: "data.address"
    }
  })], 1), _vm._v(" "), _c('el-form-item', {
    attrs: {
      "prop": "post_code"
    }
  }, [_c('label', [_vm._v("Postcode")]), _vm._v(" "), _c('el-input', {
    model: {
      value: _vm.data.post_code,
      callback: function ($$v) {
        _vm.$set(_vm.data, "post_code", $$v);
      },
      expression: "data.post_code"
    }
  })], 1), _vm._v(" "), _c('el-form-item', {
    attrs: {
      "prop": "city"
    }
  }, [_c('label', [_vm._v("City/Suburb")]), _vm._v(" "), _c('el-input', {
    attrs: {
      "placeholder": "Choose city by suburb"
    },
    model: {
      value: _vm.data.city,
      callback: function ($$v) {
        _vm.$set(_vm.data, "city", $$v);
      },
      expression: "data.city"
    }
  })], 1), _vm._v(" "), _c('el-form-item', {
    attrs: {
      "prop": "state"
    }
  }, [_c('label', [_vm._v("State/Territory")]), _vm._v(" "), _c('el-input', {
    attrs: {
      "placeholder": "Choose state by territory"
    },
    model: {
      value: _vm.data.state,
      callback: function ($$v) {
        _vm.$set(_vm.data, "state", $$v);
      },
      expression: "data.state"
    }
  })], 1), _vm._v(" "), _c('el-form-item', {
    attrs: {
      "prop": "is_default"
    }
  }, [_c('el-checkbox', {
    model: {
      value: _vm.data.is_default,
      callback: function ($$v) {
        _vm.$set(_vm.data, "is_default", $$v);
      },
      expression: "data.is_default"
    }
  }, [_vm._v("\n          Make this my default address\n        ")])], 1), _vm._v(" "), _c('el-form-item', [_c('label', [_vm._v("Delivery instruction(optional)")]), _vm._v(" "), _c('div', {
    staticStyle: {
      "color": "#86d4e9",
      "line-height": "14px"
    }
  }, [_c('i', {
    staticClass: "el-icon-arrow-down",
    staticStyle: {
      "color": "#a2a2a2"
    }
  }), _vm._v("\n          And preferences,notes,access codes and more\n        ")])])], 1), _vm._v(" "), _c('div', {
    staticClass: "dialog-footer",
    attrs: {
      "slot": "footer"
    },
    slot: "footer"
  }, [_c('el-button', {
    on: {
      "click": function ($event) {
        return _vm.submit('ruleForm');
      }
    }
  }, [_vm._v("Add address")])], 1)], 1)], 1);
};
var staticRenderFns = [];

// CONCATENATED MODULE: ./components/addAddressDialog.vue?vue&type=template&id=443741dd&scoped=true

// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/addAddressDialog.vue?vue&type=script&lang=js
/* harmony default export */ var addAddressDialogvue_type_script_lang_js = ({
  props: {
    dialogVisible: {
      type: Boolean,
      default: false
    },
    componentVisible: {
      type: Number,
      default: 2
    },
    data: {
      type: Object,
      default: () => {
        return {
          country: "Australia",
          name: "",
          phone: "",
          address: "",
          post_code: "",
          city: "",
          state: "",
          is_default: null
        };
      }
    }
  },
  data() {
    return {
      value: [],
      options: [],
      rules: {
        country: [{
          required: true,
          message: "Please enter your country",
          trigger: "blur"
        }],
        name: [{
          required: true,
          message: "Please enter your name",
          trigger: "blur"
        }],
        phone: [{
          required: true,
          message: "Please enter your phone number",
          trigger: "blur"
        }],
        address: [{
          required: true,
          message: "Please enter your address",
          trigger: "blur"
        }],
        post_code: [{
          required: true,
          message: "Please enter post_code",
          trigger: "blur"
        }],
        city: [{
          required: true,
          message: "Please enter city",
          trigger: "blur"
        }],
        state: [{
          required: true,
          message: "Please enter state",
          trigger: "blur"
        }]
      },
      cityList: [{
        id: 1,
        name: "Sydney"
      }, {
        id: 2,
        name: "Adelaide Mail Centre"
      }, {
        id: 3,
        name: "Melbourne"
      }, {
        id: 4,
        name: "Eastern Suburbs Mc"
      }, {
        id: 5,
        name: "Hobart"
      }, {
        id: 6,
        name: "Perth"
      }, {
        id: 7,
        name: "Launceston"
      }, {
        id: 8,
        name: "Brisbane"
      }, {
        id: 9,
        name: "Northern Suburbs Mc"
      }, {
        id: 10,
        name: "Strawberry Hills"
      }, {
        id: 11,
        name: "Springfield"
      }, {
        id: 12,
        name: "Waterloo"
      }, {
        id: 13,
        name: "Richmond"
      }, {
        id: 14,
        name: "Haymarket"
      }, {
        id: 15,
        name: "Red Hill"
      }, {
        id: 16,
        name: "Brisbane GPO Boxes"
      }, {
        id: 17,
        name: "Mayfield"
      }, {
        id: 18,
        name: "Australia Square"
      }, {
        id: 19,
        name: "Woodstock"
      }, {
        id: 20,
        name: "Sydney South"
      }, {
        id: 21,
        name: "The Gap"
      }, {
        id: 22,
        name: "Kingston"
      }, {
        id: 23,
        name: "Kensington"
      }, {
        id: 24,
        name: "Darlington"
      }],
      stateList: [{
        id: 1,
        name: "Australian Capital Territory"
      }, {
        id: 2,
        name: "New South Wales"
      }, {
        id: 3,
        name: "Northern Territory"
      }, {
        id: 4,
        name: "Queensland"
      }, {
        id: 5,
        name: "South Australia"
      }, {
        id: 6,
        name: "Tasmania"
      }, {
        id: 7,
        name: "Victoria"
      }, {
        id: 8,
        name: "Western Australia"
      }]
    };
  },
  computed: {
    dialogFormVisible: {
      get: function () {
        return this.dialogVisible;
      },
      set: function (val) {
        this.$emit("update:dialogVisible", val);
      }
    }
  },
  methods: {
    submit(ruleForm) {
      this.$refs[ruleForm].validate(valid => {
        if (valid) {
          if (this.componentVisible == 2) {
            this.addAddress();
            if (this.$route.fullPath.includes('product-builder')) return;
            this.$router.push({
              path: '/home/myDetail',
              query: {
                type: "third"
              }
            });
          } else if (this.componentVisible == 3) {
            this.editAddress();
            this.$router.push({
              path: '/home/myDetail',
              query: {
                type: "third"
              }
            });
          }
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    addAddress() {
      this.$axios.post("/address/add", this.data).then(res => {
        if (res.code === 1) {
          this.$notify({
            title: "success",
            message: "Submitted successfully",
            type: "success",
            duration: 3000
          });
          this.dialogFormVisible = false;
          this.update();
        }
      }).catch(error => {
        this.$message.error(error.response.data.msg);
      });
    },
    editAddress() {
      this.$axios.post("/address/edit", this.data).then(res => {
        if (res.code === 1) {
          this.$notify({
            title: "success",
            message: "Submitted successfully",
            type: "success",
            duration: 3000
          });
          this.dialogFormVisible = false;
          this.update();
        }
      }).catch(error => {
        this.$message.error(error.response.data.msg);
      });
    },
    update() {
      this.$emit("update", true);
    }
  }
});
// CONCATENATED MODULE: ./components/addAddressDialog.vue?vue&type=script&lang=js
 /* harmony default export */ var components_addAddressDialogvue_type_script_lang_js = (addAddressDialogvue_type_script_lang_js); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(2);

// CONCATENATED MODULE: ./components/addAddressDialog.vue



function injectStyles (context) {
  
  var style0 = __webpack_require__(194)
if (style0.__inject__) style0.__inject__(context)

}

/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  components_addAddressDialogvue_type_script_lang_js,
  render,
  staticRenderFns,
  false,
  injectStyles,
  "443741dd",
  "72c5b0ae"
  
)

/* harmony default export */ var addAddressDialog = __webpack_exports__["default"] = (component.exports);

/***/ }),

/***/ 185:
/***/ (function(module, exports) {

// Exports
module.exports = {

};


/***/ }),

/***/ 194:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_addAddressDialog_vue_vue_type_style_index_0_id_443741dd_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(166);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_addAddressDialog_vue_vue_type_style_index_0_id_443741dd_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_addAddressDialog_vue_vue_type_style_index_0_id_443741dd_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_addAddressDialog_vue_vue_type_style_index_0_id_443741dd_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_addAddressDialog_vue_vue_type_style_index_0_id_443741dd_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));


/***/ }),

/***/ 226:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DialogSelectAddr_vue_vue_type_style_index_0_id_69716650_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(185);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DialogSelectAddr_vue_vue_type_style_index_0_id_69716650_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DialogSelectAddr_vue_vue_type_style_index_0_id_69716650_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DialogSelectAddr_vue_vue_type_style_index_0_id_69716650_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DialogSelectAddr_vue_vue_type_style_index_0_id_69716650_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));


/***/ }),

/***/ 227:
/***/ (function(module, exports) {

// Exports
module.exports = {

};


/***/ }),

/***/ 240:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/product-builder/DialogSelectAddr.vue?vue&type=template&id=69716650&scoped=true
var render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _c('div', {
    attrs: {
      "id": "dialogSelectAddr"
    }
  }, [_c('el-dialog', {
    attrs: {
      "lock-scroll": false,
      "title": "Choose a delivery address",
      "visible": _vm.show,
      "close-on-click-modal": false,
      "close-on-press-escape": false,
      "show-close": true,
      "width": "50%"
    },
    on: {
      "update:visible": function ($event) {
        _vm.show = $event;
      },
      "close": _vm.close
    }
  }, [_c('el-table', {
    ref: "table",
    staticStyle: {
      "width": "100%"
    },
    attrs: {
      "height": "300",
      "data": _vm.computedList,
      "row-class-name": 'row-cursor'
    },
    on: {
      "row-click": _vm.handleCurrentChange
    }
  }, [_c('el-table-column', {
    attrs: {
      "label": "checked",
      "width": "80px"
    },
    scopedSlots: _vm._u([{
      key: "default",
      fn: function (scope) {
        return [_c('el-checkbox', {
          attrs: {
            "value": scope.row.selected
          }
        })];
      }
    }])
  }), _vm._v(" "), _c('el-table-column', {
    attrs: {
      "label": "address"
    },
    scopedSlots: _vm._u([{
      key: "default",
      fn: function (scope) {
        return [_vm._v("\n          " + _vm._s(scope.row.name) + " " + _vm._s(scope.row.address) + ", " + _vm._s(scope.row.city) + ", " + _vm._s(scope.row.post_code) + ", " + _vm._s(scope.row.country) + ", Phone number: " + _vm._s(scope.row.phone) + "\n        ")];
      }
    }])
  })], 1), _vm._v(" "), _c('br'), _vm._v(" "), _c('div', [_c('el-button', {
    attrs: {
      "size": "mini",
      "type": "text",
      "plain": ""
    },
    on: {
      "click": _vm.newAddr
    }
  }, [_vm._v("Add Shipping Address")])], 1), _vm._v(" "), _c('br'), _vm._v(" "), _c('el-button', {
    attrs: {
      "size": "small",
      "type": "primary"
    },
    on: {
      "click": _vm.submit
    }
  }, [_vm._v("Deliver to this address")])], 1)], 1);
};
var staticRenderFns = [];

// CONCATENATED MODULE: ./components/product-builder/DialogSelectAddr.vue?vue&type=template&id=69716650&scoped=true

// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/product-builder/DialogSelectAddr.vue?vue&type=script&lang=js
/* harmony default export */ var DialogSelectAddrvue_type_script_lang_js = ({
  name: 'DialogSelectAddr',
  components: {},
  filters: {},
  props: {
    addressDetail: {
      type: Object,
      default: function () {
        return {};
      }
    },
    visible: {
      type: Boolean,
      default: false
    },
    addressList: {
      type: Array,
      default: function () {
        return [];
      }
    }
  },
  data() {
    return {
      show: false,
      selectedId: -1,
      computedList: []
    };
  },
  computed: {},
  watch: {
    visible() {
      this.show = this.visible;
      if (this.visible) {
        this.generateAddressList();
      }
    },
    addressList() {
      this.generateAddressList();
    }
  },
  mounted() {},
  methods: {
    generateAddressList() {
      this.computedList = this.addressList.map(item => {
        return {
          ...item,
          selected: false
        };
      });
    },
    submit() {
      if (this.selectedId === -1) {
        this.$message.error('Please check address before click this button');
        return;
      }
      this.$emit('select-addr', this.selectedId);
      this.close();
    },
    close() {
      this.selectedId = -1;
      this.computedList = [];
      this.$emit('close', false);
    },
    newAddr() {
      this.$emit('add-new-addr');
      this.close();
    },
    handleCurrentChange(value, row, p3) {
      this.selectedId = value.id || -1;
      this.$refs.table.setCurrentRow(value);
      this.computedList = this.addressList.map(item => {
        return {
          ...item,
          selected: item.id === value.id
        };
      });
    }
  }
});
// CONCATENATED MODULE: ./components/product-builder/DialogSelectAddr.vue?vue&type=script&lang=js
 /* harmony default export */ var product_builder_DialogSelectAddrvue_type_script_lang_js = (DialogSelectAddrvue_type_script_lang_js); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(2);

// CONCATENATED MODULE: ./components/product-builder/DialogSelectAddr.vue



function injectStyles (context) {
  
  var style0 = __webpack_require__(226)
if (style0.__inject__) style0.__inject__(context)

}

/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  product_builder_DialogSelectAddrvue_type_script_lang_js,
  render,
  staticRenderFns,
  false,
  injectStyles,
  "69716650",
  "3dfc6015"
  
)

/* harmony default export */ var DialogSelectAddr = __webpack_exports__["default"] = (component.exports);

/***/ }),

/***/ 255:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_step_3_vue_vue_type_style_index_0_id_6afcebbd_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(227);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_step_3_vue_vue_type_style_index_0_id_6afcebbd_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_step_3_vue_vue_type_style_index_0_id_6afcebbd_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_step_3_vue_vue_type_style_index_0_id_6afcebbd_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_step_3_vue_vue_type_style_index_0_id_6afcebbd_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));


/***/ }),

/***/ 322:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/product-builder/step-3.vue?vue&type=template&id=6afcebbd&scoped=true
var render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _c('el-card', {
    staticClass: "step-card"
  }, [_c('div', {
    staticClass: "flex between",
    attrs: {
      "slot": "header"
    },
    slot: "header"
  }, [_c('div', {
    staticClass: "step-card-title"
  }, [_vm._v("Step3 Confirm")])]), _vm._v(" "), _c('div', {
    directives: [{
      name: "loading",
      rawName: "v-loading",
      value: _vm.loading,
      expression: "loading"
    }]
  }, [_c('div', [_vm.addressList.length ? _c('div', [_c('div', {
    staticClass: "card-sub-title"
  }, [_vm._v("Ship to")]), _vm._v(" "), _c('div', {
    staticClass: "form-item-label"
  }, [_vm._v("Shipping address")]), _vm._v(" "), _c('div', {
    staticClass: "flex between"
  }, [_c('div', [_c('div', [_c('div', {
    staticClass: "flex"
  }, [_c('div', {
    staticClass: "address-text name"
  }, [_vm._v(_vm._s(_vm.defaultAddr.name))]), _vm._v(" "), _c('div', {
    staticClass: "address-text"
  }, [_vm._v(" " + _vm._s(_vm.defaultAddr.phone))])]), _vm._v(" "), _c('div', {
    staticClass: "address-text"
  }, [_vm._v(_vm._s(_vm.defaultAddr.address))]), _vm._v(" "), _c('div', {
    staticClass: "flex"
  }, [_c('div', {
    staticClass: "address-text"
  }, [_vm._v(_vm._s(_vm.defaultAddr.city))]), _vm._v(" "), _c('div', {
    staticClass: "address-text"
  }, [_vm._v("\n                   " + _vm._s(_vm.defaultAddr.post_code) + "\n                ")])])])]), _vm._v(" "), _c('el-button', {
    attrs: {
      "type": "text"
    },
    on: {
      "click": function ($event) {
        _vm.visibleOfSelectAddressDialog = true;
      }
    }
  }, [_vm._v("edit address")])], 1)]) : _c('el-button', {
    attrs: {
      "size": "mini",
      "plain": ""
    },
    on: {
      "click": _vm.addAddress
    }
  }, [_vm._v("+ Add delivery address")])], 1), _vm._v(" "), _c('el-form', {
    ref: "form",
    attrs: {
      "model": _vm.form,
      "rules": _vm.rules,
      "label-width": "0",
      "label-position": "left"
    }
  }, [_c('el-form-item', {
    attrs: {
      "label-width": "120px",
      "label": "Freight type"
    }
  }, [_c('el-radio-group', {
    directives: [{
      name: "loading",
      rawName: "v-loading",
      value: _vm.freightLoading,
      expression: "freightLoading"
    }],
    model: {
      value: _vm.form.freight_type,
      callback: function ($$v) {
        _vm.$set(_vm.form, "freight_type", $$v);
      },
      expression: "form.freight_type"
    }
  }, [_c('el-radio', {
    attrs: {
      "label": 2
    }
  }, [_vm._v("AAE")]), _vm._v(" "), _c('el-radio', {
    attrs: {
      "label": 1
    }
  }, [_vm._v("Road express")])], 1)], 1), _vm._v(" "), _c('div', {
    staticClass: "price-title flex"
  }, [_c('div', [_vm._v("Pricing Optiopns")])]), _vm._v(" "), _c('div', {
    staticClass: "divide-solid"
  }), _vm._v(" "), _c('div', {
    staticClass: "price-table"
  }, [_c('el-table', {
    directives: [{
      name: "loading",
      rawName: "v-loading",
      value: _vm.freightLoading,
      expression: "freightLoading"
    }],
    attrs: {
      "data": _vm.computedPriceTableData
    }
  }, _vm._l(_vm.computedPriceTableColumns, function (column, index) {
    return _c('el-table-column', {
      key: `${column.prop}-${index}`,
      attrs: {
        "fixed": column.fixed || false,
        "width": column.width || '100px',
        "label": column.label || column.prop,
        "prop": column.prop
      }
    });
  }), 1)], 1), _vm._v(" "), _c('el-form-item', {
    attrs: {
      "label-width": "0",
      "prop": "job"
    }
  }, [_c('div', {
    staticClass: "form-item-label"
  }, [_c('span', {
    staticStyle: {
      "color": "red"
    }
  }, [_vm._v("*")]), _vm._v(" Reference or Job name\n        ")]), _vm._v(" "), _c('el-select', {
    staticStyle: {
      "width": "100%"
    },
    attrs: {
      "filterable": "",
      "allow-create": "",
      "default-first-option": "",
      "placeholder": "Ref, Choose or create new one"
    },
    model: {
      value: _vm.form.job,
      callback: function ($$v) {
        _vm.$set(_vm.form, "job", $$v);
      },
      expression: "form.job"
    }
  }, _vm._l(_vm.jobOptions, function (item) {
    return _c('el-option', {
      key: item.label_type,
      attrs: {
        "label": item.label_type,
        "value": item.label_type
      }
    });
  }), 1)], 1), _vm._v(" "), _c('div', {
    staticClass: "form-item-label"
  }, [_vm._v("Note")]), _vm._v(" "), _c('el-form-item', {
    attrs: {
      "prop": "note",
      "label-width": "0"
    }
  }, [_c('el-input', {
    attrs: {
      "placeholder": "Any note"
    },
    model: {
      value: _vm.form.note,
      callback: function ($$v) {
        _vm.$set(_vm.form, "note", $$v);
      },
      expression: "form.note"
    }
  })], 1)], 1), _vm._v(" "), _c('div', {
    staticClass: "flex center"
  }, [_c('el-button', {
    attrs: {
      "type": "primary"
    },
    on: {
      "click": _vm.addToProject
    }
  }, [_c('div', {
    staticClass: "flex center"
  }, [_c('span', {
    staticClass: "btn-icon el-icon-shopping-cart-2"
  }), _vm._v("  Add to\n          project\n        ")])]), _vm._v(" "), _c('el-button', {
    attrs: {
      "type": "info"
    },
    on: {
      "click": _vm.sendEnquiry
    }
  }, [_c('div', {
    staticClass: "flex"
  }, [_c('span', {
    staticClass: "btn-icon el-icon-shopping-bag-1"
  }), _vm._v("  Send\n          enquiry\n        ")])])], 1), _vm._v(" "), _c('add-address-dialog', {
    attrs: {
      "dialogVisible": _vm.visibleOfEditAddressDialog,
      "data": _vm.addressDetail,
      "componentVisible": _vm.patternOfEditAddressDialog
    },
    on: {
      "update:dialogVisible": function ($event) {
        _vm.visibleOfEditAddressDialog = $event;
      },
      "update:dialog-visible": function ($event) {
        _vm.visibleOfEditAddressDialog = $event;
      },
      "close": _vm.closeAddressDialog,
      "update": _vm.getAddressData
    }
  }), _vm._v(" "), _c('select-address-dialog', {
    attrs: {
      "addressDetail": _vm.form.defaultAddr,
      "addressList": _vm.addressList,
      "visible": _vm.visibleOfSelectAddressDialog
    },
    on: {
      "update:visible": function ($event) {
        _vm.visibleOfSelectAddressDialog = $event;
      },
      "add-new-addr": _vm.addAddress,
      "select-addr": _vm.selectAddress,
      "close": _vm.closeSelectAddressDialog
    }
  })], 1)]);
};
var staticRenderFns = [];

// CONCATENATED MODULE: ./components/product-builder/step-3.vue?vue&type=template&id=6afcebbd&scoped=true

// EXTERNAL MODULE: external "number-precision"
var external_number_precision_ = __webpack_require__(112);

// EXTERNAL MODULE: external "lodash"
var external_lodash_ = __webpack_require__(113);
var external_lodash_default = /*#__PURE__*/__webpack_require__.n(external_lodash_);

// EXTERNAL MODULE: external "vuex"
var external_vuex_ = __webpack_require__(5);

// EXTERNAL MODULE: ./components/product-builder/stepMixin.vue + 4 modules
var stepMixin = __webpack_require__(178);

// EXTERNAL MODULE: ./components/product-builder/DialogSelectAddr.vue + 4 modules
var DialogSelectAddr = __webpack_require__(240);

// EXTERNAL MODULE: ./components/addAddressDialog.vue + 4 modules
var addAddressDialog = __webpack_require__(182);

// EXTERNAL MODULE: ./utils/price.js
var price = __webpack_require__(160);

// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/product-builder/step-3.vue?vue&type=script&lang=js







/* harmony default export */ var step_3vue_type_script_lang_js = ({
  name: 'Step3',
  components: {
    addAddressDialog: addAddressDialog["default"],
    selectAddressDialog: DialogSelectAddr["default"]
  },
  mixins: [stepMixin["default"]],
  props: {
    // 步骤1中选中的周期. 不能直接拿form1来取form1.cycle, 否则步骤1变更时, 涉及到form1的computed会全部重新计算, 可能会导致其他异常
    cycle: {
      type: Number,
      default: function () {
        return 0;
      }
    },
    // 同cycle
    model: {
      type: Number,
      default: function () {
        return 0;
      }
    },
    // 同cycle. form1的autoForm, 记录对应颜色的 商品购买数量表单.
    buyForm: {
      type: Array,
      default: function () {
        return [];
      }
    },
    // 步骤2的表单. 因其设计选中规格, 为当前步骤的前置数据, 故需从父组件获取. 只用来计算, 本组件不更改这个数据.
    form2: {
      type: Object,
      default: function () {
        return {};
      }
    },
    weightInfo: {
      type: Object,
      default: function () {
        return {};
      }
    }
  },
  data() {
    return {
      rules: {
        job: [{
          required: true,
          message: 'Please select or create a job name',
          trigger: 'change'
        }]
      },
      form: {
        // 默认的配送地址
        defaultAddr: {},
        freight_type: 1,
        job: '',
        note: ''
      },
      freightLoading: false,
      // 运费信息
      freightInfo: {},
      // 运费浮动比. 从product页面来的数据, 记录在local storage里面
      sellFreight: 0,
      addressList: [],
      addressDetail: {},
      visibleOfSelectAddressDialog: false,
      visibleOfEditAddressDialog: false,
      patternOfEditAddressDialog: 1,
      jobOptions: [],
      priceTableColumns: [{
        prop: 'qty',
        label: 'Qty',
        fixed: 'left'
      }],
      dynamicPriceTableColumns: [],
      dynamicPriceTableData: [],
      priceTableData: [{
        qty: 'Unit'
      }, {
        qty: 'Set up'
      }, {
        qty: 'Print Option'
      }, {
        qty: 'Addon'
      }, {
        qty: 'Packing'
      }, {
        qty: 'Fright'
      }, {
        qty: 'SubTotal'
      }]
    };
  },
  computed: {
    ...Object(external_vuex_["mapState"])('config', {
      configInfo: state => state.configInfo
    }),
    // 商品 当前选中周期的 基础价格和打印价格数据
    computedPriceData() {
      return this.priceData.priceList.filter(item => item.cycle_id === this.cycle);
    },
    /**
     * 当前选中周期下, 商品对应的各型号基础价格数据. 可以推断当前周期有几个型号
     */
    computedBasePriceData() {
      const model = this.computedPriceData.length ? this.computedPriceData[0] : {};
      // 属性‘1’里面是基础价格数据, 属性 ’2‘是打印价格数据
      if (model['1']) {
        return model['1'].slice();
      } else {
        return [];
      }
    },
    // 当前型号位于基础价格数据的index, 用于取出型号对应的基础数据
    computedBasePriceIndex() {
      return this.computedBasePriceData.findIndex(item => item.id === this.model);
    },
    /**
     * 当前选中周期下, 商品对应的各型号打印价格.
     */
    computedPrintPriceData() {
      const model = this.computedPriceData.length ? this.computedPriceData[0] : {};
      // 属性‘1’里面是基础价格数据, 属性 ’2‘是打印价格数据
      if (model['2']) {
        return model['2'].slice();
      } else {
        return [];
      }
    },
    // 其实没必要的, 只是方便html上不用读多一层属性 from.defaultAddr.****这样
    defaultAddr() {
      return this.form.defaultAddr;
    },
    computedPriceTableColumns() {
      return this.priceTableColumns.concat(this.dynamicPriceTableColumns);
    },
    computedPriceTableData() {
      return this.priceTableData.map((item, index) => Object.assign({}, item, this.dynamicPriceTableData[index] || {}));
    }
  },
  watch: {
    addressList() {
      const temp = this.addressList.filter(item => item.is_default === 1);
      if (temp.length) {
        this.form.defaultAddr = temp[0];
      } else if (this.addressList.length) {
        this.form.defaultAddr = this.addressList[0];
      } else {
        this.form.defaultAddr = {};
      }
      if (this.form.defaultAddr.post_code) {
        this.getFreight();
      }
    },
    'form.freight_type'() {
      this.getFreight();
    },
    'form.defaultAddr'() {
      this.getFreight();
    },
    buyForm: {
      deep: true,
      immediate: true,
      handler: function () {
        const temp = [];
        if (!this.loaded) return temp;
        this.dynamicPriceTableColumns = this.buyForm.map(item => {
          return {
            prop: `${item.value}`,
            buyNum: item.value
          };
        });
        this.getDynamicPriceTableData();
      }
    },
    form2: {
      deep: true,
      immediate: true,
      handler: function () {
        this.getDynamicPriceTableData();
      }
    }
  },
  mounted() {
    if (localStorage.getItem('sellFreight')) {
      this.sellFreight = localStorage.getItem('sellFreight');
    }
    this.getAddressData().then(() => {
      this.loaded = true;
    });
    this.getJobList();
  },
  methods: {
    checkForm() {
      return new Promise((resolve, reject) => {
        this.$refs.form.validate(valid => {
          if (valid) {
            resolve(JSON.parse(JSON.stringify(this.form)));
          } else {
            reject(new Error('validate step3 form error'));
          }
        });
      });
    },
    addToProject() {
      this.$emit('check', 1);
    },
    sendEnquiry() {
      this.$emit('check', 2);
    },
    // Job 下拉/输入框候选数据
    getJobList() {
      this.$axios.post('/goods_cart/cartLabelLists', {
        keyword: []
      }).then(res => {
        this.jobOptions = res.result;
      });
    },
    // 获取配送地址数据
    async getAddressData() {
      return await this.$axios.get('address/list', {
        params: {
          keyword: '',
          page: 1,
          limit: 100
        }
      }).then(res => {
        if (res.code === 1) {
          this.addressList = res.result.data;
          this.addressTotal = res.result.total;
        }
      });
    },
    addAddress() {
      this.addressDetail = {};
      this.patternOfEditAddressDialog = 2;
      this.visibleOfEditAddressDialog = true;
    },
    closeAddressDialog() {
      this.visibleOfEditAddressDialog = false;
    },
    selectAddress(data) {
      const temp = this.addressList.filter(item => item.id === data);
      if (temp.length) this.form.defaultAddr = temp[0];
      this.closeSelectAddressDialog();
    },
    closeSelectAddressDialog() {
      this.visibleOfSelectAddressDialog = false;
    },
    getDynamicPriceTableData() {
      const temp = [{},
      // unit
      {},
      // setup 打印和附加价格之和
      {},
      // print option
      {},
      // addon 附加服务除了packing之外的总价
      {},
      // packing / packaging
      {},
      // fright 运费
      {} // 汇总
      ];
      const ratio = Object(external_number_precision_["plus"])(this.sellFreight / 100, 1);
      // { buyNum数量, prop标签label }
      this.dynamicPriceTableColumns.forEach(v => {
        const unitPrice = Object(price["g" /* getUnit */])(v.buyNum, this.computedBasePriceIndex, this.priceData.attributeList, this.computedBasePriceData);
        temp[0][`${v.prop}`] = Object(price["a" /* formatPrice */])(unitPrice);
        temp[0][`${v.prop}_value`] = unitPrice;
        const setupPrice = Object(price["f" /* getSetup */])(v.buyNum, this.form2, this.priceData.additionList);
        temp[1][`${v.prop}`] = Object(price["a" /* formatPrice */])(setupPrice);
        temp[1][`${v.prop}_value`] = setupPrice;
        const printPrice = Object(price["e" /* getPrint */])(v.buyNum, this.form2, this.priceData.attributeList);
        temp[2][`${v.prop}`] = Object(price["a" /* formatPrice */])(printPrice);
        temp[2][`${v.prop}_value`] = printPrice;
        const addonPrice = Object(price["b" /* getAddon */])(v.buyNum, this.form2, this.priceData.attributeList, this.priceData.additionList);
        temp[3][`${v.prop}`] = Object(price["a" /* formatPrice */])(addonPrice);
        temp[3][`${v.prop}_value`] = addonPrice;
        const packagingPrice = Object(price["d" /* getPackaging */])(v.buyNum, this.form2, this.priceData.attributeList, this.priceData.additionList);
        temp[4][`${v.prop}`] = Object(price["a" /* formatPrice */])(packagingPrice);
        temp[4][`${v.prop}_value`] = packagingPrice;
        const frightPrice = Object(price["c" /* getFright */])(v.buyNum, this.configInfo, this.freightInfo, this.weightInfo, ratio);
        temp[5][`${v.prop}`] = Object(price["a" /* formatPrice */])(frightPrice);
        temp[5][`${v.prop}_value`] = frightPrice;

        // 最后一行汇总行的数据
        const total = [temp[0][`${v.prop}_value`], temp[1][`${v.prop}_value`], temp[2][`${v.prop}_value`], temp[3][`${v.prop}_value`], temp[4][`${v.prop}_value`], temp[5][`${v.prop}_value`]].reduce((total, curr) => {
          const value = Number(curr);
          if (total === 'POA' || curr === 'POA') {
            return 'POA';
          } else if (typeof value === 'number') {
            return Object(external_number_precision_["plus"])(total, value);
          } else {
            return total;
          }
        }, 0);
        temp[6][`${v.prop}`] = typeof total === 'number' ? Object(price["a" /* formatPrice */])(total) : total;
        temp[6][`${v.prop}_value`] = total;
      });
      // console.log(temp, '计算动态表格数据')
      this.dynamicPriceTableData = temp;
    },
    getFreight: external_lodash_default.a.debounce(function () {
      if (!this.form.defaultAddr.post_code) return;
      this.freightLoading = true;
      this.$axios.post('/quote/freight', {
        postcode: this.form.defaultAddr.post_code,
        type: this.form.freight_type
      }).then(res => {
        this.freightInfo = res.result;
        this.getDynamicPriceTableData();
      }).finally(() => {
        setTimeout(() => {
          this.freightLoading = false;
        }, 300);
      });
    }, 200)
  }
});
// CONCATENATED MODULE: ./components/product-builder/step-3.vue?vue&type=script&lang=js
 /* harmony default export */ var product_builder_step_3vue_type_script_lang_js = (step_3vue_type_script_lang_js); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(2);

// CONCATENATED MODULE: ./components/product-builder/step-3.vue



function injectStyles (context) {
  
  var style0 = __webpack_require__(255)
if (style0.__inject__) style0.__inject__(context)

}

/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  product_builder_step_3vue_type_script_lang_js,
  render,
  staticRenderFns,
  false,
  injectStyles,
  "6afcebbd",
  "4681ca72"
  
)

/* harmony default export */ var step_3 = __webpack_exports__["default"] = (component.exports);

/* nuxt-component-imports */
installComponents(component, {AddAddressDialog: __webpack_require__(182).default})


/***/ })

};;
//# sourceMappingURL=product-builder-step3.js.map