huangmp 1 rok pred
rodič
commit
22f2453d74

+ 108 - 2
src/components/order-card-item/index.vue

@@ -52,7 +52,8 @@
           <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==='choose'" type="text" size="mini" @click="openAddToCardLibDialog(item)">加入图集</el-button>
+<!--            <el-button v-if="mode==='choose'" type="text" size="mini" @click="openAddToCardLibDialog(item)">加入清单</el-button>-->
+            <el-button v-if="mode==='choose'" type="text" size="mini" @click="openAddToCardUserPurchaseDialog(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="openCanvasParamPicForm(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>
@@ -135,6 +136,68 @@
         <el-button :loading="addToCardLibLoading" class="default-btn primary-btn" type="primary" @click="addToCardLibSubmit()">{{$t("crud.filter.submitBtn")}}</el-button>
       </span>
     </el-dialog>
+    <el-dialog title="加入清单" :visible.sync="addToCardUserPurchaseVisible" :modal="false" width="80%">
+      <el-form
+        :model="userPurchaseDataForm"
+        size="small"
+        ref="dataForm"
+        label-width="80px">
+        <el-form-item prop="seriesId" label="清单名称">
+          <el-select v-model="userPurchaseDataForm.cardUserPurchaseId" clearable filterable>
+            <el-option
+              v-for="node in userPurchaseList"
+              :key="node.id"
+              :label="node.cardName"
+              :value="node.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item prop="seriesId" label="团队组合">
+          <el-select v-model="userPurchaseDataForm.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="userPurchaseDataForm.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 userPurchaseDataForm.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="addToCardUserPurchaseLoading" class="default-btn primary-btn" type="primary" @click="addToCardUserPurchaseSubmit()">{{$t("crud.filter.submitBtn")}}</el-button>
+      </span>
+    </el-dialog>
 
   </div>
 </template>
@@ -148,6 +211,9 @@
     components: {CanvasPreview, YuyinPreview,OrgPicPreview, CanvasParamPicPreview},
     data () {
       return {
+        userPurchaseList: [],
+        userPurchaseDataForm: {},
+        addToCardUserPurchaseVisible: false,
         shopId: this.$store.state.user.shopId,
         lang: localStorage.getItem('lang') || 'zh_CN',
         cardItemList:[],
@@ -162,6 +228,7 @@
         previewHeight: 0,
         bloodWidth: 0,
         addToCardLibLoading: false,
+        addToCardUserPurchaseLoading: false,
         cardLibItemDataForm:{},
         addToCardLibVisible: false,
         seriesList:[],
@@ -199,7 +266,6 @@
           method: 'POST',
           data: this.cardLibItemDataForm
         }).then(({data}) => {
-          this.addToCardLibLoading = false
           this.$message({
             message: '加入成功',
             type: 'success',
@@ -212,6 +278,39 @@
           })
         })
       },
