浏览代码

10211650nt

liuhj 6 月之前
父节点
当前提交
dcda33b7e8
共有 2 个文件被更改,包括 44 次插入8 次删除
  1. 6 1
      src/components/MCR/Marketingamount.vue
  2. 38 7
      src/components/Resource/TranslatorBase.vue

+ 6 - 1
src/components/MCR/Marketingamount.vue

@@ -57,7 +57,7 @@
             </el-form>
             <el-form ref="form" label-width="75px">
                 <el-form-item label="年份:">
-                    <el-select @change="PostMarketingSalesGroupList($event,1)" filterable v-model="years" placeholder="请选择年">
+                    <el-select @change="changeyear" filterable v-model="years" placeholder="请选择年">
                         <el-option v-for="(item,index) in yearsarr" :key="index" :label="item.year" :value="item.year"></el-option>
                     </el-select>
                 </el-form-item>
@@ -645,6 +645,11 @@ export default {
             }
             this.MPostMarketingSalesStatistic()
         },
+        //年切换
+        changeyear(val){
+            this.currentPage=1;
+            this.PostMarketingSalesGroupList(val,1)
+        },
         //市场部销售额团组列表
         PostMarketingSalesGroupList(val,index) {
             this.fullscreenLoading=true;

+ 38 - 7
src/components/Resource/TranslatorBase.vue

@@ -66,6 +66,14 @@
                     <!-- <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div> -->
                     </el-upload>
                 </el-form-item>
+                <el-form-item style="width:100%" label="备注">
+                    <el-input
+                    type="textarea"
+                    :rows="2"
+                    placeholder="请输入内容"
+                    v-model="ruleForm.remark">
+                    </el-input>
+                </el-form-item>
                 <div class="TranslatorBase-form-btn">
                     <el-button type="primary" @click="submitForm('ruleForm')">保存</el-button>
                     <!-- <el-button @click="resetForm('ruleForm')">重置</el-button> -->
@@ -164,6 +172,7 @@ export default {
                 region: '',
             },
             currencyarr:[],
+            opStatus:1,
             rules: {
                 area: [
                     { required: true, message: '请输入所在地区', trigger: 'blur' },
@@ -226,7 +235,6 @@ export default {
         },
         //表单初始化
         formInitialization(){
-            this.Id=0;
             this.ruleForm= {
                 area:'',
                 name: '',
@@ -246,12 +254,16 @@ export default {
         },
         //新增
         abbtlbBtn(){
+            this.Id=0;
+            this.opStatus=1;
             this.formInitialization();
             this.$nextTick(() => {  this.$refs['ruleForm'].clearValidate();});
             this.TranslatorBaseform=true;
         },
         //编辑
         edittib(index,val){
+            this.formInitialization();
+            this.opStatus=2;
             this.imageUrl=''
             // this.$nextTick(() => {  this.$refs['ruleForm'].clearValidate();});
             this.TranslatorBaseform=true;
@@ -274,9 +286,21 @@ export default {
                     that.ruleForm.language=res.data.data.language;
                     that.ruleForm.price=res.data.data.price;
                     that.ruleForm.currency=res.data.data.currency;
-                    that.ruleForm.photo=that.base64ImgtoFile(res.data.data.photo);
+                    that.ruleForm.photo=res.data.data.photo;
                     console.log(that.ruleForm.photo);
                     that.imageUrl=res.data.data.photo;
+                    console.log(res.data.data.files);
+                    var files=JSON.parse(res.data.data.files)
+                    console.log(files);
+                    
+                    if (res.data.data.files!="") {
+                        for(let i=0;i<files.length;i++){
+                            that.fileList.push({'name':files[i]})
+                        }
+                        console.log(that.ruleForm.files);
+                    }
+                    
+                    // that.ruleForm.files
                     // console.log();
                 } else {
                     that.$message.error(res.data.msg);
@@ -325,7 +349,7 @@ export default {
         submitForm(formName) {
             this.$refs[formName].validate((valid) => {
                 if (valid) {
-                    this.TranslatorLibraryOp(1)
+                    this.TranslatorLibraryOp()
                 } else {
                     console.log('error submit!!');
                     return false;
@@ -369,6 +393,8 @@ export default {
         //附件
         // 文件状态改变时的钩子,添加文件、上传成功和上传失败时都会被调用,function(file, fileList)
         handleChange(file, fileList) {
+            console.log(fileList);
+            
             if (file.status !== 'ready') return;
             this.fileList = fileList;
             const formData = []
@@ -380,7 +406,7 @@ export default {
             this.ruleForm.files=formData
         },
         //保存
-        TranslatorLibraryOp(opStatus){
+        TranslatorLibraryOp(){
             var that = this;
             var url = "api/Resource/TranslatorLibraryOp"
             this.$axios({
@@ -392,7 +418,7 @@ export default {
                 },
                 data:{
                     portType:1,
-                    status:opStatus,
+                    status:that.opStatus,
                     id:that.Id,
                     area:that.ruleForm.area,
                     name:that.ruleForm.name,
@@ -406,11 +432,16 @@ export default {
                     price:that.ruleForm.price,
                     currency:that.ruleForm.currency,
                     files:that.ruleForm.files,
-                    remark:'',
+                    remark:that.ruleForm.remark,
                 }
             }).then(function (res) {
                 if (res.data.code == 200) {
-                    
+                    that.$message({
+                        message: res.data.msg,
+                        type: 'success'
+                    });
+                    that.TranslatorBaseform=false;
+                    that.TranslatorLibraryItem();
                 } else {
                     that.$message.error(res.data.msg);
                 }