1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345 |
- <template>
- <div class="orderConfirm pagePadding">
- <div
- style="width: 100%"
- v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
- >
- <show-data-table
- style="margin: 0 0 10px 0; padding: 0"
- :sitem="sitem"
- v-if="sitem && status"
- :columns="showColumns"
- border
- >
- <template #status>
- <el-tag
- :size="'mini'"
- :type="sitem.status_type"
- style="margin: auto"
- >{{ sitem.status_name }}</el-tag
- >
- </template>
- <template #error_msg>
- <span :style="{ color: sitem.error_msg ? 'red' : '' }">{{
- sitem.error_msg ? sitem.error_msg : "--"
- }}</span>
- </template>
- </show-data-table>
- <el-form
- ref="ruleForm"
- :model="ruleForm"
- status-icon
- :size="'mini'"
- :rules="rulesThis"
- label-width="0px"
- >
- <div class="tab-row">
- <div class="tab-item-label">
- <label style="color: transparent">*</label>字段
- </div>
- <div class="tab-item-main">
- <el-row class="tab-title">
- <el-col :span="4">文件导入数据</el-col>
- <el-col :span="9">系统解析数据</el-col>
- <el-col :span="11">确认后的数据</el-col>
- </el-row>
- </div>
- </div>
- <div
- v-if="
- importSitem &&
- importSitem.platform_code &&
- confirmSitem &&
- confirmSitem.platform_code
- "
- >
- <div class="tab-row">
- <div class="tab-item-label">
- <div><label style="color: red">*</label>平台订单号</div>
- <div><label style="color: transparent">*</label>其他单号</div>
- </div>
- <div class="tab-item-main">
- <el-row class="tab-title">
- <el-col :span="4">
- <div style="min-height: 26px">
- {{ importSitem.platform_code }}
- </div>
- <div style="min-height: 26px">{{ importSitem.po_code }}</div>
- </el-col>
- <el-col :span="9">
- <div style="min-height: 26px">
- {{ confirmSitem.platform_code }}
- </div>
- <div style="min-height: 26px">{{ confirmSitem.po_code }}</div>
- </el-col>
- <el-col :span="11" class="nop">
- <el-row>
- <el-col :span="12" class="border">
- <el-form-item prop="platform_code">
- <el-input
- v-model="ruleForm.platform_code"
- maxlength="100"
- :disabled="
- !(
- status === '2' &&
- powers.some((item) => item == '008')
- )
- "
- placeholder="平台订单号"
- /> </el-form-item
- ></el-col>
- <el-col :span="12" class="border">
- <el-form-item prop="po_code">
- <el-input
- v-model="ruleForm.po_code"
- maxlength="100"
- :disabled="
- !(
- status === '2' &&
- powers.some((item) => item == '008')
- )
- "
- placeholder="其他单号"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-col>
- </el-row>
- </div>
- </div>
- <div class="tab-row">
- <div class="tab-item-label">
- <div><label style="color: red">*</label>平台订单下单时间</div>
- <div><label style="color: red">*</label>平台商品编号</div>
- </div>
- <div class="tab-item-main">
- <el-row class="tab-title">
- <el-col :span="4">
- <div style="min-height: 26px">
- {{ importSitem.platform_time }}
- </div>
- <div style="min-height: 26px">
- {{ importSitem.plat_code }}
- </div>
- </el-col>
- <el-col :span="9"
- ><div style="min-height: 26px">
- {{ confirmSitem.platform_time }}
- </div>
- <div style="min-height: 26px">
- {{ confirmSitem.plat_code }}
- </div>
- <div v-if="conGoodData && conGoodData.good_thumb_img">
- <show-data-table
- :sitem="conGoodData"
- :columns="onlineColumns"
- :border="true"
- >
- <template slot="good_name">
- <img
- v-viewer
- style="width: 23px; height: 23px; margin: 0 5px 0 0"
- class="fl hover"
- v-if="conGoodData.good_thumb_img"
- :src="conGoodData.good_thumb_img"
- alt=""
- />
- <span>{{ conGoodData.good_name }}</span>
- <span
- v-for="(si, i) in conGoodData.speclist"
- :key="si.spec_id + i"
- >
- <span v-if="i !== 0">-</span>
- <span v-else>_</span>
- <span>{{ si.spec_name }}[{{ si.spec_value }}]</span>
- </span>
- <el-popover placement="top" width="300" trigger="hover">
- <ul>
- <li>
- <span>上线商品编号:</span
- ><span>{{ conGoodData.skuCode }}</span>
- </li>
- <li
- v-if="
- newTime !== '' &&
- private_field &&
- private_field.length > 0 &&
- private_field.some((item) => item == '1')
- "
- >
- <span>商品成本编号:</span
- ><span>{{ conGoodData.spuCode }}</span>
- </li>
- <!-- <li>
- <span>平台商品编码:</span
- ><span>{{ conGoodData.platform_code_en }}</span>
- </li> -->
- </ul>
- <i
- class="el-icon-warning-outline fr"
- slot="reference"
- ></i>
- </el-popover>
- </template>
- <template slot="company">
- <span>{{ conGoodData.company }}</span>
- <el-popover placement="top" width="300" trigger="hover">
- <ul>
- <li>
- <span>业务企业编号:</span
- ><span>{{ conGoodData.companyNo }}</span>
- </li>
- </ul>
- <i
- class="el-icon-warning-outline fr"
- slot="reference"
- ></i>
- </el-popover>
- </template>
- <template slot="cat_info">
- <span
- v-for="(si, sii) in conGoodData.cat_info"
- :key="si + sii"
- >{{ sii === 0 ? "" : "_" }}{{ si.name }}</span
- >
- </template>
- <template slot="exclusive">
- <span
- v-for="(si, sii) in conGoodData.exclusive"
- :key="si.id"
- >
- <span v-if="sii !== 0">/</span>
- <span>{{ si.name }}</span>
- </span>
- </template>
- <template slot="is_stock">
- <el-tag
- :size="'mini'"
- v-text="
- (
- options4.find(
- (item) => item.id == conGoodData.is_stock
- ) || {}
- ).name || '--'
- "
- />
- </template>
- </show-data-table>
- </div>
- </el-col>
- <el-col :span="11" class="nop">
- <el-row>
- <el-col :span="12" class="border">
- <el-form-item prop="platform_time">
- <el-date-picker
- type="datetime"
- placeholder="平台订单下单时间"
- v-model="ruleForm.platform_time"
- style="width: 100%"
- value-format="yyyy-MM-dd HH:mm:ss"
- :disabled="
- !(
- status === '2' &&
- powers.some((item) => item == '008')
- )
- "
- :picker-options="pickerOptions"
- @change="selectTime"
- >
- </el-date-picker> </el-form-item
- ></el-col>
- <el-col :span="12" class="border">
- <el-form-item prop="plat_code">
- <el-input
- v-model="ruleForm.plat_code"
- maxlength="100"
- readonly
- :disabled="
- !(
- status === '2' &&
- powers.some((item) => item == '008')
- )
- "
- @focus="showModel = true"
- placeholder="平台商品编号"
- /></el-form-item>
- </el-col>
- <el-col
- :span="24"
- v-if="subGoodData && subGoodData.good_thumb_img"
- >
- <show-data-table
- :sitem="subGoodData"
- :columns="onlineColumns"
- :border="true"
- >
- <template slot="good_name">
- <img
- v-viewer
- style="width: 23px; height: 23px; margin: 0 5px 0 0"
- class="fl"
- v-if="subGoodData.good_thumb_img"
- :src="subGoodData.good_thumb_img"
- alt=""
- />
- <span>{{ subGoodData.good_name }}</span>
- <span
- v-for="(si, i) in subGoodData.speclist"
- :key="si.spec_id + i"
- >
- <span v-if="i !== 0">-</span>
- <span v-else>_</span>
- <span>{{ si.spec_name }}[{{ si.spec_value }}]</span>
- </span>
- <el-popover
- placement="top"
- width="300"
- trigger="hover"
- >
- <ul>
- <li>
- <span>上线商品编号:</span
- ><span>{{ subGoodData.skuCode }}</span>
- </li>
- <li
- v-if="
- newTime !== '' &&
- private_field &&
- private_field.length > 0 &&
- private_field.some((item) => item == '1')
- "
- >
- <span>商品成本编号:</span
- ><span>{{ subGoodData.spuCode }}</span>
- </li>
- <!-- <li>
- <span>平台商品编码:</span
- ><span>{{ subGoodData.platform_code_en }}</span>
- </li> -->
- </ul>
- <i
- class="el-icon-warning-outline fr"
- slot="reference"
- ></i>
- </el-popover>
- </template>
- <template slot="company">
- <span>{{ subGoodData.company }}</span>
- <el-popover
- placement="top"
- width="300"
- trigger="hover"
- >
- <ul>
- <li>
- <span>业务企业编号:</span
- ><span>{{ subGoodData.companyNo }}</span>
- </li>
- </ul>
- <i
- class="el-icon-warning-outline fr"
- slot="reference"
- ></i>
- </el-popover>
- </template>
- <template slot="cat_info">
- <span
- v-for="(si, sii) in subGoodData.cat_info"
- :key="si + sii"
- >{{ sii === 0 ? "" : "_" }}{{ si.name }}</span
- >
- </template>
- <template slot="exclusive">
- <span
- v-for="(si, sii) in subGoodData.exclusive"
- :key="si.id"
- >
- <span v-if="sii !== 0">/</span>
- <span>{{ si.name }}</span>
- </span>
- </template>
- <template slot="is_stock">
- <el-tag
- :size="'mini'"
- v-text="
- (
- options4.find(
- (item) => item.id == subGoodData.is_stock
- ) || {}
- ).name || '--'
- "
- />
- </template>
- </show-data-table>
- </el-col>
- </el-row>
- </el-col>
- </el-row>
- </div>
- </div>
- <div class="tab-row">
- <div class="tab-item-label">
- <div><label style="color: red">*</label>收费模式</div>
- <div><label style="color: red">*</label>销售渠道</div>
- </div>
- <div class="tab-item-main">
- <el-row class="tab-title">
- <el-col :span="4">
- <div style="min-height: 26px">{{ importSitem.mode }}</div>
- <div style="min-height: 26px">
- {{ importSitem.sale_source }}
- </div>
- </el-col>
- <el-col :span="9">
- <div style="min-height: 26px">{{ confirmSitem.mode }}</div>
- <div style="min-height: 26px">
- {{ confirmSitem.sale_source }}
- </div></el-col
- >
- <el-col :span="11" class="nop">
- <el-row>
- <el-col :span="12" class="border">
- <el-form-item prop="mode">
- <el-select
- v-model="ruleForm.mode"
- style="width: 100%"
- clearable
- :disabled="
- !(
- status === '2' &&
- powers.some((item) => item == '008')
- )
- "
- placeholder="收费模式"
- >
- <el-option
- v-for="item in options"
- :key="item.label"
- :label="item.label"
- :value="item.label"
- >
- </el-option> </el-select
- ></el-form-item>
- </el-col>
- <el-col :span="12" class="border">
- <el-form-item prop="sale_source">
- <el-select
- v-model="ruleForm.sale_source"
- style="width: 100%"
- clearable
- :disabled="
- !(
- status === '2' &&
- powers.some((item) => item == '008')
- )
- "
- placeholder="销售渠道"
- >
- <el-option
- v-for="(item, i) in coptions"
- :key="item.source + i"
- :label="item.source"
- :value="item.source"
- >
- </el-option> </el-select></el-form-item></el-col
- ></el-row>
- </el-col>
- </el-row>
- </div>
- </div>
- <div class="tab-row">
- <div class="tab-item-label">
- <div><label style="color: red">*</label>收货人</div>
- <div><label style="color: red">*</label>收货电话</div>
- </div>
- <div class="tab-item-main">
- <el-row class="tab-title">
- <el-col :span="4">
- <div style="min-height: 26px">
- {{ importSitem.contactor }}
- </div>
- <div style="min-height: 26px">
- {{ importSitem.mobile }}
- </div>
- </el-col>
- <el-col :span="9">
- <div style="min-height: 26px">
- {{ confirmSitem.contactor }}
- </div>
- <div style="min-height: 26px">
- {{ confirmSitem.mobile }}
- </div></el-col
- >
- <el-col :span="11" class="nop">
- <el-row>
- <el-col :span="12" class="border">
- <el-form-item prop="contactor">
- <el-input
- v-model="ruleForm.contactor"
- maxlength="100"
- :disabled="
- !(
- status === '2' &&
- powers.some((item) => item == '008')
- )
- "
- placeholder="收货人"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12" class="border">
- <el-form-item prop="mobile">
- <el-input
- v-model="ruleForm.mobile"
- maxlength="100"
- :disabled="
- !(
- status === '2' &&
- powers.some((item) => item == '008')
- )
- "
- placeholder="收货电话"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-col>
- </el-row>
- </div>
- </div>
- <div class="tab-row">
- <div class="tab-item-label">
- <div><label style="color: red">*</label>省市区</div>
- <div><label style="color: red">*</label>详细地址</div>
- </div>
- <div class="tab-item-main">
- <el-row class="tab-title">
- <el-col :span="4">
- <div style="min-height: 26px"> </div>
- <div style="min-height: 26px">
- {{ importSitem.addr }}
- </div></el-col
- >
- <el-col :span="9">
- <div style="min-height: 26px">
- {{ confirmSitem.addr_name }}
- </div>
- <div style="min-height: 26px">{{ confirmSitem.addr }}</div>
- </el-col>
- <el-col :span="11" class="nop">
- <el-row>
- <el-col :span="12" class="border">
- <el-form-item prop="addr_code">
- <select-area
- :value="ruleForm.addr_code"
- :size="'mini'"
- :disabled="
- !(
- status === '2' &&
- powers.some((item) => item == '008')
- )
- "
- placeholder="收货省市区"
- @selectChange="select_area_change($event)"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12" class="border">
- <el-form-item prop="addr">
- <el-input
- v-model="ruleForm.addr"
- maxlength="100"
- :disabled="
- !(
- status === '2' &&
- powers.some((item) => item == '008')
- )
- "
- placeholder="详细地址"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-col>
- </el-row>
- </div>
- </div>
- <div class="tab-row">
- <div class="tab-item-label">
- <label style="color: red">*</label>订单备注
- </div>
- <div class="tab-item-main">
- <el-row class="tab-title">
- <el-col :span="4" style="min-height: 26px">{{
- importSitem.order_remark
- }}</el-col>
- <el-col :span="9" style="min-height: 26px">{{
- confirmSitem.order_remark
- }}</el-col>
- <el-col :span="11">
- <el-form-item prop="order_remark">
- <el-input
- v-model="ruleForm.order_remark"
- maxlength="100"
- :disabled="
- !(
- status === '2' && powers.some((item) => item == '008')
- )
- "
- placeholder="订单备注" /></el-form-item
- ></el-col>
- </el-row>
- </div>
- </div>
- <div class="tab-row">
- <div class="tab-item-label">
- <div><label style="color: red">*</label>数量</div>
- <div><label style="color: red">*</label>单价</div>
- </div>
- <div class="tab-item-main">
- <el-row class="tab-title">
- <el-col :span="4">
- <div style="min-height: 26px">{{ importSitem.num }}</div>
- <div style="min-height: 26px">{{ importSitem.price }}</div>
- </el-col>
- <el-col :span="9">
- <div style="min-height: 26px">{{ confirmSitem.num }}</div>
- <div style="min-height: 26px">{{ confirmSitem.price }}</div>
- </el-col>
- <el-col :span="11" class="nop">
- <el-row>
- <el-col :span="12" class="border">
- <el-form-item prop="num">
- <digital-input
- :values="ruleForm.num"
- :placeholder="'数量'"
- :min="0"
- :max="100000000000"
- :position="'right'"
- :precision="0"
- :size="'mini'"
- :controls="false"
- :append="''"
- :disabled="
- !(
- status === '2' &&
- powers.some((item) => item == '008')
- )
- "
- @reschange="number_change($event, 'num')"
- />
- </el-form-item>
- </el-col>
- <el-col :span="12" class="border">
- <el-form-item prop="price">
- <digital-input
- :values="ruleForm.price"
- :placeholder="'单价'"
- :min="price_min"
- :disabled="
- !(
- status === '2' &&
- powers.some((item) => item == '008')
- )
- "
- :max="100000000000"
- :position="'right'"
- :precision="2"
- :size="'mini'"
- :controls="false"
- :append="'元'"
- @reschange="number_change($event, 'price')"
- />
- </el-form-item>
- </el-col>
- </el-row>
- </el-col>
- </el-row>
- </div>
- </div>
- <div class="tab-row">
- <div class="tab-item-label">
- <label style="color: transparent">*</label>活动名称
- </div>
- <div class="tab-item-main">
- <el-row class="tab-title">
- <el-col :span="4" style="min-height: 26px">{{
- importSitem.activity_name
- }}</el-col>
- <el-col :span="9" style="min-height: 26px">{{
- confirmSitem.activity_name
- }}</el-col>
- <el-col :span="11">
- <el-form-item prop="activity_code">
- <el-select
- v-model="ruleForm.activity_code"
- style="width: 100%"
- clearable
- :disabled="
- !(
- status === '2' && powers.some((item) => item == '008')
- )
- "
- @change="get_new_price"
- placeholder="活动名称"
- >
- <el-option
- v-for="(item, i) in actOptions"
- :key="item.activity_code + i"
- :label="item.activity_name"
- :value="item.activity_code"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </div>
- </div>
- <div class="tab-row">
- <div class="tab-item-label">
- <label style="color: transparent">*</label>订单总金额
- </div>
- <div class="tab-item-main">
- <el-row class="tab-title">
- <el-col :span="4" style="min-height: 26px">{{
- importSitem.before_discount_all_price
- }}</el-col>
- <el-col :span="9" style="min-height: 26px">{{
- confirmSitem.before_discount_all_price
- }}</el-col>
- <el-col :span="11" style="min-height: 26px">
- {{ ruleForm.before_discount_all_price }}</el-col
- >
- </el-row>
- </div>
- </div>
- <div
- class="tab-row"
- v-if="status === '2' && powers.some((item) => item == '008')"
- >
- <div class="tab-item-label">
- <label style="color: transparent">*</label>
- </div>
- <div class="tab-item-main tr">
- <el-button type="primary" @click="submitForm" :size="'mini'"
- >保 存
- </el-button>
- <!-- <el-button @click="showModelThis = false" :size="'mini'">{{
- isDetail ? "关 闭" : "取 消"
- }}</el-button> -->
- </div>
- </div>
- </div>
- </el-form>
- <search-good-online-modal
- :once="true"
- :sitem="{}"
- :active="true"
- :show-model="showModel"
- @resultList="resultList"
- @cancel="showModel = false"
- />
- </div>
- <div v-else>
- <no-auth></no-auth>
- </div>
- </div>
- </template>
- <script>
- import mixinPage from "@/mixins/elPaginationHandle";
- import resToken from "@/mixins/resToken";
- import asyncRequest from "@/apis/service/orderEntry/orderConfirm";
- import {
- options,
- ruleForm,
- rules,
- options1,
- options2,
- options3,
- options4,
- options5,
- options6,
- options7,
- options8,
- options9,
- onlineColumns,
- } from "./columns";
- import searchGoodOnlineModal from "@/components/search-good-online-modal";
- export default {
- name: "orderConfirm",
- mixins: [mixinPage, resToken],
- components: {
- searchGoodOnlineModal,
- },
- computed: {
- powers() {
- let tran =
- this.$store.getters.btnList.find(
- (item) => item.menu_route == "orderConfirm"
- ) || {};
- if (tran && tran.action && tran.action.length > 0) {
- return tran.action;
- } else {
- return [];
- }
- },
- },
- data() {
- return {
- statusOptions: [],
- platform_id: "",
- showColumns: [
- {
- prop: "creater",
- label: "导入人",
- span: 6,
- },
- {
- prop: "addtime",
- label: "导入时间",
- span: 6,
- },
- {
- prop: "status",
- label: "状态",
- _slot_: "status",
- span: 6,
- },
- {
- prop: "orderCode",
- label: "订单编号",
- span: 6,
- },
- {
- prop: "updater",
- label: "确认人",
- span: 6,
- },
- {
- prop: "success_date",
- label: "录入成功时间",
- span: 6,
- },
- {
- prop: "platform_name",
- label: "客户名称",
- span: 12,
- },
- {
- prop: "platform_title",
- label: "导入目标平台",
- span: 6,
- },
- {
- prop: "error_msg",
- label: "解析失败原因",
- _slot_: "error_msg",
- span: 18,
- },
- ],
- showModel: false,
- hasdiff: false,
- activeTabs: "1",
- sitem: null,
- isMetal: false,
- finishStatus: "finish",
- pickerOptions: {
- disabledDate: (time) => {
- return time.getTime() > new Date().valueOf();
- },
- },
- activeNames: ["0", "1", "2", "3", "4", "5", "10"],
- importSitem: null,
- confirmSitem: null,
- price_min: "0",
- subSitem: null,
- conGoodData: null,
- subGoodData: null,
- status: "",
- newTime: "",
- loading: false,
- queryId: "",
- rulesThis: {},
- coptions: [],
- options,
- actOptions: [],
- ruleForm: {},
- rules,
- options1,
- options2,
- options3,
- options4,
- options5,
- options6,
- options7,
- options8,
- options9,
- onlineColumns,
- priceLoding: false,
- };
- },
- mounted() {
- this.queryId = this.$route.query.id;
- this.initForm();
- },
- methods: {
- change_good() {},
- statusActive(status) {
- let active = "";
- switch (status) {
- case "1":
- active = "系统验证数据中";
- break;
- case "2":
- active = "待确认订单信息";
- break;
- case "3":
- active = "待处理(待扣减库存)";
- break;
- case "4":
- active = "库存不足";
- break;
- case "5":
- active = "订单录入成功";
- break;
- }
- return active;
- },
- statusActiveTag(status) {
- let active = "";
- switch (status) {
- case "1":
- active = "";
- break;
- case "2":
- active = "info";
- break;
- case "3":
- active = "warning";
- break;
- case "4":
- active = "danger";
- break;
- case "5":
- active = "success";
- break;
- }
- return active;
- },
- async initForm() {
- this.loading = true;
- this.rulesThis = this.rules;
- await this.resetForm();
- await this.initData();
- this.loading = false;
- },
- async againForm(sitem) {
- const {
- platform_code,
- po_code,
- platform_time,
- plat_code,
- sale_source,
- mode,
- contactor,
- mobile,
- price,
- num,
- before_discount_all_price,
- activity_code,
- order_remark,
- addr,
- addr_code,
- } = sitem;
- this.ruleForm = {
- id: this.queryId || "",
- platform_code: platform_code || "", //平台订单号
- po_code: po_code || "", //其他单号
- platform_time: platform_time || "", //平台下单时间
- plat_code: plat_code || "", //平台商品编号
- sale_source: sale_source || "", //销售渠道
- mode: mode || "", //收费模式
- contactor: contactor || "", ///收货人
- mobile: mobile || "", //联系电话
- price: price || "", //单价
- num: num || "", //数量
- before_discount_all_price: before_discount_all_price || "", //优惠前总金额
- activity_code: activity_code || "", //优惠活动名称
- order_remark: order_remark || "", //订单备注
- addr: addr || "", //联系地址
- addr_code:
- addr_code && addr_code.length > 0 ? addr_code.split(",") : [], //省市区
- };
- this.ruleForm.before_discount_all_price = this.accMul(
- this.ruleForm.num,
- this.ruleForm.price
- );
- if (plat_code && plat_code !== "") {
- await this.get_goods_active();
- }
- if (this.subGoodData.platform_code) {
- await this.get_source(this.subGoodData.platform_code);
- }
- },
- async initData() {
- this.sitem = null;
- this.loading = true;
- const { code, data, message } = await asyncRequest.detail({
- id: this.queryId,
- });
- if (code === 0) {
- const {
- status,
- import: simport,
- confirm,
- user_update,
- orderCode,
- creater,
- addtime,
- updater,
- success_date,
- error_msg,
- platform_name,
- platform_title,
- } = data;
- this.sitem = {
- orderCode,
- status,
- creater,
- addtime,
- updater,
- success_date,
- status_name: this.statusActive(status),
- status_type: this.statusActiveTag(status),
- platform_name,
- platform_title,
- error_msg,
- };
- this.importSitem = simport ? JSON.parse(JSON.stringify(simport)) : null;
- this.confirmSitem = confirm
- ? JSON.parse(JSON.stringify(confirm))
- : null;
- this.status = status;
- if (
- !(this.status === "3" || this.status === "4" || this.status === "5")
- ) {
- console.log(12345);
- this.subSitem = confirm ? JSON.parse(JSON.stringify(confirm)) : null;
- } else {
- this.subSitem = user_update
- ? JSON.parse(JSON.stringify(user_update))
- : null;
- }
- if (
- this.confirmSitem !== null &&
- this.confirmSitem.plat_code &&
- this.confirmSitem.plat_code !== ""
- ) {
- await this.onlineData(1, this.confirmSitem.plat_code);
- }
- if (this.subSitem !== null) {
- if (this.subSitem.plat_code && this.subSitem.plat_code !== "") {
- await this.onlineData(2, this.subSitem.plat_code);
- }
- await this.againForm(this.subSitem);
- }
- this.getNewTime();
- } else if (code >= 100 && code <= 104) {
- await this.logout();
- } else {
- this.$message.warning(message);
- }
- this.loading = false;
- },
- async onlineData(type, good_code) {
- this.loading = true;
- const { code, data, message } = await asyncRequest.good_detail({
- plat_code: good_code,
- });
- if (code === 0) {
- if (type === 1) {
- this.conGoodData = data;
- } else {
- this.subGoodData = data;
- const { platform_name, platform_code } = data;
- if (this.status !== "2") {
- this.sitem.platform_name = platform_name + "客户";
- }
- if (platform_code) {
- await this.get_source(platform_code);
- }
- }
- } else if (code >= 100 && code <= 104) {
- await this.logout();
- } else {
- this.$message.warning(message);
- this.ruleForm.num = "0";
- await this.get_new_price();
- }
- this.loading = false;
- },
- async get_source(platform_code) {
- this.platform_id = platform_code;
- this.coptions = [];
- const { code, data, message } = await asyncRequest.sourceList({
- platform_id: platform_code,
- });
- if (code === 0) {
- this.coptions = data;
- } else if (code >= 100 && code <= 104) {
- await this.logout();
- } else {
- this.$message.warning(message);
- }
- if (this.coptions.length == 0) {
- this.ruleForm.sale_source = "";
- this.$refs.ruleForm.validateField("sale_source");
- }
- },
- async resultList(e) {
- if (e && e.length === 1) {
- const { plat_code } = JSON.parse(JSON.stringify(e[0]));
- this.ruleForm.plat_code = plat_code || "";
- this.$refs.ruleForm.validateField("plat_code");
- if (plat_code) {
- await this.onlineData(2, plat_code);
- } else {
- this.subGoodData = null;
- this.coptions = [];
- this.ruleForm.num = "0";
- this.ruleForm.price = "0";
- this.ruleForm.sale_source = "";
- this.$refs.ruleForm.validateField("num");
- this.$refs.ruleForm.validateField("price");
- this.$refs.ruleForm.validateField("sale_source");
- }
- }
- },
- //省市区选择
- async select_area_change(e) {
- this.ruleForm.addr_code = e;
- this.$refs.ruleForm.validateField("addr_code");
- },
- async number_change(e, key) {
- this.ruleForm[key] = e + "" || "0";
- this.$refs.ruleForm.validateField(key);
- if (key === "num") {
- await this.get_new_price();
- }
- this.ruleForm.before_discount_all_price = this.accMul(
- this.ruleForm.num,
- this.ruleForm.price
- );
- },
- async get_new_price() {
- const { num, activity_code } = this.ruleForm;
- if (num * 1 === 0) {
- this.price_min = "0";
- this.ruleForm.price = "0";
- return;
- } else {
- const { skuCode: conSkuCode } = this.conGoodData;
- const { skuCode: subSkuCode } = this.subGoodData;
- let model = {
- skuCode:
- this.status === "3" || this.status === "4" || this.status === "5"
- ? subSkuCode
- : conSkuCode,
- sale_num: num,
- is_activity: activity_code ? "1" : "0",
- act_code: activity_code ? activity_code : "",
- };
- if (!this.priceLoding) {
- const { isok, price } = await this.set_salegetprice(model);
- this.price_min = isok ? price : "0";
- if (!isok) {
- this.ruleForm.price = "0";
- } else {
- if (price * 1 >= this.ruleForm.price * 1)
- this.ruleForm.price = price;
- }
- }
- }
- },
- async get_goods_active() {
- this.actOptions = [];
- const { skuCode, companyNo, platform_code } = this.subGoodData;
- let model = {
- skuCode,
- companyNo,
- platform_id: platform_code,
- };
- const { code, data, message } = await asyncRequest.goods_active(model);
- if (code === 0) {
- const { act } = data;
- this.actOptions = act;
- } else if (code >= 100 && code <= 104) {
- await this.logout();
- } else {
- this.$message.warning(message);
- }
- if (this.actOptions.length === 0) {
- this.ruleForm.activity_code = "";
- this.$refs.ruleForm.validateField("activity_code");
- }
- },
- async resetForm() {
- // 重置
- await this.$nextTick(() => {
- if (this.$refs.ruleForm) {
- this.$refs.ruleForm.resetFields();
- this.$refs.ruleForm.clearValidate();
- this.ruleForm = ruleForm;
- }
- });
- },
- async submitForm() {
- await this.$refs.ruleForm.validate(async (valid) => {
- if (valid) {
- if (this.loading) {
- return;
- }
- this.loading = true;
- let model = JSON.parse(JSON.stringify(this.ruleForm));
- model.platform_id = this.platform_id;
- const { code, data, message } = await asyncRequest.update(model);
- this.loading = false;
- if (code === 0) {
- this.$notify.success({
- title: "提交成功!",
- message: "",
- });
- this.initForm();
- } else if (code >= 100 && code <= 104) {
- await this.logout();
- } else {
- this.$message.warning(message);
- }
- } else {
- console.log("error submit!!");
- return false;
- }
- });
- },
- accMul(arg1, arg2) {
- var m = 0,
- s1 = arg1.toString(),
- s2 = arg2.toString();
- try {
- m += s1.split(".")[1].length;
- } catch (e) {}
- try {
- m += s2.split(".")[1].length;
- } catch (e) {}
- return (
- (Number(s1.replace(".", "")) * Number(s2.replace(".", ""))) /
- Math.pow(10, m)
- );
- },
- async set_salegetprice(model) {
- this.priceLoding = true;
- let resModel = {
- isok: true,
- price: "0",
- };
- // console.log(model);
- let { code, message, data } = await asyncRequest.salegetprice(model);
- if (code === 0) {
- const { sale_price } = data;
- resModel.price = sale_price + "";
- } else if (code >= 100 && code <= 104) {
- await this.logout();
- } else {
- this.$message.warning(message);
- resModel.isok = false;
- }
- this.priceLoding = false;
- return resModel;
- },
- getNewTime() {
- this.newTime = new Date().valueOf();
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .orderConfirm {
- font-size: 13px;
- color: #909399 !important;
- line-height: 26px;
- .tab-row {
- border-left: 1px solid #ebeef5;
- border-top: 1px solid #ebeef5;
- display: flex;
- align-items: stretch;
- &:last-child {
- border-bottom: 1px solid #ebeef5;
- }
- .tab-item-label {
- padding: 4px 5px;
- width: 125px;
- .red {
- color: red;
- padding: 0 5px 0 0;
- }
- }
- .tab-item-main {
- width: calc(100% - 125px);
- border-left: 1px solid #ebeef5;
- .tab-title {
- display: flex;
- align-items: stretch;
- .el-col {
- padding: 3px 5px;
- border-right: 1px solid #ebeef5;
- &.nop {
- padding: 0;
- }
- &.border {
- border: 0;
- }
- }
- }
- }
- }
- }
- </style>
-
-
|