+      addToCardUserPurchaseSubmit(){
+        this.$http({
+          url: this.$http.adornUrl('/prod/orderCardItem/addToCardUserPurchase'),
+          method: 'POST',
+          data: this.userPurchaseDataForm
+        }).then(({data}) => {
+          this.$message({
+            message: '加入成功',
+            type: 'success',
+            duration: 300,
+            onClose: () => {
+              this.addToCardUserPurchaseLoading = false
+              this.userPurchaseDataForm = {}
+              this.addToCardUserPurchaseVisible = false
+            }
+          })
+        })
+      },
+      getCardUserPurchaseList(){
+        this.$http({
+          url: this.$http.adornUrl('/card/cardUserPurchase/page'),
+          method: 'get',
+          params: this.$http.adornParams(
+            Object.assign({
+                size: 100,
+                shopId: 1
+              },
+            )
+          )
+        }).then(({data}) => {
+          this.userPurchaseList = data.records
+        })
+      },
       getSeriesList () {
         this.$http({
           url: this.$http.adornUrl('/prod/prodTemplateSeries/page'),
@@ -252,6 +351,13 @@
         this.addToCardLibVisible = true
         this.getSeriesList()
       },
+      openAddToCardUserPurchaseDialog(cardItem){
+        let addToCardUserPurchaseList = this.cardItemList.filter(item => item.isSelected === true)
+        this.userPurchaseDataForm.orderCardItemList = addToCardUserPurchaseList
+        this.addToCardUserPurchaseVisible = true
+        this.getCardUserPurchaseList()
+        this.getSeriesList()
+      },
       openCanvasParamPicForm(item, index){
         this.$nextTick(() =>{
           this.$refs.canvasParamPicPreviewRef.init(item)

+ 1 - 1
src/views/modules/pickCard/card-set-lib-add-or-update.vue

@@ -120,7 +120,7 @@ export default {
       page: {
         total: 0, // 总页数
         currentPage: 1, // 当前页数
-        pageSize: 300 // 每页显示多少条
+        pageSize: 500 // 每页显示多少条
       },
     }
   },

+ 1 - 1
src/views/modules/pickCard/card-user-purchase-item-add-or-update.vue

@@ -63,7 +63,7 @@
           </el-row>
         </div>
         <el-row style="width: 210px; height: 30px; text-align: center ;color: red; font-weight: bold">
-          <el-button v-if="mode==='edit' && cardItem.id" type="danger" size="mini" style="margin-right: 5px" @click="deleteCardItem(cardItem, index)">除</el-button>
+          <el-button v-if="mode==='edit' && cardItem.id" type="danger" size="mini" style="margin-right: 5px" @click="deleteCardItem(cardItem, index)">除</el-button>
         </el-row>
         <el-row style="width: 210px; height: 30px; text-align: center ;color: red; font-weight: bold">
           <span>数量:</span>

+ 73 - 9
src/views/modules/pickCard/card-user-purchase.vue

@@ -19,6 +19,10 @@
     </div>-->
     <!-- 列表相关区域 -->
     <div class="main-container">
+      <div class="operation-bar">
+        <div class="default-btn primary-btn" @click="addOrUpdateHandle()"
+        >新增清单</div>
+      </div>
       <div class="table-con spec-table">
         <el-table
           ref="specListTable"
@@ -32,22 +36,22 @@
               <span>{{ scope.row.cardName}}</span>
             </template>
           </el-table-column>
-          <!--<el-table-column label="清单编号" prop="seq" align="center">
-            <template slot-scope="scope">
-              <span>{{ scope.row.libNo}}</span>
-            </template>
-          </el-table-column>-->
           <el-table-column label="创建时间" prop="seq" align="center">
             <template slot-scope="scope">
               <span>{{ scope.row.createTime}}</span>
             </template>
           </el-table-column>
-
+          <el-table-column label="备注信息" prop="seq" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.remark}}</span>
+            </template>
+          </el-table-column>
           <el-table-column align="center" fixed="right" :label="$t('publics.operating')" width="auto">
             <template slot-scope="scope">
               <div class="text-btn-con">
-                <div class="default-btn text-btn" @click="addOrUpdateHandle(scope.row)">查看</div>
+                <div class="default-btn text-btn" @click="viewCardList(scope.row)">查看清单</div>
                 <div class="default-btn text-btn" @click="toCardLibPage(scope.row)">去选图</div>
+                <div class="default-btn text-btn" @click="addOrUpdateHandle(scope.row)">修改</div>
                 </div>
             </template>
           </el-table-column>
@@ -64,7 +68,25 @@
           :total="page.total">
         </el-pagination>
       </div>
-    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="refreshChange"></add-or-update>
+    <add-or-update v-if="viewCardVisible" ref="addOrUpdate" @refreshDataList="refreshChange"></add-or-update>
+    <el-dialog :title="cardUserPurchaseForm.id? '编辑清单':'新增清单'" :close-on-click-modal="false" v-if="addOrUpdateVisible" :visible.sync="addOrUpdateVisible" width="50%">
+      <el-form
+        :model="cardUserPurchaseForm"
+        size="small"
+        ref="cardUserPurchaseFormRef"
+        label-width="80px">
+        <el-form-item prop="cardName" label="清单名称">
+          <el-input type="text" v-model="cardUserPurchaseForm.cardName" placeholder="请输入清单名称"></el-input>
+        </el-form-item>
+        <el-form-item prop="remark" label="备注信息">
+          <el-input type="textarea" v-model="cardUserPurchaseForm.remark" placeholder="可输入备注信息"></el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <div class="default-btn"  @click="addOrUpdateVisible = false">取消</div>
+        <div class="default-btn primary-btn" @click="cardUserPurchaseFormSubmit">确定</div>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -73,6 +95,11 @@ import AddOrUpdate from './card-user-purchase-item-add-or-update'
 export default {
   data () {
     return {
+      cardUserPurchaseForm: {
+        id: null,
+        cardName: null,
+        remark: null,
+      },
       dataList: [],
       page: {
         total: 0, // 总页数
@@ -86,6 +113,7 @@ export default {
       usageList:[],
       seriesList: [],
       searchLoading: false,
+      viewCardVisible: false
     }
   },
   components: {
@@ -97,6 +125,33 @@ export default {
   mounted () {
   },
   methods: {
+    cardUserPurchaseFormSubmit(){
+      this.$http({
+        url: this.$http.adornUrl('/card/cardUserPurchase'),
+        method: this.cardUserPurchaseForm.id? 'PUT':'POST',
+        data: this.$http.adornData(this.cardUserPurchaseForm)
+      }).then(({data}) => {
+        this.addOrUpdateVisible = false
+        this.$refs.cardUserPurchaseFormRef.resetFields()
+        this.refreshChange()
+        if(data){
+          this.$message({
+            message: '提交成功',
+            type: 'success',
+          })
+        }else{
+          this.$message({
+            message: '提交失败',
+            type: 'success',
+          })
+        }
+      }).catch((e) => {
+        this.$message({
+          message: '提交异常',
+          type: 'success',
+        })
+      })
+    },
     getSeriesList (seriesName) {
       this.$http({
         url: this.$http.adornUrl('/prod/prodTemplateSeries/list'),
@@ -133,8 +188,17 @@ export default {
       })
     },
     // 新增 / 修改
-    addOrUpdateHandle (cardLib) {
+    addOrUpdateHandle (cardUserPurchase) {
       this.addOrUpdateVisible = true
+      if(cardUserPurchase && cardUserPurchase.id){
+        this.cardUserPurchaseForm.id = cardUserPurchase.id
+        this.cardUserPurchaseForm.cardName = cardUserPurchase.cardName
+        this.cardUserPurchaseForm.remark = cardUserPurchase.remark
+      }
+    },
+    // 新增 / 修改
+    viewCardList (cardLib) {
+      this.viewCardVisible = true
       this.$nextTick(() => {
         this.$refs.addOrUpdate.init(cardLib)
       })