|
@@ -78,7 +78,10 @@
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="商品名称:" prop="goodsName">
|
|
|
- <el-input v-model="step1Form.goodsName" placeholder="请输入商品名称" maxlength="200" show-word-limit></el-input>
|
|
|
+ <div style="display: flex">
|
|
|
+ <el-input v-model="step1Form.goodsName" placeholder="请输入商品名称" maxlength="200" show-word-limit></el-input>
|
|
|
+ <el-button v-if="type == 'add'" size="mini" @click="isSelectShop = true" type="primary">从商品库选择</el-button>
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
@@ -391,7 +394,10 @@
|
|
|
</el-popconfirm>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+ <!-- 选择商品 -->
|
|
|
+ <el-dialog title="选择商品" :visible.sync="isSelectShop" width="90%" style="max-height: 95vh;overflow-y: auto;" :close-on-click-modal="false" :modal-append-to-body="false">
|
|
|
+ <selectShopDetail @selectShop="selectShop" :isSelectShop="isSelectShop"></selectShopDetail>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -404,6 +410,8 @@ import 'quill/dist/quill.core.css'
|
|
|
import 'quill/dist/quill.snow.css'
|
|
|
import 'quill/dist/quill.bubble.css'
|
|
|
import { EventBus } from '@/utils/eventBus'
|
|
|
+import selectShopDetail from '../goodsWarehouse/detail'
|
|
|
+import { getDetail } from "@/api/goodsWarehouse";
|
|
|
// 工具栏配置
|
|
|
const toolbarOptions = [
|
|
|
['bold', 'italic', 'underline', 'strike'],
|
|
@@ -424,7 +432,7 @@ const toolbarOptions = [
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
|
- quillEditor
|
|
|
+ quillEditor,selectShopDetail
|
|
|
},
|
|
|
filters: {
|
|
|
unitFilter(val) {
|
|
@@ -548,7 +556,8 @@ export default {
|
|
|
tagList: [], // 标签列表
|
|
|
|
|
|
showImageListUpload2: false,
|
|
|
-
|
|
|
+ type: 'add',
|
|
|
+ isSelectShop: false //选择商品库
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -561,7 +570,8 @@ export default {
|
|
|
},
|
|
|
|
|
|
async created() {
|
|
|
- const { id } = this.$route.query;
|
|
|
+ const { id,type } = this.$route.query;
|
|
|
+ this.type = type
|
|
|
this.isEdit = id ? true : false;
|
|
|
this.editId = id;
|
|
|
|
|
@@ -580,7 +590,62 @@ export default {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
+ //选择商品库商品
|
|
|
+ selectShop(goodsLibraryId){
|
|
|
+ this.isSelectShop = false
|
|
|
+ if(goodsLibraryId){
|
|
|
+ getDetail({
|
|
|
+ goodsLibraryId
|
|
|
+ }).then(res => {
|
|
|
+ let imgs = []
|
|
|
+ let goodsLibrarySpecList = []
|
|
|
+ res.data.imgs.split(",").forEach(item=>{
|
|
|
+ imgs.push({
|
|
|
+ url: item
|
|
|
+ })
|
|
|
+ })
|
|
|
+ res.data.goodsLibrarySpecList.forEach(item=>{
|
|
|
+ goodsLibrarySpecList.push({
|
|
|
+ goodsCode: '', // 物料编号
|
|
|
+ mainId: '', // 大类id
|
|
|
+ mainName: '', // 大类名称
|
|
|
+ smallId: '', // 小类id
|
|
|
+ smallName: '', // 小类名称
|
|
|
+ specValue: item.specValue, // 商品名称
|
|
|
+ specsName: '', // 规格名称
|
|
|
+ unit: '', // 单位
|
|
|
+ price: item.price, // 销售价格
|
|
|
+ orgPrice: item.orgPrice, // 划线价格
|
|
|
+ costAmount: item.costPrice, // 成本价格
|
|
|
+ shareAmount: item.shareAmount, // 分销金额
|
|
|
+ innerShareAmount: item.innerShareAmount, // 内部分销金额
|
|
|
+ stockNum: '', // 上架库存
|
|
|
+ stockQty: '', // 当前库存
|
|
|
+ imgUrl: item.imgUrl, // 图片
|
|
|
+ })
|
|
|
+ })
|
|
|
+ this.step1Form = {
|
|
|
+ isTrade: 'NO', // 是否以旧换新
|
|
|
+ tradeRemark: '', // 以旧换新描述
|
|
|
+ brand: {}, // 品牌
|
|
|
+ orderSmallType: '', // 工单类型
|
|
|
+ isVr: false, // 是否虚拟商品
|
|
|
+ classify: '', // 商品分类
|
|
|
+ attrs: [], // 商品属性
|
|
|
+ tags: [], // 商品标签
|
|
|
+ goodsName: res.data.goodsName, // 商品名称
|
|
|
+ goodsDes: res.data.describeText, // 商品描述
|
|
|
+ imgUrl: res.data.imgUrl, // 商品主图
|
|
|
+ videoUrl: res.data.vedio, // 商品视频
|
|
|
+ images: res.data.imgs?imgs:[], // 轮播图
|
|
|
+ }
|
|
|
+ this.specList = goodsLibrarySpecList
|
|
|
+ this.step3Form.detailContent = res.data.content
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 获取商品分类列表
|
|
|
async getClassifyList() {
|
|
|
return new Promise((resolve, reject) => {
|