|
@@ -28,13 +28,16 @@
|
|
|
<template slot="good_name">
|
|
|
<span>{{ sitem.good_name }}</span>
|
|
|
<span v-for="(si, sii) in sitem.specinfo" :key="si.specid + sii">
|
|
|
- <span v-if="sii !== 0">--</span><span>{{ si.spec_name }}[{{ si.spec_value_name }}]</span></span>
|
|
|
+ <span v-if="sii !== 0">--</span
|
|
|
+ ><span>{{ si.spec_name }}[{{ si.spec_value_name }}]</span></span
|
|
|
+ >
|
|
|
</template>
|
|
|
<template slot="is_noble">
|
|
|
<span v-if="sitem.is_noble">
|
|
|
{{ sitem.noble_weight }}g--{{ sitem.metal_name }}--{{
|
|
|
sitem.is_diff === "1" ? "有" : "无"
|
|
|
- }}工差--{{ sitem.config }}--{{ sitem.other_config }}</span>
|
|
|
+ }}工差--{{ sitem.config }}--{{ sitem.other_config }}</span
|
|
|
+ >
|
|
|
<span v-else>非贵金属商品</span>
|
|
|
</template>
|
|
|
<template slot="in_num">
|
|
@@ -120,7 +123,7 @@
|
|
|
type="primary"
|
|
|
:disabled="loading"
|
|
|
@click="submitForm"
|
|
|
- >保 存
|
|
|
+ >保 存
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="11">
|
|
@@ -147,26 +150,26 @@
|
|
|
|
|
|
<el-col :span="12">
|
|
|
<el-row>
|
|
|
- <el-form-item
|
|
|
- label-width="85px"
|
|
|
- label="商品类型"
|
|
|
- prop="goodtype"
|
|
|
- >
|
|
|
- <el-select v-model="ruleForm.goodtype" style="width:100%" placeholder="商品类型">
|
|
|
+ <el-form-item label-width="85px" label="商品类型" prop="goodtype">
|
|
|
+ <el-select
|
|
|
+ v-model="ruleForm.goodtype"
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="商品类型"
|
|
|
+ >
|
|
|
<el-option
|
|
|
v-for="goodType in goodTypes"
|
|
|
:key="goodType.value"
|
|
|
- :disabled="(goodType.value === '1' && Number(ruleForm.sale_price) === 0)
|
|
|
- ||(goodType.value !== '1' && Number(ruleForm.sale_price) !== 0)"
|
|
|
+ :disabled="
|
|
|
+ (goodType.value === '1' && Number(ruleForm.sale_price) === 0) ||
|
|
|
+ (goodType.value !== '1' && Number(ruleForm.sale_price) !== 0)
|
|
|
+ "
|
|
|
:value="goodType.value"
|
|
|
:label="goodType.label"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-col
|
|
|
- :span="12"
|
|
|
- >
|
|
|
+ <el-col :span="12">
|
|
|
<el-form-item label="凭证类型" prop="proof_type" label-width="85px">
|
|
|
<el-select
|
|
|
v-model="ruleForm.proof_type"
|
|
@@ -205,8 +208,8 @@
|
|
|
<div v-if="video_url" class="clearfix">
|
|
|
<el-popover placement="top" width="300" trigger="hover">
|
|
|
<video width="275" controls class="fl">
|
|
|
- <source :src="video_url" type="video/mp4">
|
|
|
- <source :src="video_url" type="video/avi">
|
|
|
+ <source :src="video_url" type="video/mp4" />
|
|
|
+ <source :src="video_url" type="video/avi" />
|
|
|
您的浏览器不支持Video标签。
|
|
|
</video>
|
|
|
<i
|
|
@@ -220,7 +223,8 @@
|
|
|
type="warning"
|
|
|
style="margin: 0 0 0 16px"
|
|
|
@click="deleteUrl('1')"
|
|
|
- >删除</el-link>
|
|
|
+ >删除</el-link
|
|
|
+ >
|
|
|
</div>
|
|
|
|
|
|
<div v-else class="activity-upload">
|
|
@@ -249,13 +253,14 @@
|
|
|
style="width: 50px; height: 50px"
|
|
|
:src="img_url"
|
|
|
class="avatar fl"
|
|
|
- >
|
|
|
+ />
|
|
|
<el-link
|
|
|
:underline="false"
|
|
|
type="warning"
|
|
|
style="margin: 0 0 0 16px"
|
|
|
@click="deleteUrl('2')"
|
|
|
- >删除</el-link>
|
|
|
+ >删除</el-link
|
|
|
+ >
|
|
|
</div>
|
|
|
|
|
|
<div v-else class="activity-upload">
|
|
@@ -286,7 +291,8 @@
|
|
|
type="warning"
|
|
|
style="margin: 0 0 0 16px"
|
|
|
@click="deleteUrl('3')"
|
|
|
- >删除</el-link>
|
|
|
+ >删除</el-link
|
|
|
+ >
|
|
|
</div>
|
|
|
|
|
|
<div v-else class="activity-upload">
|
|
@@ -314,18 +320,15 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="其他单号" prop="workNo" label-width="115px">
|
|
|
- <el-input
|
|
|
- v-model="ruleForm.workNo"
|
|
|
- maxlength="2000"
|
|
|
- type="textarea"
|
|
|
- :rows="2"
|
|
|
- show-word-limit
|
|
|
- placeholder="如: 业管单号"
|
|
|
+ <el-form-item label="项目经理" prop="manager" label-width="115px">
|
|
|
+ <project-manager
|
|
|
+ :size="'mini'"
|
|
|
+ v-model.value="ruleForm.manager"
|
|
|
+ @searchChange="managerChange"
|
|
|
+ style="width: 100%"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
+
|
|
|
<el-form-item
|
|
|
label="平台订单号"
|
|
|
prop="platform_order"
|
|
@@ -340,7 +343,18 @@
|
|
|
placeholder="如: PO号"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="其他单号" prop="workNo" label-width="115px">
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.workNo"
|
|
|
+ maxlength="2000"
|
|
|
+ type="textarea"
|
|
|
+ :rows="2"
|
|
|
+ show-word-limit
|
|
|
+ placeholder="如: 业管单号"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
</el-col>
|
|
|
+ <el-col :span="12"> </el-col>
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</el-col>
|
|
@@ -452,7 +466,7 @@
|
|
|
:names="scope.row.label"
|
|
|
placeholder="收货省市区"
|
|
|
:level="3"
|
|
|
- @searchChange="areaChange($event,scope.$index)"
|
|
|
+ @searchChange="areaChange($event, scope.$index)"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<span v-if="!scope.row.edit">{{ scope.row.addr_code_name }}</span>
|
|
@@ -573,9 +587,9 @@
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import resToken from '@/mixins/resToken'
|
|
|
-import asyncRequest from '@/apis/service/sellOut/zixunOrder'
|
|
|
-import SearchStockGoodModal from '@/components/search-stock-good-modal'
|
|
|
+import resToken from "@/mixins/resToken";
|
|
|
+import asyncRequest from "@/apis/service/sellOut/zixunOrder";
|
|
|
+import SearchStockGoodModal from "@/components/search-stock-good-modal";
|
|
|
import {
|
|
|
isnumber,
|
|
|
isMobile,
|
|
@@ -583,281 +597,297 @@ import {
|
|
|
isEmoticon,
|
|
|
isSpecialSymbol,
|
|
|
hasSpace,
|
|
|
- isAddr
|
|
|
-} from '@/utils/validate'
|
|
|
-import inAddrModel from '@/components/in-addr-model'
|
|
|
-import { ShowDataTableColumns } from './ShowDataTableColumns'
|
|
|
-import { replaceTextWrapAndSpace } from '@/utils'
|
|
|
+ isAddr,
|
|
|
+} from "@/utils/validate";
|
|
|
+import inAddrModel from "@/components/in-addr-model";
|
|
|
+import { ShowDataTableColumns } from "./ShowDataTableColumns";
|
|
|
+import { replaceTextWrapAndSpace } from "@/utils";
|
|
|
export default {
|
|
|
- name: 'BuyGoodModal',
|
|
|
+ name: "BuyGoodModal",
|
|
|
components: { SearchStockGoodModal, inAddrModel },
|
|
|
mixins: [resToken],
|
|
|
- props: ['showModel', 'sitem'],
|
|
|
+ props: ["showModel", "sitem"],
|
|
|
data() {
|
|
|
const validatemobile = (rule, value, callback) => {
|
|
|
- if (value === '') {
|
|
|
- callback(new Error('手机号不能为空!'))
|
|
|
+ if (value === "") {
|
|
|
+ callback(new Error("手机号不能为空!"));
|
|
|
} else {
|
|
|
if (!isMobile(value)) {
|
|
|
- callback(new Error('手机号格式不正确!'))
|
|
|
+ callback(new Error("手机号格式不正确!"));
|
|
|
} else {
|
|
|
- callback()
|
|
|
+ callback();
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
const validateWeight = (rule, value, callback) => {
|
|
|
- if (value === '') {
|
|
|
- callback(new Error('收货总数不能为空!'))
|
|
|
+ if (value === "") {
|
|
|
+ callback(new Error("收货总数不能为空!"));
|
|
|
} else {
|
|
|
if (!isnumber(value)) {
|
|
|
- callback(new Error('收货总数仅支持整数!'))
|
|
|
+ callback(new Error("收货总数仅支持整数!"));
|
|
|
} else {
|
|
|
- callback()
|
|
|
+ callback();
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
const validate_num_0 = (rule, value, callback) => {
|
|
|
- const { required } = rule
|
|
|
- if (required && value === '') {
|
|
|
- callback(new Error('不能为空!'))
|
|
|
+ const { required } = rule;
|
|
|
+ if (required && value === "") {
|
|
|
+ callback(new Error("不能为空!"));
|
|
|
} else if (
|
|
|
required &&
|
|
|
- (value === '0' ||
|
|
|
- value === '0.' ||
|
|
|
- value === '0.0' ||
|
|
|
- value === '0.00' ||
|
|
|
- value === '0.000')
|
|
|
+ (value === "0" ||
|
|
|
+ value === "0." ||
|
|
|
+ value === "0.0" ||
|
|
|
+ value === "0.00" ||
|
|
|
+ value === "0.000")
|
|
|
) {
|
|
|
// new Error('不能为零!')
|
|
|
- callback()
|
|
|
+ callback();
|
|
|
} else {
|
|
|
- callback()
|
|
|
+ callback();
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
const validatecontactor = (rule, value, callback) => {
|
|
|
- if (value === '') {
|
|
|
- callback(new Error('联系人不能为空!'))
|
|
|
+ if (value === "") {
|
|
|
+ callback(new Error("联系人不能为空!"));
|
|
|
} else {
|
|
|
if (value.length < 2 || value.length > 10) {
|
|
|
- callback(new Error('联系人规则为2~10位汉字!'))
|
|
|
+ callback(new Error("联系人规则为2~10位汉字!"));
|
|
|
} else {
|
|
|
if (!isChinese(value)) {
|
|
|
- callback(new Error('联系人规则为2~10位汉字!'))
|
|
|
+ callback(new Error("联系人规则为2~10位汉字!"));
|
|
|
} else if (isEmoticon(value)) {
|
|
|
- callback(new Error('联系人规则为2~10位汉字!'))
|
|
|
+ callback(new Error("联系人规则为2~10位汉字!"));
|
|
|
} else {
|
|
|
- callback()
|
|
|
+ callback();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
const validateAddr = (rule, value, callback) => {
|
|
|
- if (value === '') {
|
|
|
- callback(new Error('详细地址不能为空!'))
|
|
|
+ if (value === "") {
|
|
|
+ callback(new Error("详细地址不能为空!"));
|
|
|
} else {
|
|
|
if (hasSpace(value)) {
|
|
|
- callback(new Error('不能出现/回车/换行符!'))
|
|
|
+ callback(new Error("不能出现/回车/换行符!"));
|
|
|
} else if (isSpecialSymbol(value)) {
|
|
|
- callback(new Error('不能使用英文特殊字符!'))
|
|
|
+ callback(new Error("不能使用英文特殊字符!"));
|
|
|
} else if (isAddr(value)) {
|
|
|
- callback()
|
|
|
+ callback();
|
|
|
} else {
|
|
|
- callback(new Error('详细地址填写不规范!'))
|
|
|
+ callback(new Error("详细地址填写不规范!"));
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
return {
|
|
|
loading: false,
|
|
|
- total_price: '0',
|
|
|
+ total_price: "0",
|
|
|
addrmodel: false,
|
|
|
showModelThis: this.showModel,
|
|
|
showGoodsModel: false,
|
|
|
ShowDataTableColumns: ShowDataTableColumns,
|
|
|
- video_url: '',
|
|
|
- img_url: '',
|
|
|
- other_url: '',
|
|
|
+ video_url: "",
|
|
|
+ img_url: "",
|
|
|
+ other_url: "",
|
|
|
goodTypes: [
|
|
|
- { value: '1', label: '常规商品' },
|
|
|
- { value: '2', label: '赠品' },
|
|
|
- { value: '3', label: '样品' }
|
|
|
+ { value: "1", label: "常规商品" },
|
|
|
+ { value: "2", label: "赠品" },
|
|
|
+ { value: "3", label: "样品" },
|
|
|
],
|
|
|
proof_options: [
|
|
|
{
|
|
|
- value: '1',
|
|
|
- label: '视频'
|
|
|
+ value: "1",
|
|
|
+ label: "视频",
|
|
|
},
|
|
|
{
|
|
|
- value: '2',
|
|
|
- label: '图片'
|
|
|
+ value: "2",
|
|
|
+ label: "图片",
|
|
|
},
|
|
|
{
|
|
|
- value: '3',
|
|
|
- label: '其他'
|
|
|
- }
|
|
|
+ value: "3",
|
|
|
+ label: "其他",
|
|
|
+ },
|
|
|
],
|
|
|
pickerOptions: {
|
|
|
disabledDate: (time) => {
|
|
|
- return time.getTime() < new Date(this.sitem.in_arrival_time).getTime()
|
|
|
- }
|
|
|
+ return time.getTime() < new Date(this.sitem.in_arrival_time).getTime();
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
options: [
|
|
|
{
|
|
|
- value: '1',
|
|
|
- label: '有地址下单'
|
|
|
+ value: "1",
|
|
|
+ label: "有地址下单",
|
|
|
},
|
|
|
{
|
|
|
- value: '2',
|
|
|
- label: '无地址下单'
|
|
|
- }
|
|
|
+ value: "2",
|
|
|
+ label: "无地址下单",
|
|
|
+ },
|
|
|
],
|
|
|
- stock_code: '',
|
|
|
- cat_id: '',
|
|
|
+ stock_code: "",
|
|
|
+ cat_id: "",
|
|
|
ruleForm: {
|
|
|
- bidNo: '', // 竞价单反馈编号
|
|
|
- good_num: '', // 商品数量
|
|
|
- sale_price: '',
|
|
|
- sendtype: '1', // 发货方式
|
|
|
- arrtime: '', // 到货时间
|
|
|
- remark: '', // 订单备注
|
|
|
- platform_order: '', // 平台订单号
|
|
|
- workNo: '', // 其他单号
|
|
|
- companyNo: ''
|
|
|
+ bidNo: "", // 竞价单反馈编号
|
|
|
+ good_num: "", // 商品数量
|
|
|
+ sale_price: "",
|
|
|
+ sendtype: "1", // 发货方式
|
|
|
+ arrtime: "", // 到货时间
|
|
|
+ remark: "", // 订单备注
|
|
|
+ platform_order: "", // 平台订单号
|
|
|
+ workNo: "", // 其他单号
|
|
|
+ companyNo: "",
|
|
|
+ manager: [],
|
|
|
},
|
|
|
+ manager_name: "",
|
|
|
rulesThis: this.rules,
|
|
|
rules: {
|
|
|
goodtype: [
|
|
|
{
|
|
|
required: true,
|
|
|
- trigger: 'change',
|
|
|
- message: '请选择商品类型'
|
|
|
- }
|
|
|
+ trigger: "change",
|
|
|
+ message: "请选择商品类型",
|
|
|
+ },
|
|
|
],
|
|
|
good_num: [
|
|
|
{
|
|
|
required: true,
|
|
|
validator: validate_num_0,
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
],
|
|
|
sale_price: [
|
|
|
{
|
|
|
required: true,
|
|
|
validator: validate_num_0,
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ manager: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择项目经理",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
],
|
|
|
companyNo: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: '请选择业务公司',
|
|
|
- trigger: 'change'
|
|
|
- }
|
|
|
+ message: "请选择业务公司",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
],
|
|
|
sendtype: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: '请选择发货方式',
|
|
|
- trigger: 'change'
|
|
|
- }
|
|
|
+ message: "请选择发货方式",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
],
|
|
|
remark: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: '输入订单备注',
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
+ message: "输入订单备注",
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
],
|
|
|
arrtime: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: '要求到货时间',
|
|
|
- trigger: 'change'
|
|
|
- }
|
|
|
+ message: "要求到货时间",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
],
|
|
|
proof_type: [
|
|
|
{
|
|
|
required: false,
|
|
|
- message: '请选择凭证类型',
|
|
|
- trigger: 'change'
|
|
|
- }
|
|
|
+ message: "请选择凭证类型",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
],
|
|
|
proof_url: [
|
|
|
{
|
|
|
required: false,
|
|
|
- message: '请上传凭证文件',
|
|
|
- trigger: 'blur,change'
|
|
|
- }
|
|
|
- ]
|
|
|
+ message: "请上传凭证文件",
|
|
|
+ trigger: "blur,change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
addrForm: {
|
|
|
- order_addr: [] // 收货地址
|
|
|
+ order_addr: [], // 收货地址
|
|
|
},
|
|
|
addrRules: {
|
|
|
receipt_quantity: [
|
|
|
{
|
|
|
required: true,
|
|
|
validator: validateWeight,
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
],
|
|
|
|
|
|
contactor: [
|
|
|
{
|
|
|
required: true,
|
|
|
- trigger: 'blur',
|
|
|
- validator: validatecontactor
|
|
|
- }
|
|
|
+ trigger: "blur",
|
|
|
+ validator: validatecontactor,
|
|
|
+ },
|
|
|
],
|
|
|
mobile: [
|
|
|
{
|
|
|
required: true,
|
|
|
validator: validatemobile,
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
],
|
|
|
|
|
|
addr_code: [
|
|
|
{
|
|
|
- type: 'array',
|
|
|
+ type: "array",
|
|
|
required: false,
|
|
|
- trigger: 'change'
|
|
|
- }
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
],
|
|
|
addr: [
|
|
|
{
|
|
|
required: true,
|
|
|
validator: validateAddr,
|
|
|
- trigger: 'blur'
|
|
|
- }
|
|
|
- ]
|
|
|
+ trigger: "blur",
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
|
|
|
- id: ''
|
|
|
- }
|
|
|
+ id: "",
|
|
|
+ };
|
|
|
},
|
|
|
watch: {
|
|
|
- showModel: function(val) {
|
|
|
- this.showModelThis = val
|
|
|
+ showModel: function (val) {
|
|
|
+ this.showModelThis = val;
|
|
|
if (val) {
|
|
|
// this.rulesThis = this.rules;
|
|
|
- this.initForm()
|
|
|
+ this.initForm();
|
|
|
}
|
|
|
},
|
|
|
showModelThis(val) {
|
|
|
if (!val) {
|
|
|
- this.$emit('cancel')
|
|
|
+ this.$emit("cancel");
|
|
|
}
|
|
|
},
|
|
|
- 'ruleForm.sale_price'(val) {
|
|
|
+ "ruleForm.sale_price"(val) {
|
|
|
// console.log(val)
|
|
|
- this.ruleForm.goodtype = Number(val) === 0 ? '2' : '1'
|
|
|
- }
|
|
|
+ this.ruleForm.goodtype = Number(val) === 0 ? "2" : "1";
|
|
|
+ },
|
|
|
},
|
|
|
created() {
|
|
|
// this.this.ruleForm.arrtime = this.sitem.in_arrival_time.substring(0, 10);
|
|
|
},
|
|
|
methods: {
|
|
|
+ managerChange(e) {
|
|
|
+ console.log(e);
|
|
|
+ const { id, label } = e;
|
|
|
+ this.ruleForm.manager = id ? [id] : [];
|
|
|
+ this.$refs.ruleForm.validateField("manager");
|
|
|
+ this.manager_name = label ?? "";
|
|
|
+ },
|
|
|
// 修改日期校验
|
|
|
mdDate() {
|
|
|
// 用户传递的到货时间不能大于要求到货的时间 对要求到货时间进行字符截取10位抹除时分秒
|
|
@@ -865,129 +895,132 @@ export default {
|
|
|
Date.parse(this.ruleForm.arrtime) <
|
|
|
Date.parse(this.sitem.in_arrival_time.substring(0, 10))
|
|
|
) {
|
|
|
- this.$message.warning('到货时间不能小于要求到货日期')
|
|
|
- this.ruleForm.arrtime = ''
|
|
|
+ this.$message.warning("到货时间不能小于要求到货日期");
|
|
|
+ this.ruleForm.arrtime = "";
|
|
|
}
|
|
|
},
|
|
|
|
|
|
// 销售方公司选择
|
|
|
company_idsearchChange(e) {
|
|
|
- const { code } = e
|
|
|
- this.ruleForm.companyNo = code || ''
|
|
|
- this.$refs.ruleForm.validateField('companyNo')
|
|
|
+ const { code } = e;
|
|
|
+ this.ruleForm.companyNo = code || "";
|
|
|
+ this.$refs.ruleForm.validateField("companyNo");
|
|
|
},
|
|
|
|
|
|
closeModel() {
|
|
|
- console.log('closeModel!!')
|
|
|
- this.showModelThis = false
|
|
|
+ console.log("closeModel!!");
|
|
|
+ this.showModelThis = false;
|
|
|
},
|
|
|
num_change(e, key) {
|
|
|
- this.ruleForm[key] = e + ''
|
|
|
- this.$refs.ruleForm.validateField(key)
|
|
|
- this.set_total_price()
|
|
|
+ this.ruleForm[key] = e + "";
|
|
|
+ this.$refs.ruleForm.validateField(key);
|
|
|
+ this.set_total_price();
|
|
|
},
|
|
|
set_total_price() {
|
|
|
- const { good_num, sale_price } = this.ruleForm
|
|
|
- const num = good_num * 1
|
|
|
- const price = sale_price * 1
|
|
|
- this.total_price = num * price + ''
|
|
|
+ const { good_num, sale_price } = this.ruleForm;
|
|
|
+ const num = good_num * 1;
|
|
|
+ const price = sale_price * 1;
|
|
|
+ this.total_price = num * price + "";
|
|
|
},
|
|
|
async initForm() {
|
|
|
- this.loading = true
|
|
|
- this.rulesThis = this.rules
|
|
|
- const { can } = this.sitem
|
|
|
- this.sitem.can_name = ''
|
|
|
- this.sitem.is_noble = false
|
|
|
+ this.loading = true;
|
|
|
+ this.rulesThis = this.rules;
|
|
|
+ const { can } = this.sitem;
|
|
|
+ this.sitem.can_name = "";
|
|
|
+ this.sitem.is_noble = false;
|
|
|
if (can && can.length > 0) {
|
|
|
can.forEach((a, ai) => {
|
|
|
- this.sitem.is_noble = a.id + '' === '6'
|
|
|
- this.sitem.can_name += `${ai !== 0 ? '_' : ''}${a.name}`
|
|
|
- })
|
|
|
+ this.sitem.is_noble = a.id + "" === "6";
|
|
|
+ this.sitem.can_name += `${ai !== 0 ? "_" : ""}${a.name}`;
|
|
|
+ });
|
|
|
}
|
|
|
- await this.resetForm()
|
|
|
- this.getNewTime()
|
|
|
- this.set_total_price()
|
|
|
- this.loading = false
|
|
|
+ await this.resetForm();
|
|
|
+ this.getNewTime();
|
|
|
+ this.set_total_price();
|
|
|
+ this.loading = false;
|
|
|
},
|
|
|
addrRefresh(e) {
|
|
|
- const list = JSON.parse(JSON.stringify(e.list))
|
|
|
- list.forEach(item => {
|
|
|
- item.label = [item.label]
|
|
|
- item.code = [item.areaCode]
|
|
|
- })
|
|
|
- this.addrForm.order_addr.push(...list)
|
|
|
+ const list = JSON.parse(JSON.stringify(e.list));
|
|
|
+ list.forEach((item) => {
|
|
|
+ item.label = [item.label];
|
|
|
+ item.code = [item.areaCode];
|
|
|
+ });
|
|
|
+ this.addrForm.order_addr.push(...list);
|
|
|
},
|
|
|
|
|
|
getNewTime() {
|
|
|
- this.newTime = new Date().valueOf()
|
|
|
+ this.newTime = new Date().valueOf();
|
|
|
},
|
|
|
async resetForm() {
|
|
|
// 重置
|
|
|
await this.$nextTick(() => {
|
|
|
if (this.$refs.ruleForm) {
|
|
|
- this.$refs.ruleForm.resetFields()
|
|
|
- this.$refs.ruleForm.clearValidate()
|
|
|
+ this.$refs.ruleForm.resetFields();
|
|
|
+ this.$refs.ruleForm.clearValidate();
|
|
|
const {
|
|
|
bidNo,
|
|
|
in_num,
|
|
|
in_arrival_time,
|
|
|
sale_price,
|
|
|
remark,
|
|
|
- in_companyNo
|
|
|
- } = this.sitem
|
|
|
- console.log(this.sitem)
|
|
|
+ in_companyNo,
|
|
|
+ } = this.sitem;
|
|
|
+ console.log(this.sitem);
|
|
|
this.ruleForm = {
|
|
|
- bidNo: bidNo || '', // 竞价单反馈编号
|
|
|
- good_num: in_num || '0', // 商品数量
|
|
|
- sale_price: sale_price || '',
|
|
|
- sendtype: '1', // 发货方式
|
|
|
- arrtime: in_arrival_time || '', // 到货时间
|
|
|
- remark: '',
|
|
|
- proof_type: '1', // 通过or驳回
|
|
|
- proof_url: '', // 驳回至
|
|
|
- companyNo: in_companyNo || '',
|
|
|
- goodtype: Number(sale_price) === 0 ? '2' : '1'
|
|
|
- }
|
|
|
+ bidNo: bidNo || "", // 竞价单反馈编号
|
|
|
+ good_num: in_num || "0", // 商品数量
|
|
|
+ sale_price: sale_price || "",
|
|
|
+ sendtype: "1", // 发货方式
|
|
|
+ arrtime: in_arrival_time || "", // 到货时间
|
|
|
+ remark: "",
|
|
|
+ proof_type: "1", // 通过or驳回
|
|
|
+ proof_url: "", // 驳回至
|
|
|
+ companyNo: in_companyNo || "",
|
|
|
+ goodtype: Number(sale_price) === 0 ? "2" : "1",
|
|
|
+ manager: [],
|
|
|
+ };
|
|
|
}
|
|
|
|
|
|
if (this.$refs.addrForm) {
|
|
|
- this.$refs.addrForm.resetFields()
|
|
|
- this.$refs.addrForm.clearValidate()
|
|
|
+ this.$refs.addrForm.resetFields();
|
|
|
+ this.$refs.addrForm.clearValidate();
|
|
|
this.addrForm = {
|
|
|
- order_addr: []
|
|
|
- }
|
|
|
+ order_addr: [],
|
|
|
+ };
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
openHouseModal(index) {
|
|
|
- const findex = this.addrForm.order_addr.findIndex((v) => v.edit === true)
|
|
|
+ const findex = this.addrForm.order_addr.findIndex((v) => v.edit === true);
|
|
|
if (findex !== -1) {
|
|
|
- this.$message.warning('当前已有地址在编辑,请保存后再试!')
|
|
|
- return
|
|
|
+ this.$message.warning("当前已有地址在编辑,请保存后再试!");
|
|
|
+ return;
|
|
|
} else {
|
|
|
if (index === -1) {
|
|
|
this.addrForm.order_addr.push({
|
|
|
edit: true,
|
|
|
- receipt_quantity: '',
|
|
|
- contactor: '',
|
|
|
- mobile: '',
|
|
|
+ receipt_quantity: "",
|
|
|
+ contactor: "",
|
|
|
+ mobile: "",
|
|
|
addr_code: [],
|
|
|
- addr: '',
|
|
|
+ addr: "",
|
|
|
code: [],
|
|
|
- label: []
|
|
|
- })
|
|
|
+ label: [],
|
|
|
+ });
|
|
|
} else {
|
|
|
- this.addrForm.order_addr[index].edit = true
|
|
|
+ this.addrForm.order_addr[index].edit = true;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
async areaChange(e, index) {
|
|
|
- const { code, area_code, label, splitLabel } = e
|
|
|
+ const { code, area_code, label, splitLabel } = e;
|
|
|
// this.addrForm.order_addr[index] = e
|
|
|
- this.addrForm.order_addr[index].addr_code_name = splitLabel ? splitLabel.split(',').join('/') : ''
|
|
|
- this.addrForm.order_addr[index].addr_code = code ? code.split(',') : []
|
|
|
- this.addrForm.order_addr[index].code = area_code ? [area_code] : []
|
|
|
- this.addrForm.order_addr[index].label = label ? [label] : []
|
|
|
+ this.addrForm.order_addr[index].addr_code_name = splitLabel
|
|
|
+ ? splitLabel.split(",").join("/")
|
|
|
+ : "";
|
|
|
+ this.addrForm.order_addr[index].addr_code = code ? code.split(",") : [];
|
|
|
+ this.addrForm.order_addr[index].code = area_code ? [area_code] : [];
|
|
|
+ this.addrForm.order_addr[index].label = label ? [label] : [];
|
|
|
// this.$refs.ruleForm.validateField('addr_code')
|
|
|
},
|
|
|
// 省市区选择
|
|
@@ -1022,253 +1055,254 @@ export default {
|
|
|
checkRow(rowIndex) {
|
|
|
this.$refs.addrForm.validate((valid) => {
|
|
|
if (valid) {
|
|
|
- this.addrForm.order_addr[rowIndex].edit = false
|
|
|
+ this.addrForm.order_addr[rowIndex].edit = false;
|
|
|
} else {
|
|
|
- console.log('error submit!!')
|
|
|
- return false
|
|
|
+ console.log("error submit!!");
|
|
|
+ return false;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
// 省市区删除行操作
|
|
|
deleteRow(index, rows) {
|
|
|
- rows.splice(index, 1)
|
|
|
+ rows.splice(index, 1);
|
|
|
},
|
|
|
async submitForm() {
|
|
|
- await this.$refs.ruleForm.validate(async(valid) => {
|
|
|
+ await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
- if (this.loading) return
|
|
|
- this.loading = true
|
|
|
- const model = JSON.parse(JSON.stringify(this.ruleForm))
|
|
|
+ if (this.loading) return;
|
|
|
+ this.loading = true;
|
|
|
+ const model = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
|
|
|
- model.order_addr = []
|
|
|
- const { sendtype, good_num } = model
|
|
|
- const { order_addr } = JSON.parse(JSON.stringify(this.addrForm))
|
|
|
- if (sendtype + '' === '1' && order_addr && order_addr.length === 0) {
|
|
|
- this.$message.warning('至少上传一个地址信息!')
|
|
|
- this.loading = false
|
|
|
- return
|
|
|
+ model.order_addr = [];
|
|
|
+ const { sendtype, good_num,manager } = model;
|
|
|
+ const { order_addr } = JSON.parse(JSON.stringify(this.addrForm));
|
|
|
+ if (sendtype + "" === "1" && order_addr && order_addr.length === 0) {
|
|
|
+ this.$message.warning("至少上传一个地址信息!");
|
|
|
+ this.loading = false;
|
|
|
+ return;
|
|
|
}
|
|
|
- if (sendtype + '' === '1') {
|
|
|
- let addrT = 0
|
|
|
- let isAEdit = false
|
|
|
+ if (sendtype + "" === "1") {
|
|
|
+ let addrT = 0;
|
|
|
+ let isAEdit = false;
|
|
|
order_addr.forEach((v2) => {
|
|
|
if (v2.edit) {
|
|
|
- isAEdit = true
|
|
|
+ isAEdit = true;
|
|
|
}
|
|
|
- addrT += parseInt(v2.receipt_quantity + '')
|
|
|
+ addrT += parseInt(v2.receipt_quantity + "");
|
|
|
const model2 = {
|
|
|
addr_code: v2.addr_code.toString(),
|
|
|
contactor: v2.contactor,
|
|
|
mobile: v2.mobile,
|
|
|
addr: v2.addr,
|
|
|
- receipt_quantity: v2.receipt_quantity
|
|
|
- }
|
|
|
- model.order_addr.push(model2)
|
|
|
- })
|
|
|
+ receipt_quantity: v2.receipt_quantity,
|
|
|
+ };
|
|
|
+ model.order_addr.push(model2);
|
|
|
+ });
|
|
|
|
|
|
if (isAEdit) {
|
|
|
- this.$message.warning('请保存地址信息!')
|
|
|
- this.loading = false
|
|
|
- return
|
|
|
+ this.$message.warning("请保存地址信息!");
|
|
|
+ this.loading = false;
|
|
|
+ return;
|
|
|
}
|
|
|
- if (parseInt(good_num + '') !== addrT) {
|
|
|
- this.$message.warning('收货总数量与购买不一致!')
|
|
|
- this.loading = false
|
|
|
- return
|
|
|
+ if (parseInt(good_num + "") !== addrT) {
|
|
|
+ this.$message.warning("收货总数量与购买不一致!");
|
|
|
+ this.loading = false;
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 去除上送字段空格&换行
|
|
|
- Object.keys(model).forEach(key => {
|
|
|
- if (typeof model[key] === 'string' && key !== 'arrtime') {
|
|
|
- model[key] = replaceTextWrapAndSpace(model[key])
|
|
|
+ Object.keys(model).forEach((key) => {
|
|
|
+ if (typeof model[key] === "string" && key !== "arrtime") {
|
|
|
+ model[key] = replaceTextWrapAndSpace(model[key]);
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
+ model.manager = manager.toString();
|
|
|
|
|
|
- const res = await asyncRequest.consultorder(model)
|
|
|
+ const res = await asyncRequest.consultorder(model);
|
|
|
|
|
|
if (res && res.code === 0) {
|
|
|
this.$notify.success({
|
|
|
- title: '下单成功!',
|
|
|
- message: ''
|
|
|
- })
|
|
|
- this.showModelThis = false
|
|
|
+ title: "下单成功!",
|
|
|
+ message: "",
|
|
|
+ });
|
|
|
+ this.showModelThis = false;
|
|
|
// 刷新
|
|
|
- this.$emit('refresh')
|
|
|
- this.loading = false
|
|
|
+ this.$emit("refresh");
|
|
|
+ this.loading = false;
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- this.loading = false
|
|
|
- await this.logout()
|
|
|
+ this.loading = false;
|
|
|
+ await this.logout();
|
|
|
} else {
|
|
|
- this.loading = false
|
|
|
- this.$message.warning(res.message)
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.warning(res.message);
|
|
|
}
|
|
|
} else {
|
|
|
- console.log('error submit!!')
|
|
|
- return false
|
|
|
+ console.log("error submit!!");
|
|
|
+ return false;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
// 图片上传成功
|
|
|
async UploadSuccessEventproof_url(data) {
|
|
|
- const { url } = data
|
|
|
- if (url === 'noToken') {
|
|
|
- await this.logout()
|
|
|
+ const { url } = data;
|
|
|
+ if (url === "noToken") {
|
|
|
+ await this.logout();
|
|
|
} else {
|
|
|
- this.img_url = url
|
|
|
- this.set_proof_url()
|
|
|
- this.$message.success('图片上传成功!')
|
|
|
+ this.img_url = url;
|
|
|
+ this.set_proof_url();
|
|
|
+ this.$message.success("图片上传成功!");
|
|
|
}
|
|
|
},
|
|
|
|
|
|
// 图片上传失败
|
|
|
UploadErrorEventproof_url(res) {
|
|
|
- if (res !== 'break') {
|
|
|
- this.set_proof_url()
|
|
|
- this.$message.error('图片上传失败!')
|
|
|
+ if (res !== "break") {
|
|
|
+ this.set_proof_url();
|
|
|
+ this.$message.error("图片上传失败!");
|
|
|
}
|
|
|
},
|
|
|
|
|
|
// 判断图片规格
|
|
|
beforeAvatarUpload(file) {
|
|
|
- let isJPG = false
|
|
|
+ let isJPG = false;
|
|
|
if (
|
|
|
- file.type === 'image/jpg' ||
|
|
|
- file.type === 'image/png' ||
|
|
|
- file.type === 'image/jpeg'
|
|
|
+ file.type === "image/jpg" ||
|
|
|
+ file.type === "image/png" ||
|
|
|
+ file.type === "image/jpeg"
|
|
|
) {
|
|
|
- isJPG = true
|
|
|
+ isJPG = true;
|
|
|
}
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 1
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 1;
|
|
|
if (!isJPG) {
|
|
|
- this.$message.error('图片格式不正确!')
|
|
|
+ this.$message.error("图片格式不正确!");
|
|
|
}
|
|
|
if (!isLt2M) {
|
|
|
- this.$message.error('图片大小不能超过 1MB!')
|
|
|
+ this.$message.error("图片大小不能超过 1MB!");
|
|
|
}
|
|
|
- return isJPG && isLt2M
|
|
|
+ return isJPG && isLt2M;
|
|
|
},
|
|
|
|
|
|
// 视频上传成功
|
|
|
async UploadSuccessVideoproof_url(data) {
|
|
|
- const { url } = data
|
|
|
- if (url === 'noToken') {
|
|
|
- await this.logout()
|
|
|
+ const { url } = data;
|
|
|
+ if (url === "noToken") {
|
|
|
+ await this.logout();
|
|
|
} else {
|
|
|
- this.video_url = url
|
|
|
- this.set_proof_url()
|
|
|
- this.$message.success('视频上传成功!')
|
|
|
+ this.video_url = url;
|
|
|
+ this.set_proof_url();
|
|
|
+ this.$message.success("视频上传成功!");
|
|
|
}
|
|
|
},
|
|
|
|
|
|
// 视频上传失败
|
|
|
UploadErrorVideoproof_url(res) {
|
|
|
- if (res !== 'break') {
|
|
|
- this.set_proof_url()
|
|
|
- this.$message.error('视频上传失败!')
|
|
|
+ if (res !== "break") {
|
|
|
+ this.set_proof_url();
|
|
|
+ this.$message.error("视频上传失败!");
|
|
|
}
|
|
|
},
|
|
|
|
|
|
// 判断视频规格
|
|
|
beforeVideoUpload(file) {
|
|
|
- let isJPG = false
|
|
|
- if (file.type === 'video/mp4' || file.type === 'video/avi') {
|
|
|
- isJPG = true
|
|
|
+ let isJPG = false;
|
|
|
+ if (file.type === "video/mp4" || file.type === "video/avi") {
|
|
|
+ isJPG = true;
|
|
|
}
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 10
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 10;
|
|
|
if (!isJPG) {
|
|
|
- this.$message.error('视频格式不正确!')
|
|
|
+ this.$message.error("视频格式不正确!");
|
|
|
}
|
|
|
if (!isLt2M) {
|
|
|
- this.$message.error('视频大小不能超过 10MB!')
|
|
|
+ this.$message.error("视频大小不能超过 10MB!");
|
|
|
}
|
|
|
- return isJPG && isLt2M
|
|
|
+ return isJPG && isLt2M;
|
|
|
},
|
|
|
|
|
|
// 其他文件上传成功
|
|
|
async UploadSuccessOtherproof_url(data) {
|
|
|
- const { url } = data
|
|
|
- if (url === 'noToken') {
|
|
|
- await this.logout()
|
|
|
+ const { url } = data;
|
|
|
+ if (url === "noToken") {
|
|
|
+ await this.logout();
|
|
|
} else {
|
|
|
- this.other_url = url
|
|
|
- this.set_proof_url()
|
|
|
- this.$message.success('文件成功!')
|
|
|
+ this.other_url = url;
|
|
|
+ this.set_proof_url();
|
|
|
+ this.$message.success("文件成功!");
|
|
|
}
|
|
|
},
|
|
|
|
|
|
// 其他文件上传失败
|
|
|
UploadErrorOtherproof_url(res) {
|
|
|
- if (res !== 'break') {
|
|
|
- this.set_proof_url()
|
|
|
- this.$message.error('文件上传失败!')
|
|
|
+ if (res !== "break") {
|
|
|
+ this.set_proof_url();
|
|
|
+ this.$message.error("文件上传失败!");
|
|
|
}
|
|
|
},
|
|
|
|
|
|
// 判断其他文件规格
|
|
|
beforeOtherUpload(file) {
|
|
|
- console.log(file)
|
|
|
- let isJPG = false
|
|
|
+ console.log(file);
|
|
|
+ let isJPG = false;
|
|
|
if (
|
|
|
- file.type === 'application/vnd.ms-excel' ||
|
|
|
+ file.type === "application/vnd.ms-excel" ||
|
|
|
file.type ===
|
|
|
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' ||
|
|
|
- file.type === 'application/pdf' ||
|
|
|
- file.type === 'application/x-zip-compressed'
|
|
|
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ||
|
|
|
+ file.type === "application/pdf" ||
|
|
|
+ file.type === "application/x-zip-compressed"
|
|
|
) {
|
|
|
- isJPG = true
|
|
|
+ isJPG = true;
|
|
|
}
|
|
|
- const name = file.name
|
|
|
- const list = name.split('.')
|
|
|
- if (list[list.length - 1] === 'rar' || list[list.length - 1] === '7z') {
|
|
|
- isJPG = true
|
|
|
+ const name = file.name;
|
|
|
+ const list = name.split(".");
|
|
|
+ if (list[list.length - 1] === "rar" || list[list.length - 1] === "7z") {
|
|
|
+ isJPG = true;
|
|
|
}
|
|
|
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 5
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 5;
|
|
|
if (!isJPG) {
|
|
|
- this.$message.error('文件格式不正确!')
|
|
|
+ this.$message.error("文件格式不正确!");
|
|
|
}
|
|
|
if (!isLt2M) {
|
|
|
- this.$message.error('文件大小不能超过 5MB!')
|
|
|
+ this.$message.error("文件大小不能超过 5MB!");
|
|
|
}
|
|
|
- return isJPG && isLt2M
|
|
|
+ return isJPG && isLt2M;
|
|
|
},
|
|
|
|
|
|
deleteUrl(type) {
|
|
|
switch (type) {
|
|
|
- case '1':
|
|
|
- this.video_url = ''
|
|
|
- break
|
|
|
- case '2':
|
|
|
- this.img_url = ''
|
|
|
- break
|
|
|
- case '3':
|
|
|
- this.other_url = ''
|
|
|
- break
|
|
|
+ case "1":
|
|
|
+ this.video_url = "";
|
|
|
+ break;
|
|
|
+ case "2":
|
|
|
+ this.img_url = "";
|
|
|
+ break;
|
|
|
+ case "3":
|
|
|
+ this.other_url = "";
|
|
|
+ break;
|
|
|
default:
|
|
|
- this.video_url = ''
|
|
|
+ this.video_url = "";
|
|
|
}
|
|
|
- this.set_proof_url()
|
|
|
+ this.set_proof_url();
|
|
|
},
|
|
|
set_proof_url() {
|
|
|
- const { proof_type } = this.ruleForm
|
|
|
+ const { proof_type } = this.ruleForm;
|
|
|
switch (proof_type) {
|
|
|
- case '1':
|
|
|
- this.ruleForm.proof_url = this.video_url
|
|
|
- break
|
|
|
- case '2':
|
|
|
- this.ruleForm.proof_url = this.img_url
|
|
|
- break
|
|
|
- case '3':
|
|
|
- this.ruleForm.proof_url = this.other_url
|
|
|
- break
|
|
|
+ case "1":
|
|
|
+ this.ruleForm.proof_url = this.video_url;
|
|
|
+ break;
|
|
|
+ case "2":
|
|
|
+ this.ruleForm.proof_url = this.img_url;
|
|
|
+ break;
|
|
|
+ case "3":
|
|
|
+ this.ruleForm.proof_url = this.other_url;
|
|
|
+ break;
|
|
|
default:
|
|
|
- this.ruleForm.proof_url = this.video_url
|
|
|
+ this.ruleForm.proof_url = this.video_url;
|
|
|
}
|
|
|
- this.$refs.ruleForm.validateField('proof_url')
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+ this.$refs.ruleForm.validateField("proof_url");
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|