|
@@ -305,9 +305,8 @@
|
|
|
<li>息</li>
|
|
|
</ul>
|
|
|
</el-col>
|
|
|
- <el-col :span="23" class="dmain" style="padding-left: 18px">
|
|
|
+ <el-col :span="23" class="dmain" style="padding: 20px 0 20px 18px">
|
|
|
<el-table :data="tableData" :size="'mini'" border style="width: 100%">
|
|
|
- <!-- <el-table-column prop="index" label="序号"> </el-table-column> -->
|
|
|
<el-table-column prop="spec_value" label="规格类型" />
|
|
|
<el-table-column prop="spec_value_value" label="规格值" />
|
|
|
<el-table-column fixed="right">
|
|
@@ -349,6 +348,514 @@
|
|
|
/>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-row class="ddiv">
|
|
|
+ <el-col :span="1" class="dtitle">
|
|
|
+ <ul>
|
|
|
+ <li>包</li>
|
|
|
+ <li>装</li>
|
|
|
+ <li>信</li>
|
|
|
+ <li>息</li>
|
|
|
+ </ul></el-col
|
|
|
+ >
|
|
|
+ <el-col :span="23" class="dmain">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="包装清单" prop="packing_list">
|
|
|
+ <el-input
|
|
|
+ placeholder="包装清单"
|
|
|
+ v-model="ruleForm.packing_list"
|
|
|
+ maxlength="250"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="包装方式" prop="packing_way">
|
|
|
+ <el-input
|
|
|
+ placeholder="包装方式"
|
|
|
+ v-model="ruleForm.packing_way"
|
|
|
+ maxlength="250"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="装箱规格" prop="packing_spec">
|
|
|
+ <el-input
|
|
|
+ placeholder="装箱规格"
|
|
|
+ v-model="ruleForm.packing_spec"
|
|
|
+ maxlength="250"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="装箱重量" prop="packing_weight">
|
|
|
+ <el-input
|
|
|
+ placeholder="装箱重量"
|
|
|
+ v-model="ruleForm.packing_weight"
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ :max="9999999999.99"
|
|
|
+ :step="2"
|
|
|
+ >
|
|
|
+ <template slot="append">g</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="装箱尺寸" prop="packing_szie">
|
|
|
+ <el-input
|
|
|
+ placeholder="装箱尺寸"
|
|
|
+ v-model="ruleForm.packing_szie"
|
|
|
+ maxlength="250"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="商品条形码" prop="good_bar">
|
|
|
+ <el-input
|
|
|
+ placeholder="物流时间"
|
|
|
+ v-model="ruleForm.good_bar"
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ :max="9999999999999"
|
|
|
+ :step="0"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="ddiv">
|
|
|
+ <el-col :span="1" class="dtitle">
|
|
|
+ <ul>
|
|
|
+ <li>发</li>
|
|
|
+ <li>货</li>
|
|
|
+ <li>信</li>
|
|
|
+ <li>息</li>
|
|
|
+ </ul></el-col
|
|
|
+ >
|
|
|
+ <el-col :span="23" class="dmain">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="供货区域" prop="supply_area">
|
|
|
+ <el-select
|
|
|
+ v-model="ruleForm.supply_area"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="供货区域"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="group in options6"
|
|
|
+ :key="group.id"
|
|
|
+ :label="group.name"
|
|
|
+ :value="group.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="发货地" prop="delivery_place">
|
|
|
+ <select-area
|
|
|
+ :placeholder="'发货地'"
|
|
|
+ :value="ruleForm.delivery_place"
|
|
|
+ :is-detail="id !== 'add'"
|
|
|
+ :disabled="isDetail"
|
|
|
+ :size="'mini'"
|
|
|
+ @selectChange="selectAreadelivery_place"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="产地" prop="origin_place">
|
|
|
+ <select-area
|
|
|
+ :placeholder="'产地'"
|
|
|
+ :value="ruleForm.origin_place"
|
|
|
+ :size="'mini'"
|
|
|
+ :is-detail="id !== 'add'"
|
|
|
+ :disabled="isDetail"
|
|
|
+ @selectChange="selectAreaorigin_place"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="物流时间" prop="delivery_day">
|
|
|
+ <el-input
|
|
|
+ placeholder="物流时间"
|
|
|
+ v-model="ruleForm.delivery_day"
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ :max="9999999999"
|
|
|
+ :step="0"
|
|
|
+ >
|
|
|
+ <template slot="append">天</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="供货周期" prop="lead_time">
|
|
|
+ <el-input
|
|
|
+ placeholder="供货周期"
|
|
|
+ v-model="ruleForm.lead_time"
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ :max="9999999999"
|
|
|
+ :step="0"
|
|
|
+ >
|
|
|
+ <template slot="append">天</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="调样周期" prop="sample_day">
|
|
|
+ <el-input
|
|
|
+ placeholder="调样周期"
|
|
|
+ v-model="ruleForm.sample_day"
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ :max="9999999999"
|
|
|
+ :step="0"
|
|
|
+ >
|
|
|
+ <template slot="append">天</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="ddiv">
|
|
|
+ <el-col :span="1" class="dtitle">
|
|
|
+ <ul>
|
|
|
+ <li>图</li>
|
|
|
+ <li>片</li>
|
|
|
+ <li>信</li>
|
|
|
+ <li>息</li>
|
|
|
+ </ul></el-col
|
|
|
+ >
|
|
|
+ <el-col :span="23" class="dmain">
|
|
|
+ <el-row style="padding: 0 0 20px 0">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item
|
|
|
+ label="缩略图"
|
|
|
+ prop="good_thumb_img"
|
|
|
+ class="activity-upload"
|
|
|
+ >
|
|
|
+ <div class="btnupload" style="position: relative">
|
|
|
+ <img
|
|
|
+ v-if="ruleForm.good_thumb_img"
|
|
|
+ :src="ruleForm.good_thumb_img"
|
|
|
+ class="avatar"
|
|
|
+ />
|
|
|
+ <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
+ <file-upload
|
|
|
+ class="Upload"
|
|
|
+ :disabled="id == '007'"
|
|
|
+ :accept="'.jpg,.png,.jpeg'"
|
|
|
+ :multiple="true"
|
|
|
+ :uploadcondition="beforeAvatarUpload"
|
|
|
+ @UploadErrorEvent="UploadErrorEventgood_thumb_img"
|
|
|
+ @UploadSuccessEvent="UploadSuccessEventgood_thumb_img"
|
|
|
+ ></file-upload>
|
|
|
+ </div>
|
|
|
+ <div class="txt-tips fl">
|
|
|
+ <p>尺寸比例:</p>
|
|
|
+ <p>1:1</p>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <el-form-item
|
|
|
+ label="详情主图"
|
|
|
+ prop="good_img"
|
|
|
+ class="activity-upload"
|
|
|
+ >
|
|
|
+ <div class="btnupload" style="position: relative">
|
|
|
+ <img
|
|
|
+ v-if="ruleForm.good_img"
|
|
|
+ :src="ruleForm.good_img"
|
|
|
+ class="avatar"
|
|
|
+ />
|
|
|
+ <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
+ <file-upload
|
|
|
+ class="Upload"
|
|
|
+ :disabled="id == '007'"
|
|
|
+ :accept="'.jpg,.png,.jpeg'"
|
|
|
+ :multiple="true"
|
|
|
+ :uploadcondition="beforeAvatarUpload"
|
|
|
+ @UploadErrorEvent="UploadErrorEventgood_img"
|
|
|
+ @UploadSuccessEvent="UploadSuccessEventgood_img"
|
|
|
+ ></file-upload>
|
|
|
+ </div>
|
|
|
+ </el-form-item> -->
|
|
|
+ <div style="font-size: 12px; color: #606266">
|
|
|
+ <span style="padding: 0 0 0 20px">图片大小:小于1M</span>
|
|
|
+ <span style="padding: 0 0 0 20px">图片类型.jpg/png/jpeg</span>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="16">
|
|
|
+ <el-form-item label="详情介绍图" prop="good_info_img">
|
|
|
+ <div class="good_info_img-div">
|
|
|
+ <ul v-if="ruleForm.good_info_img" class="clear">
|
|
|
+ <li
|
|
|
+ class="img-show-li"
|
|
|
+ v-viewer
|
|
|
+ v-for="(img, iindex) in ruleForm.good_info_img"
|
|
|
+ :key="img + iindex"
|
|
|
+ >
|
|
|
+ <img :src="img" alt="" />
|
|
|
+ <i class="el-icon-close" @click="closeImg(iindex)"></i>
|
|
|
+ </li>
|
|
|
+ <li
|
|
|
+ class="img-upload-li"
|
|
|
+ v-if="ruleForm.good_info_img.length < 10"
|
|
|
+ >
|
|
|
+ <div class="activity-upload">
|
|
|
+ <div class="btnupload" style="position: relative">
|
|
|
+ <i class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
+ <file-upload
|
|
|
+ class="Upload"
|
|
|
+ :disabled="id == '007'"
|
|
|
+ :accept="'.jpg,.png,.jpeg'"
|
|
|
+ :multiple="true"
|
|
|
+ :uploadcondition="beforeAvatarUpload"
|
|
|
+ @UploadErrorEvent="UploadErrorEventgood_info_img"
|
|
|
+ @UploadSuccessEvent="UploadSuccessEventgood_info_img"
|
|
|
+ ></file-upload>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="ddiv">
|
|
|
+ <el-col :span="1" class="dtitle">
|
|
|
+ <ul style="padding: 40px 0 0 0">
|
|
|
+ <li>固</li>
|
|
|
+ <li>定</li>
|
|
|
+ <li>成</li>
|
|
|
+ <li>本</li>
|
|
|
+ </ul></el-col
|
|
|
+ >
|
|
|
+ <el-col :span="23" class="dmain">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="证书费" prop="cert_fee">
|
|
|
+ <el-input
|
|
|
+ placeholder="证书费"
|
|
|
+ v-model="ruleForm.cert_fee"
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ :max="9999999999.99"
|
|
|
+ :step="2"
|
|
|
+ >
|
|
|
+ <template slot="append">元</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="包装费" prop="packing_fee">
|
|
|
+ <el-input
|
|
|
+ placeholder="包装费"
|
|
|
+ v-model="ruleForm.packing_fee"
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ :max="9999999999.99"
|
|
|
+ :step="2"
|
|
|
+ >
|
|
|
+ <template slot="append">元</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="成本工艺费" prop="cost_fee">
|
|
|
+ <el-input
|
|
|
+ placeholder="成本工艺费"
|
|
|
+ v-model="ruleForm.cost_fee"
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ :max="9999999999.99"
|
|
|
+ :step="2"
|
|
|
+ >
|
|
|
+ <template slot="append">元</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="加标费" prop="mark_fee">
|
|
|
+ <el-input
|
|
|
+ placeholder="加标费"
|
|
|
+ v-model="ruleForm.mark_fee"
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ :max="9999999999.99"
|
|
|
+ :step="2"
|
|
|
+ >
|
|
|
+ <template slot="append">元</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="打样费" prop="demo_fee">
|
|
|
+ <el-input
|
|
|
+ placeholder="打样费"
|
|
|
+ v-model="ruleForm.demo_fee"
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ :max="9999999999.99"
|
|
|
+ :step="2"
|
|
|
+ >
|
|
|
+ <template slot="append">元</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="开模费" prop="open_fee">
|
|
|
+ <el-input
|
|
|
+ placeholder="开模费"
|
|
|
+ v-model="ruleForm.open_fee"
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ :max="9999999999.99"
|
|
|
+ :step="2"
|
|
|
+ >
|
|
|
+ <template slot="append">元</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="调样费" prop="sample_fee">
|
|
|
+ <el-input
|
|
|
+ placeholder="调样费"
|
|
|
+ v-model="ruleForm.sample_fee"
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ :max="9999999999.99"
|
|
|
+ :step="2"
|
|
|
+ >
|
|
|
+ <template slot="append">元</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="市场价" prop="market_price">
|
|
|
+ <el-input
|
|
|
+ placeholder="市场价"
|
|
|
+ v-model="ruleForm.market_price"
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ :max="9999999999.99"
|
|
|
+ :step="2"
|
|
|
+ >
|
|
|
+ <template slot="append">元</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="含税成本合计" prop="nake_price">
|
|
|
+ <el-input
|
|
|
+ placeholder="含税成本合计"
|
|
|
+ v-model="ruleForm.nake_price"
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ :max="9999999999.99"
|
|
|
+ :step="2"
|
|
|
+ >
|
|
|
+ <template slot="append">元</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="ddiv">
|
|
|
+ <el-col :span="1" class="dtitle">
|
|
|
+ <ul>
|
|
|
+ <li>阶</li>
|
|
|
+ <li>梯</li>
|
|
|
+ <li>成</li>
|
|
|
+ <li>本</li>
|
|
|
+ </ul></el-col
|
|
|
+ >
|
|
|
+ <el-col :span="23" class="dmain" style="padding-left: 18px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="启用阶梯" prop="is_step">
|
|
|
+ <el-select
|
|
|
+ v-model="ruleForm.is_step"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="启用阶梯"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="group in options5"
|
|
|
+ :key="group.id"
|
|
|
+ :label="group.name"
|
|
|
+ :value="group.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-table
|
|
|
+ :data="tableData1"
|
|
|
+ :size="'mini'"
|
|
|
+ border
|
|
|
+ stripe
|
|
|
+ style="width: 100%; margin: 0 0 20px 0"
|
|
|
+ >
|
|
|
+ <el-table-column prop="min_num" label="起订量(>=)" />
|
|
|
+
|
|
|
+ <el-table-column prop="nake_fee" label="成本合计" />
|
|
|
+ <el-table-column prop="cost_fee" label="工艺费" />
|
|
|
+ <el-table-column prop="delivery_fee" label="其中运费" />
|
|
|
+ <el-table-column fixed="right">
|
|
|
+ <template slot="header" slot-scope="scope">
|
|
|
+ <span>操作</span>
|
|
|
+ <el-tooltip effect="dark" content="添加阶梯" placement="top">
|
|
|
+ <i
|
|
|
+ class="el-icon-circle-plus-outline tb-icon fr"
|
|
|
+ @click="openCostEdit(-1, {})"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tooltip effect="dark" content="修改" placement="top">
|
|
|
+ <i
|
|
|
+ class="el-icon-edit tb-icon"
|
|
|
+ @click="openCostEdit(scope.$index, scope.row)"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip effect="dark" content="禁/启用" placement="top">
|
|
|
+ <i
|
|
|
+ class="el-icon-video-pause tb-icon"
|
|
|
+ @click="openCostEdit('')"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" style="text-align: right">
|
|
|
+ <el-button v-if="id !== '007'" type="primary" @click="submitForm"
|
|
|
+ >保 存
|
|
|
+ </el-button>
|
|
|
+ <el-button @click="showModelThis = false">{{
|
|
|
+ id == "007" ? "关 闭" : "取 消"
|
|
|
+ }}</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <!-- 弹窗 新增/修改 -->
|
|
|
+ <cost-form-add-edit
|
|
|
+ :index="costmodelIndex"
|
|
|
+ :show-model="costshowModel"
|
|
|
+ :sitem="costsitem"
|
|
|
+ @refresh="costrefreshEdit"
|
|
|
+ @cancel="costshowModel = false"
|
|
|
+ /> </el-col
|
|
|
+ ></el-row>
|
|
|
</el-form>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -356,12 +863,23 @@ import asyncRequest from "@/apis/service/goodStore/goodsCost";
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
import { mapGetters } from "vuex";
|
|
|
import baseFormAddEdit from "./baseFormAddEdit";
|
|
|
-import { options1, options2, options3, options4, options5 } from "../columns";
|
|
|
+import costFormAddEdit from "./costFormAddEdit";
|
|
|
+import {
|
|
|
+ options1,
|
|
|
+ options2,
|
|
|
+ options3,
|
|
|
+ options4,
|
|
|
+ options5,
|
|
|
+ options6,
|
|
|
+ options7,
|
|
|
+ rules,
|
|
|
+} from "../columns";
|
|
|
export default {
|
|
|
name: "goodsCostAdd",
|
|
|
mixins: [resToken],
|
|
|
components: {
|
|
|
baseFormAddEdit,
|
|
|
+ costFormAddEdit,
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(["tablebtnSize", "searchSize", "size"]),
|
|
@@ -379,11 +897,15 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ costshowModel: false,
|
|
|
+ costmodelIndex: "",
|
|
|
+ costsitem: {},
|
|
|
showModel: false,
|
|
|
modelIndex: "",
|
|
|
is_noble: false,
|
|
|
sitem: {},
|
|
|
size: "small",
|
|
|
+
|
|
|
rulesThis: this.rules,
|
|
|
activeName: "1",
|
|
|
loading: false,
|
|
@@ -393,144 +915,11 @@ export default {
|
|
|
options3: options3,
|
|
|
options4: options4,
|
|
|
options5: options5,
|
|
|
+ options6: options6,
|
|
|
+ options7: options7,
|
|
|
ruleForm: {},
|
|
|
- rules: {
|
|
|
- cat_id: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "商品分类",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- brandid: [
|
|
|
- {
|
|
|
- type: "array",
|
|
|
- required: false,
|
|
|
- message: "商品品牌",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- noble_weight: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "贵金属重量为合法数字",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- weight: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "商品总重量为合法数字",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- good_type: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择是否定制",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- is_stock: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择是否库存品",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- company_id: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择业务公司",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- supplierNo: [
|
|
|
- {
|
|
|
- type: "array",
|
|
|
- required: true,
|
|
|
- message: "请选择供应商",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- is_auth: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "商品主图",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- tax: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择税率",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- good_name: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请输入商品名称",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- unit: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请输入商品单位",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- is_exclusive: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择专属类型",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- noble_metal: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择贵金属种类",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- is_gold_price: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "请选择是否启用实时金价",
|
|
|
- trigger: "change",
|
|
|
- },
|
|
|
- ],
|
|
|
- moq: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "定制起订量应为合法数字",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- customized: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "定制工期为合法数字",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- after_sales: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "售后说明不能为空",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- good_remark: [
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: "商品备注不能为空",
|
|
|
- trigger: "blur",
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
+ tableData1: [],
|
|
|
+ rules: rules,
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -552,6 +941,11 @@ export default {
|
|
|
this.sitem = sitem;
|
|
|
this.showModel = true;
|
|
|
},
|
|
|
+ openCostEdit(index, sitem) {
|
|
|
+ this.costmodelIndex = index;
|
|
|
+ this.costsitem = sitem;
|
|
|
+ this.costshowModel = true;
|
|
|
+ },
|
|
|
async initData() {
|
|
|
this.loading = true;
|
|
|
const { code, data, message } = await asyncRequest.detail({
|
|
@@ -578,18 +972,18 @@ export default {
|
|
|
},
|
|
|
resetFormData() {
|
|
|
this.ruleForm = {
|
|
|
- cat_id: "",
|
|
|
+ cat_id: ["1", "53"],
|
|
|
brandid: [],
|
|
|
noble_weight: "",
|
|
|
- weight: "",
|
|
|
- good_type: "",
|
|
|
+ weight: "111",
|
|
|
+ good_type: "0",
|
|
|
is_stock: "",
|
|
|
- supplierNo: [],
|
|
|
- company_id: "",
|
|
|
+ supplierNo: ["GYS-20210520-0001"],
|
|
|
+ company_id: "GSec37220215151111",
|
|
|
is_auth: "",
|
|
|
tax: "",
|
|
|
good_name: "2018春秋新款V领修身丝绒西装女 双排扣复古极简中长款工装外套",
|
|
|
- unit: "",
|
|
|
+ unit: ["3"],
|
|
|
is_exclusive: "",
|
|
|
noble_metal: "",
|
|
|
is_gold_price: "",
|
|
@@ -597,9 +991,88 @@ export default {
|
|
|
customized: "",
|
|
|
after_sales: "",
|
|
|
craft_desc: "",
|
|
|
- good_remark: "",
|
|
|
+ good_remark: "备注备注",
|
|
|
+ //包装发货/图片
|
|
|
+ packing_list: "",
|
|
|
+ packing_way: "",
|
|
|
+ packing_spec: "",
|
|
|
+ packing_weight: "",
|
|
|
+ packing_szie: "",
|
|
|
+ good_bar: "",
|
|
|
+ supply_area: "",
|
|
|
+ delivery_place: [],
|
|
|
+ origin_place: [],
|
|
|
+ delivery_day: "",
|
|
|
+ lead_time: "",
|
|
|
+ sample_day: "",
|
|
|
+ good_thumb_img: "",
|
|
|
+ // good_img: "",
|
|
|
+ good_info_img: [],
|
|
|
+ //固定阶梯成本
|
|
|
+ cert_fee: "",
|
|
|
+ packing_fee: "",
|
|
|
+ cost_fee: "",
|
|
|
+ mark_fee: "",
|
|
|
+ demo_fee: "",
|
|
|
+ open_fee: "",
|
|
|
+ sample_fee: "",
|
|
|
+ market_price: "",
|
|
|
+ nake_price: "",
|
|
|
+ // b1: [],
|
|
|
};
|
|
|
},
|
|
|
+
|
|
|
+ async submitForm() {
|
|
|
+ await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.loading = true;
|
|
|
+ if (this.tableData.length === 0) {
|
|
|
+ this.$message.warning("请录入商品规格信息!");
|
|
|
+ this.loading = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.tableData1.length === 0) {
|
|
|
+ this.$message.warning("请录入阶梯成本!");
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ let model = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
+ model.speclist = JSON.parse(JSON.stringify(this.tableData));
|
|
|
+ model.good_ladder = JSON.parse(JSON.stringify(this.tableData1));
|
|
|
+ model.cat_id = model.cat_id[model.cat_id.length - 1];
|
|
|
+ model.brandid = model.brandid.toString();
|
|
|
+ model.supplierNo = model.supplierNo.toString();
|
|
|
+ model.delivery_place = model.delivery_place.toString();
|
|
|
+ model.origin_place = model.origin_place.toString();
|
|
|
+ model.good_info_img = model.good_info_img.toString();
|
|
|
+ model.unit = model.unit.toString();
|
|
|
+ let res = {};
|
|
|
+ // if (this.id === "003") {
|
|
|
+ // delete model["id"];
|
|
|
+ // res = await asyncRequest.add(model);
|
|
|
+ // } else {
|
|
|
+ // res = await asyncRequest.update(model);
|
|
|
+ // }
|
|
|
+ res = await asyncRequest.add(model);
|
|
|
+ console.log(res);
|
|
|
+ this.loading = false;
|
|
|
+ if (res && res.code === 0) {
|
|
|
+ const title = this.id === "add" ? "添加成功!" : "修改成功!";
|
|
|
+ this.$notify.success({
|
|
|
+ title,
|
|
|
+ message: "",
|
|
|
+ });
|
|
|
+ this.showModelThis = false;
|
|
|
+ // 刷新
|
|
|
+ this.$emit("refresh");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log("error submit!!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ //规格编辑修改
|
|
|
refreshEdit(e) {
|
|
|
let item = JSON.parse(JSON.stringify(e));
|
|
|
const {
|
|
@@ -613,7 +1086,7 @@ export default {
|
|
|
if (index + "" === "-1") {
|
|
|
this.tableData.push(item);
|
|
|
} else {
|
|
|
- this.tableData.forEach((i,findex) => {
|
|
|
+ this.tableData.forEach((i, findex) => {
|
|
|
if (i.spec_id === spec_id) {
|
|
|
this.tableData[findex].id = id;
|
|
|
this.tableData[findex].spec_id = spec_id;
|
|
@@ -625,6 +1098,35 @@ export default {
|
|
|
}
|
|
|
this.showModel = false;
|
|
|
},
|
|
|
+ //阶梯成本修改
|
|
|
+ costrefreshEdit(e) {
|
|
|
+ let item = JSON.parse(JSON.stringify(e));
|
|
|
+ console.log(item);
|
|
|
+ const { index, id, cost_fee, delivery_fee, min_num, spec_value_value } =
|
|
|
+ item;
|
|
|
+ if (index + "" === "-1") {
|
|
|
+ this.tableData1.push(item);
|
|
|
+ } else {
|
|
|
+ this.tableData1.forEach((i, findex) => {
|
|
|
+ if (i.id === id && findex === parseInt(i.index)) {
|
|
|
+ this.tableData[findex].id = id;
|
|
|
+ this.tableData[findex].cost_fee = cost_fee;
|
|
|
+ this.tableData[findex].delivery_fee = delivery_fee;
|
|
|
+ this.tableData[findex].min_num = min_num;
|
|
|
+ this.tableData[findex].spec_value_value = spec_value_value;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.tableData1 = this.tableData1.sort(this.dataSort("min_num"));
|
|
|
+ }
|
|
|
+ this.showModel = false;
|
|
|
+ },
|
|
|
+ dataSort(key) {
|
|
|
+ return function (a, b) {
|
|
|
+ let value1 = a[key];
|
|
|
+ let value2 = b[key];
|
|
|
+ return value1 - value2;
|
|
|
+ };
|
|
|
+ },
|
|
|
//商品分类选择
|
|
|
goods_class_change(e) {
|
|
|
const { value, item } = e;
|
|
@@ -655,6 +1157,7 @@ export default {
|
|
|
},
|
|
|
//供应商选择
|
|
|
supplierNosearchChange(e) {
|
|
|
+ console.log(e);
|
|
|
const { id, code, label } = e;
|
|
|
if (id) {
|
|
|
this.ruleForm.supplierNo = [code];
|
|
@@ -663,6 +1166,7 @@ export default {
|
|
|
}
|
|
|
this.$refs.ruleForm.validateField("supplierNo");
|
|
|
},
|
|
|
+ //业务企业选择
|
|
|
company_idsearchChange(e) {
|
|
|
const { id, code, label } = e;
|
|
|
if (id) {
|
|
@@ -704,128 +1208,95 @@ export default {
|
|
|
}
|
|
|
this.$refs.ruleForm.validateField("noble_metal");
|
|
|
},
|
|
|
- async submitForm() {
|
|
|
- await this.$refs.ruleForm.validate(async (valid) => {
|
|
|
- if (valid) {
|
|
|
- let change = false;
|
|
|
- this.mock.forEach((v1) => {
|
|
|
- if (v1.change && v1.change.length > 0) {
|
|
|
- change = true;
|
|
|
- }
|
|
|
- });
|
|
|
- if (!change) {
|
|
|
- this.ruleForm.spec = "规格!";
|
|
|
- return;
|
|
|
- } else {
|
|
|
- this.ruleForm.spec = "";
|
|
|
- let table = false;
|
|
|
- let hasnot = false;
|
|
|
- let stock = [];
|
|
|
- this.right.specList.forEach((v1) => {
|
|
|
- if (v1) {
|
|
|
- v1.forEach((v2) => {
|
|
|
- if (v2 && v2.limit && v2.limit.length > 0) {
|
|
|
- let list = [];
|
|
|
- v2.limit.forEach((v3) => {
|
|
|
- if (v3.num != 0 && v3.price != 0) {
|
|
|
- table = true;
|
|
|
- list.push(v3);
|
|
|
- }
|
|
|
- if (
|
|
|
- (v3.num != 0 && v3.price == 0) ||
|
|
|
- (v3.num == 0 && v3.price !== 0)
|
|
|
- ) {
|
|
|
- hasnot = true;
|
|
|
- }
|
|
|
- });
|
|
|
- if (list.length > 0) {
|
|
|
- let model = Object.assign({}, v2);
|
|
|
- model.limit = list;
|
|
|
- stock.push(model);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- if (hasnot) {
|
|
|
- this.ruleForm.table =
|
|
|
- "起订量与成本价需成对填写,未成对请设为零!";
|
|
|
- } else {
|
|
|
- if (!table) {
|
|
|
- this.ruleForm.table = "至少填写一堆起订量与成本价!";
|
|
|
- } else {
|
|
|
- this.ruleForm.table = "";
|
|
|
- this.loading = true;
|
|
|
- let obj = JSON.parse(JSON.stringify(this.ruleForm));
|
|
|
- obj.stock = stock;
|
|
|
- obj.cat_id = obj.cat_id[obj.cat_id.length - 1];
|
|
|
- obj.image = obj.image.join();
|
|
|
- //split(",");
|
|
|
- console.log(obj);
|
|
|
- let res = {};
|
|
|
- if (this.id === "add") {
|
|
|
- delete obj["id"];
|
|
|
- res = await asyncRequest.add(obj);
|
|
|
- } else {
|
|
|
- res = await asyncRequest.update(obj);
|
|
|
- }
|
|
|
- this.loading = false;
|
|
|
- if (res.code === 0) {
|
|
|
- let title = this.id === "add" ? "添加成功" : "修改成功";
|
|
|
- this.$notify.success({
|
|
|
- title,
|
|
|
- message: "",
|
|
|
- });
|
|
|
- // 刷新
|
|
|
- this.$emit("refresh");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ //仓库省市区
|
|
|
+ selectAreadelivery_place(e) {
|
|
|
+ this.ruleForm.delivery_place = e;
|
|
|
+ this.$refs.ruleForm.validateField("delivery_place");
|
|
|
+ },
|
|
|
+ //仓库省市区
|
|
|
+ selectAreaorigin_place(e) {
|
|
|
+ this.ruleForm.origin_place = e;
|
|
|
+ this.$refs.ruleForm.validateField("origin_place");
|
|
|
+ },
|
|
|
+ closeImg(index) {
|
|
|
+ this.ruleForm.good_info_img.splice(index, 1);
|
|
|
+ this.$refs.ruleForm.validateField("good_info_img");
|
|
|
+ },
|
|
|
+ //图片上传成功
|
|
|
+ async UploadSuccessEventgood_thumb_img(data) {
|
|
|
+ await this.UploadSuccessEvent(1, data);
|
|
|
+ },
|
|
|
+ // //图片上传成功
|
|
|
+ // async UploadSuccessEventgood_img(data) {
|
|
|
+ // await this.UploadSuccessEvent(2, data);
|
|
|
+ // },
|
|
|
+ //图片上传成功
|
|
|
+ async UploadSuccessEventgood_info_img(data) {
|
|
|
+ await this.UploadSuccessEvent(3, data);
|
|
|
+ },
|
|
|
+ //图片上传成功
|
|
|
+ async UploadSuccessEvent(type, data) {
|
|
|
+ const { url } = data;
|
|
|
+ if (url === "noToken") {
|
|
|
+ await this.logout();
|
|
|
+ } else {
|
|
|
+ if (type === 1) {
|
|
|
+ this.ruleForm.good_thumb_img = url;
|
|
|
+ this.$refs.ruleForm.validateField("good_thumb_img");
|
|
|
+ } else if (type === 2) {
|
|
|
+ this.ruleForm.good_img = url;
|
|
|
+ this.$refs.ruleForm.validateField("good_img");
|
|
|
} else {
|
|
|
- console.log("error submit!!");
|
|
|
- return false;
|
|
|
+ this.ruleForm.good_info_img.push(url);
|
|
|
+ this.$refs.ruleForm.validateField("good_info_img");
|
|
|
}
|
|
|
- });
|
|
|
+ this.$message.success("图片上传成功!");
|
|
|
+ }
|
|
|
},
|
|
|
-
|
|
|
- doExchange(arr) {
|
|
|
- let len = arr.length;
|
|
|
- // 当数组大于等于2个的时候
|
|
|
- if (len >= 2) {
|
|
|
- // 第一个数组的长度
|
|
|
- let len1 = arr[0].length;
|
|
|
- // 第二个数组的长度
|
|
|
- let len2 = arr[1].length;
|
|
|
- // 2个数组产生的组合数
|
|
|
- let lenBoth = len1 * len2;
|
|
|
- // 申明一个新数组
|
|
|
- let items = new Array(lenBoth);
|
|
|
- // 申明新数组的索引
|
|
|
- let index = 0;
|
|
|
- for (let i = 0; i < len1; i++) {
|
|
|
- for (let j = 0; j < len2; j++) {
|
|
|
- if (arr[0][i] instanceof Array) {
|
|
|
- items[index] = arr[0][i].concat(arr[1][j]);
|
|
|
- } else {
|
|
|
- items[index] = [arr[0][i]].concat(arr[1][j]);
|
|
|
- }
|
|
|
- index++;
|
|
|
- }
|
|
|
- }
|
|
|
- let newArr = new Array(len - 1);
|
|
|
- for (let i = 2; i < arr.length; i++) {
|
|
|
- newArr[i - 1] = arr[i];
|
|
|
- }
|
|
|
- newArr[0] = items;
|
|
|
- return this.doExchange(newArr);
|
|
|
- } else {
|
|
|
- return arr[0];
|
|
|
+ //图片上传失败
|
|
|
+ UploadErrorEventgood_thumb_img(res) {
|
|
|
+ this.imgUploadError(1, res);
|
|
|
+ },
|
|
|
+ // //图片上传失败
|
|
|
+ // UploadErrorEventgood_img(res) {
|
|
|
+ // this.imgUploadError(2, res);
|
|
|
+ // },
|
|
|
+ //图片上传失败
|
|
|
+ UploadErrorEventgood_info_img(res) {
|
|
|
+ this.imgUploadError(3, res);
|
|
|
+ },
|
|
|
+ imgUploadError(type, res) {
|
|
|
+ if (res !== "break") {
|
|
|
+ this.$message.error("图片上传失败!");
|
|
|
+ this.$refs.ruleForm.validateField(
|
|
|
+ type === 1
|
|
|
+ ? "good_thumb_img"
|
|
|
+ : type === 2
|
|
|
+ ? "good_img"
|
|
|
+ : "good_info_img"
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //判断图片规格
|
|
|
+ beforeAvatarUpload(file) {
|
|
|
+ let isJPG = false;
|
|
|
+ if (
|
|
|
+ file.type === "image/jpg" ||
|
|
|
+ file.type === "image/png" ||
|
|
|
+ file.type === "image/jpeg"
|
|
|
+ ) {
|
|
|
+ isJPG = true;
|
|
|
+ }
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 1;
|
|
|
+ if (!isJPG) {
|
|
|
+ this.$message.error("图片格式不正确!");
|
|
|
+ }
|
|
|
+ if (!isLt2M) {
|
|
|
+ this.$message.error("图片大小不能超过 1MB!");
|
|
|
}
|
|
|
+ return isJPG && isLt2M;
|
|
|
},
|
|
|
},
|
|
|
- watch: {},
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|