|
|
@@ -4,73 +4,77 @@
|
|
|
<div v-if="showFlagBtn">
|
|
|
<el-radio v-model="mode" label="view">预览模式</el-radio>
|
|
|
<el-radio v-model="mode" label="edit">编辑模式</el-radio>
|
|
|
+ <el-radio v-model="mode" label="choose">选图模式</el-radio>
|
|
|
<el-button @click="openCanvasParamPicFormByOrderNumber(orderItem)" size="mini" type="text" v-if="orderItem.prodName.indexOf('简约') !== -1 || orderItem.prodName.indexOf('高阶') !== -1">查看工艺</el-button>
|
|
|
</div>
|
|
|
|
|
|
<div style="border: 2px solid pink; display: inline-block;margin-right: 5px;" v-for="(item, index) in cardItemList" :key="item.cardItemId">
|
|
|
- <el-row :gutter="12" style="padding-top: 5px">
|
|
|
- <el-col :span="12">
|
|
|
- <el-card :body-style="{ padding: '0px' }">
|
|
|
- <div style="padding: 3px; text-align: center">
|
|
|
- <span>正面</span>
|
|
|
- </div>
|
|
|
- <div v-if="mode=='view'" style="width: 100px;height: auto">
|
|
|
- <img :src="resourcesUrl + item.frontPic" @click="previewPic(item, item.frontPic, item.prodName, 'front')"/>
|
|
|
- </div>
|
|
|
- <el-upload v-else
|
|
|
- class="avatar-uploader"
|
|
|
- accept="image/jpg"
|
|
|
- :before-upload="(file, fileList)=>handleBeforeUpload(file, fileList,item)"
|
|
|
- :action="$http.adornUrl('/admin/file/simpleUpload')"
|
|
|
- :headers="{Authorization: $cookie.get('Authorization_vp'),locale:lang}"
|
|
|
- :on-success="(res,file)=>{onFrontUploadSuccess(item,res,file)}"
|
|
|
- :show-file-list="false">
|
|
|
- <img v-if="item.frontPic" style="width: 100px;height: auto" :src="resourcesUrl + item.frontPic" class="avatar">
|
|
|
- <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
- </el-upload>
|
|
|
- </el-card>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-card :body-style="{ padding: '0px' }">
|
|
|
- <div style="padding: 3px; text-align: center">
|
|
|
- <span>背面</span>
|
|
|
- </div>
|
|
|
- <div v-if="mode=='view'" style="width: 100px;height: auto">
|
|
|
- <img :src="resourcesUrl + item.backPic" @click="previewPic(item, item.backPic, item.prodName, 'back')"/>
|
|
|
- </div>
|
|
|
- <el-upload v-else
|
|
|
- class="avatar-uploader"
|
|
|
- :before-upload="(file, fileList)=>handleBeforeUpload(file, fileList,item)"
|
|
|
- :action="$http.adornUrl('/admin/file/simpleUpload')"
|
|
|
- :headers="{Authorization: $cookie.get('Authorization_vp'),locale:lang}"
|
|
|
- :on-success="(res,file)=>{onBackUploadSuccess(item,res,file)}"
|
|
|
- :show-file-list="false">
|
|
|
- <img v-if="item.backPic" style="width: 100px;height: auto" :src="resourcesUrl + item.backPic" class="avatar">
|
|
|
- <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
- </el-upload>
|
|
|
- </el-card>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row style="width: 210px; height: 30px; text-align: center ;color: red; font-weight: bold">
|
|
|
+ <div :style="mode === 'choose' && item.isSelected? divLightStyle : {border: '3px solid #fff'}" @click="cardItemSelect(item, index)">
|
|
|
+ <el-row :gutter="12" style="padding-top: 5px">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-card :body-style="{ padding: '0px' }">
|
|
|
+ <div style="padding: 3px; text-align: center">
|
|
|
+ <span>正面</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="mode=='view' || mode === 'choose'" style="width: 100px;height: auto">
|
|
|
+ <img :src="resourcesUrl + item.frontPic" @click="previewPic(item, item.frontPic, item.prodName, 'front')"/>
|
|
|
+ </div>
|
|
|
+ <el-upload v-else
|
|
|
+ class="avatar-uploader"
|
|
|
+ accept="image/jpg"
|
|
|
+ :before-upload="(file, fileList)=>handleBeforeUpload(file, fileList,item)"
|
|
|
+ :action="$http.adornUrl('/admin/file/simpleUpload')"
|
|
|
+ :headers="{Authorization: $cookie.get('Authorization_vp'),locale:lang}"
|
|
|
+ :on-success="(res,file)=>{onFrontUploadSuccess(item,res,file)}"
|
|
|
+ :show-file-list="false">
|
|
|
+ <img v-if="item.frontPic" style="width: 100px;height: auto" :src="resourcesUrl + item.frontPic" class="avatar">
|
|
|
+ <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
+ </el-upload>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-card :body-style="{ padding: '0px' }">
|
|
|
+ <div style="padding: 3px; text-align: center">
|
|
|
+ <span>背面</span>
|
|
|
+ </div>
|
|
|
+ <div v-if="mode=='view' || mode === 'choose'" style="width: 100px;height: auto">
|
|
|
+ <img :src="resourcesUrl + item.backPic" @click="previewPic(item, item.backPic, item.prodName, 'back')"/>
|
|
|
+ </div>
|
|
|
+ <el-upload v-else
|
|
|
+ class="avatar-uploader"
|
|
|
+ :before-upload="(file, fileList)=>handleBeforeUpload(file, fileList,item)"
|
|
|
+ :action="$http.adornUrl('/admin/file/simpleUpload')"
|
|
|
+ :headers="{Authorization: $cookie.get('Authorization_vp'),locale:lang}"
|
|
|
+ :on-success="(res,file)=>{onBackUploadSuccess(item,res,file)}"
|
|
|
+ :show-file-list="false">
|
|
|
+ <img v-if="item.backPic" style="width: 100px;height: auto" :src="resourcesUrl + item.backPic" class="avatar">
|
|
|
+ <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
+ </el-upload>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row style="width: 210px; height: 30px; text-align: center ;color: red; font-weight: bold">
|
|
|
<span v-if="showFlagBtn">
|
|
|
<el-button v-if="item.flag==0 && mode=='view'" type="success" size="mini" style="margin-right: 20px" @click="handleFlag(item, index)">待标记</el-button>
|
|
|
<el-button v-if="item.flag==1 && mode=='view'" type="warning" size="mini" style="margin-right: 5px" @click="handleFlag(item, index)">已标记</el-button>
|
|
|
- <el-button v-if="mode=='view'" type="text" size="mini" @click="openOrgPicForm(item, index)">原图</el-button>
|
|
|
- <el-button v-if="mode=='view' && (orderItem.prodName.indexOf('简约') !== -1 || orderItem.prodName.indexOf('高阶') !== -1)" type="text" size="mini" @click="openCanvasParamPicFormByItem(item, index)">工艺</el-button>
|
|
|
+ <el-button v-if="mode==='choose'" type="text" size="mini" @click="openAddToCardLibDialog(item)">加入图集</el-button>
|
|
|
+ <el-button v-if="mode==='view'" type="text" size="mini" @click="openOrgPicForm(item, index)">原图</el-button>
|
|
|
+ <el-button v-if="mode==='view' && (orderItem.prodName.indexOf('简约') !== -1 || orderItem.prodName.indexOf('高阶') !== -1)" type="text" size="mini" @click="openCanvasParamPicFormByItem(item, index)">工艺</el-button>
|
|
|
<el-button v-if="(item.prodName.indexOf('语音') !== -1 || item.prodName.toLowerCase().indexOf('ar') !== -1) && mode=='view'" type="text" size="mini" @click="openYYForm(item, index)">查看语音</el-button>
|
|
|
<el-button v-if="mode==='edit'" type="primary" size="mini" style="margin-right: 5px" @click="addOrUpdateCardItem(item)">保存</el-button>
|
|
|
<el-button v-if="mode==='edit' && item.cardItemId" type="danger" size="mini" style="margin-right: 5px" @click="deleteCardItem(item, index)">删除</el-button>
|
|
|
</span>
|
|
|
- </el-row>
|
|
|
- <el-row style="width: 210px; height: 30px; text-align: center ;color: red; font-weight: bold">
|
|
|
- <span>No.{{index + 1}}</span>
|
|
|
- <span v-if="showFlagBtn" style="color: white">
|
|
|
+ </el-row>
|
|
|
+ <el-row style="width: 210px; height: 30px; text-align: center ;color: red; font-weight: bold">
|
|
|
+ <span>No.{{index + 1}}</span>
|
|
|
+ <span v-if="showFlagBtn" style="color: white">
|
|
|
__________
|
|
|
</span>
|
|
|
- <span>X</span>
|
|
|
- <span v-if="mode=='view'">{{item.prodCount}}</span>
|
|
|
- <el-input type="number" size="mini" style="width: 60px;height: 20px" v-if="mode=='edit'" v-model="item.prodCount"></el-input>
|
|
|
- </el-row>
|
|
|
+ <span>X</span>
|
|
|
+ <span v-if="mode=='view'">{{item.prodCount}}</span>
|
|
|
+ <el-input type="number" size="mini" style="width: 60px;height: 20px" v-if="mode=='edit'" v-model="item.prodCount"></el-input>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div v-if="mode=='edit'" style="display: inline-block;">
|
|
|
<el-button
|
|
|
@@ -84,7 +88,58 @@
|
|
|
<YuyinPreview ref="yuYinPreviewRef"></YuyinPreview>
|
|
|
<OrgPicPreview ref="orgPicPreviewRef"></OrgPicPreview>
|
|
|
<CanvasParamPicPreview ref="canvasParamPicPreviewRef"></CanvasParamPicPreview>
|
|
|
-
|
|
|
+ <el-dialog title="加入图集" :visible.sync="addToCardLibVisible" :modal="false" width="80%">
|
|
|
+ <el-form
|
|
|
+ :model="cardLibItemDataForm"
|
|
|
+ size="small"
|
|
|
+ ref="dataForm"
|
|
|
+ label-width="80px">
|
|
|
+ <el-form-item prop="seriesId" label="团队组合">
|
|
|
+ <el-select v-model="cardLibItemDataForm.seriesId" clearable filterable @change="selectSeries">
|
|
|
+ <el-option
|
|
|
+ v-for="node in seriesList"
|
|
|
+ :key="node.seriesId"
|
|
|
+ :label="node.seriesName"
|
|
|
+ :value="node.seriesId"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="personId" label="成员名称" class="search-form-item">
|
|
|
+ <el-select v-model="cardLibItemDataForm.personId" placeholder="请选择爱豆" clearable filterable>
|
|
|
+ <el-option v-for="person in personList" :label="person.personName" :value="person.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <div class="create-card-lib" v-for="(card, index) in cardLibItemDataForm.orderCardItemList" :key="index">
|
|
|
+ <el-row :gutter="12" style="padding-top: 5px">
|
|
|
+ <span class="num">{{card.num}}</span>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-card :body-style="{ padding: '0px' }">
|
|
|
+ <div style="padding: 3px; text-align: center">
|
|
|
+ <span>正面</span>
|
|
|
+ </div>
|
|
|
+ <div style="width: 100px;height: auto">
|
|
|
+ <img :src="resourcesUrl + card.frontPic"/>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-card :body-style="{ padding: '0px' }">
|
|
|
+ <div style="padding: 3px; text-align: center">
|
|
|
+ <span>背面</span>
|
|
|
+ </div>
|
|
|
+ <div style="width: 100px;height: auto">
|
|
|
+ <img :src="resourcesUrl + card.backPic"/>
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button class="default-btn">{{$t("crud.filter.cancelBtn")}}</el-button>
|
|
|
+ <el-button :loading="addToCardLibLoading" class="default-btn primary-btn" type="primary" @click="addToCardLibSubmit()">{{$t("crud.filter.submitBtn")}}</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -97,6 +152,8 @@
|
|
|
components: {CanvasPreview, YuyinPreview,OrgPicPreview, CanvasParamPicPreview},
|
|
|
data () {
|
|
|
return {
|
|
|
+ addToCardLibLoading: false,
|
|
|
+ cardLibItemDataForm:{},
|
|
|
lang: localStorage.getItem('lang') || 'zh_CN',
|
|
|
cardItemList:[],
|
|
|
previewPicUrl: null,
|
|
|
@@ -109,6 +166,10 @@
|
|
|
previewWidth: 0,
|
|
|
previewHeight: 0,
|
|
|
bloodWidth: 0,
|
|
|
+ addToCardLibVisible: false,
|
|
|
+ seriesList:[],
|
|
|
+ personList:[],
|
|
|
+ divLightStyle: {border: '3px solid red'},
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
|
@@ -127,6 +188,73 @@
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ cardItemSelect(cardItem, index){
|
|
|
+ if (cardItem.isSelected) {
|
|
|
+ cardItem.isSelected = false
|
|
|
+ } else {
|
|
|
+ cardItem.isSelected = true
|
|
|
+ }
|
|
|
+ this.$set(this.cardItemList, index, cardItem)
|
|
|
+ },
|
|
|
+ addToCardLibSubmit(){
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl('/prod/orderCardItem/addToCardLib'),
|
|
|
+ method: 'POST',
|
|
|
+ data: this.cardLibItemDataForm
|
|
|
+ }).then(({data}) => {
|
|
|
+ this.addToCardLibLoading = false
|
|
|
+ this.$message({
|
|
|
+ message: '加入成功',
|
|
|
+ type: 'success',
|
|
|
+ duration: 300,
|
|
|
+ onClose: () => {
|
|
|
+ this.addToCardLibLoading = false
|
|
|
+ this.cardLibItemDataForm = {}
|
|
|
+ this.addToCardLibVisible = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getSeriesList () {
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl('/prod/prodTemplateSeries/page'),
|
|
|
+ method: 'get',
|
|
|
+ params: this.$http.adornParams(
|
|
|
+ Object.assign({
|
|
|
+ size: 100,
|
|
|
+ shopId: 1
|
|
|
+ },
|
|
|
+ )
|
|
|
+ )
|
|
|
+ }).then(({data}) => {
|
|
|
+ this.seriesList = data.records
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selectSeries(seriesId){
|
|
|
+ this.personList = []
|
|
|
+ this.getPersonList(seriesId)
|
|
|
+ },
|
|
|
+ getPersonList (seriesId) {
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl('/cardLib/cardPerson/page'),
|
|
|
+ method: 'get',
|
|
|
+ params: this.$http.adornParams(
|
|
|
+ Object.assign({
|
|
|
+ size: 100,
|
|
|
+ seriesId: seriesId
|
|
|
+ },
|
|
|
+ )
|
|
|
+ )
|
|
|
+ }).then(({data}) => {
|
|
|
+ this.personList = data.records
|
|
|
+ })
|
|
|
+ },
|
|
|
+ openAddToCardLibDialog(cardItem){
|
|
|
+ let addToCardLibList = this.cardItemList.filter(item => item.isSelected === true)
|
|
|
+ this.cardLibItemDataForm.orderCardItemList = addToCardLibList
|
|
|
+ this.addToCardLibVisible = true
|
|
|
+ this.getSeriesList()
|
|
|
+ },
|
|
|
openYYForm(item, index){
|
|
|
this.$nextTick(() =>{
|
|
|
this.$refs.yuYinPreviewRef.init(item)
|
|
|
@@ -248,20 +376,26 @@
|
|
|
}else if(prodName.indexOf("游戏") !== -1){
|
|
|
width = 803;
|
|
|
height = 1098;
|
|
|
+ }else if(prodName.indexOf("大3寸") !== -1){
|
|
|
+ width = 732;
|
|
|
+ height = 1028;
|
|
|
+ }else if(prodName.indexOf("透明胶片拍立得") !== -1){
|
|
|
+ width = 768;
|
|
|
+ height = 768;
|
|
|
}
|
|
|
let _URL = window.URL || window.webkitURL;
|
|
|
let img = new Image();
|
|
|
img.onload = function() {
|
|
|
- let valid = img.width == width && img.height == height;
|
|
|
- valid ? resolve() : reject();
|
|
|
+ let valid = img.width === width && img.height === height
|
|
|
+ valid ? resolve() : reject()
|
|
|
};
|
|
|
- img.src = _URL.createObjectURL(file);
|
|
|
+ img.src = _URL.createObjectURL(file)
|
|
|
}).then(
|
|
|
() => {
|
|
|
return file;
|
|
|
},
|
|
|
() => {
|
|
|
- this.$message.error("上传的图片宽高必须是" + width + "*" + height);
|
|
|
+ this.$message.error("上传的图片宽高必须是" + width + "*" + height)
|
|
|
return Promise.reject();
|
|
|
}
|
|
|
);
|
|
|
@@ -403,6 +537,10 @@
|
|
|
this.prodType = '5寸直角卡';
|
|
|
}else if(prodName.indexOf('游戏') != -1){
|
|
|
this.prodType = '游戏';
|
|
|
+ }else if(prodName.indexOf('大3寸') != -1){
|
|
|
+ this.prodType = '大3寸';
|
|
|
+ }else if(prodName.indexOf('透明胶片拍立得') != -1){
|
|
|
+ this.prodType = '透明胶片拍立得';
|
|
|
}
|
|
|
this.$nextTick(() =>{
|
|
|
this.$refs.canvasPreviewRef.init(cardItem, this.resourcesUrl + picUrl, this.prodType, side)
|
|
|
@@ -481,4 +619,22 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .create-card-lib{
|
|
|
+ border: 2px solid pink;
|
|
|
+ display: inline-block;
|
|
|
+ margin-right: 15px;
|
|
|
+ .num{
|
|
|
+ position: absolute;
|
|
|
+ display:flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ left: 5px;
|
|
|
+ top: 0px;
|
|
|
+ color: white;
|
|
|
+ border-radius: 100%;
|
|
|
+ background-color: red;
|
|
|
+ width: 20px;
|
|
|
+ height: 20px
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|