{
  template: '${tmpl}',
    data: function() {
      var validateSFZ = (rule, value, callback) => {
        if (this.form.applier.type == "person" && value == "") {
          callback(new Error('身份证明不能为空'));
        } else {
          callback();
        }
      };
      return {
        showUploadStuff: false,
        stuff: {},
        loading: false,
        loading1: false,
        loading2: false,
        loading3: false,
        channelOrderNums: [],
        showtransfer: false,
        transferform: {},
        transferRules: {
          mobile: [
            { required: true, message: '请输入接收人电话' },
          ]
        },
        showUploadStuffForm: {
          mobile: [
            { required: true, message: '请输入接收人电话' },
          ]
        },
        tableDataDialogTableVisible: false,
        activeNames: [0],
        d: {},
        action: "",
        title: "",
        multipleSelection: [],
        isSingleSelect: false,
        c: "hello",
        tableData: [],
        showData: 0,
        stepOneShow: 0,
        step: 0,
        bizcode: "",
        steps: [
          { title: "订单号查询信息" },
          { title: "确认商标信息" },
          { title: "提交材料" }
        ],
        form: {
          query: {
            orderNum: "",
            tsclType: "4",
          },
          applier: {
            type: "",
            applyName: "",
            creditCode: "",
            applyAddr: "",
            identityCard: "",
            businessLicensePic: "",
            identityCardPic: "",
            priority_to_prove: "",
          },
          customer: {
            customerContact: "",
            mobile: "",
            email: "",
            zipCode: "",
            fax: "",
          },
          tminfo: [],
        },
        queryRules: {
          orderNum: [
            { required: true, message: '请输入订单号' },
          ],
          tsclType: [
            { required: true, message: '请选择处理类型' },
          ],
        },
        applierRules: {
          businessLicensePic: [
            { required: true, message: '营业执照不能为空' }
          ],
          identityCardPic: [{ validator: validateSFZ, trigger: 'blur' }],
        },
        customerRules: {
          customerContact: [
            { required: true, message: '请输入联系人名称' }
          ],
          mobile: [
            { required: true, message: '请输入联系电话' },
          ],
          zipCode: [
            { required: true, message: '请输入邮政编码' },
          ],
        },
        tmlistRules: {},
      }
    },
  mounted: function() {
    var that = this;
    this.$root.postReq("/web/uploadCtl/getOssConfig", "").then(function (d) {
      that.d["key"] = "key";
      that.d["Bucket"] = d.Bucket;
      that.d["OSSAccessKeyId"] = d.OSSAccessKeyId;
      that.d["Signature"] = d.Signature;
      that.d["policy"] = d.policy;
      that.d["success_action_status"] = d.success_action_status;
      that.action = d.url;
    });
  },
  created: function() {
    console.log(this.codePath);
    if (this.codePath.indexOf("alltrademark") >= 0) {
      this.bizCode = "alltrademark";
    } else {
      this.bizCode = "trademark";
    }
  },
  methods: {
    uploadStuffs(){

    },
    orderQuery(){
      var that = this;
      that.$refs.query.validate((valid) => {
        if (valid) {
          that.form.applier = {
            type: "",
            applyName: "",
            creditCode: "",
            applyAddr: "",
            identityCard: "",
            businessLicensePic: "",
            identityCardPic: "",
            priority_to_prove: "",
          };
          that.form.customer = {
            customerContact: "",
            mobile: "",
            email: "",
            zipCode: "",
            fax: "",
          };
          that.form.tminfo = [];
          var obj = { orderNum: that.form.query.orderNum, tmStatus: that.form.query.tsclType, appCode: 100099 };
          this.$root.getReq("/web/trademarkCtl/getOrderDetail", obj).then(function (d) {
            if (d.code == 1) {
              if (d.data.customer && d.data.applier && d.data.tms.count > 0) {
                that.stepOneShow = 12;
                that.form.customer = d.data.customer;
                that.form.applier = d.data.applier;
                var calcs = d.data.tms.rows;
                var bindNclList = [];
                for (var i = 0; i < calcs.length; i++) {
                  var tItem = calcs[i];
                  var nclFindIndex1 = bindNclList.findIndex(f => f.tmName === tItem.tmName);
                  if (nclFindIndex1 < 0) {
                    var nclItem = {
                      id: tItem.id,
                      tmpPicUrl: "picUrl",
                      tmpColorizedPicUrlOne: "colorizedPicUrlOne",
                      tmpColorizedPicUrlTwo: "colorizedPicUrlTwo",
                      tmName: tItem.tmName,
                      sealAuthorizeStuff: tItem.sealAuthorizeStuff,
                      tmFormTypeName: tItem.tmFormTypeName,
                      picUrl: tItem.picUrl,
                      tmFormType: tItem.tmFormType,
                      colorizedPicUrl: tItem.colorizedPicUrl,
                      proxyCode: tItem.proxyCode,
                      tmRegistNum: tItem.tmRegistNum,
                      ncl: []
                    };
                    bindNclList.push(nclItem);
                  }
                  var nclFindIndex2 = bindNclList.findIndex(f => f.tmName === tItem.tmName);
                  var tmpNcl = {
                    code: tItem.nclOneCodes,
                    name: "",
                    proxyCode: tItem.proxyCode,
                    nclThree: JSON.parse(tItem.nclSmallCodes)
                  };
                  bindNclList[nclFindIndex2].ncl.push(tmpNcl);
                }
                that.form.tminfo = bindNclList;
              } else {
                that.$refs.grid.$message({
                  showClose: true,
                  type: 'warning',
                  duration: 6000,
                  message: `订单状态正常，无需处理`
                });
              }
            } else {
              that.$message.warning(`操作失败，请刷新页面后重新操作`);
            }
          }).catch(function (e) {
            that.$message.warning(`操作失败，请刷新页面后重tmlistRules新操作`);
          });
        } else {
          this.$message.warning("请完善填写的数据再进行查询");
        }
      }
      );
    },
    tonext(){
      if (this.step == "1") {
        this.$refs.applier.validate((valid) => {
          if (valid) {
            this.$refs.customer.validate((valid) => {
              if (valid) {
                this.step = Number(this.step) + 1;
                this.step = this.step.toString();
              }
            });
          }
        });
      } else {
        this.step = Number(this.step) + 1;
        this.step = this.step.toString();
      }
    },
    tobefore(){
      this.step = Number(this.step) - 1;
      this.step = this.step.toString();
    },
    beforeUpload(file){
      var that = this;
      var isSize = false;
      var img = new Image();
      var _URL = window.URL || window.webkitURL;
      img.onload = function () {
        console.log("11");
        if (img.width == img.height) {
          isSize = true;
          that.$refs.ys_upload.ifupload = true;
        } else {
          isSize = false;
          that.$message.warning('上传的图片宽高必须相等');
          that.$refs.ys_upload.$refs.upload.abort(file);
        }
      };
      img.src = window.URL.createObjectURL(file);

    },
    uploadsuccess(obj){
      var that = this;
      if (obj.flag == "yyzz") {
        that.$root.showMask();
        this.$root.getReq("/web/orderCtl/pic2pdf", { "key": obj.key }).then(function (d) {
          if (d.status == 0) {
            that.form.applier.businessLicensePic = d.data.url;
          } else {
            that.form.applier.businessLicensePic = "";
            that.$root.hideMask();
            that.$message.warning(`上传失败请重新上传`);
            return false;
          }
          that.$root.hideMask();
        }).catch(function (e) {
          that.form.applier.businessLicensePic = "";
          that.$root.hideMask();
          that.$message.warning(`上传失败请重新上传`);
          return false;
        })
      }
      if (obj.flag == "sfz") {
        that.$root.showMask();
        this.$root.getReq("/web/orderCtl/pic2pdf", { "key": obj.key }).then(function (d) {
          if (d.status == 0) {
            that.form.applier.identityCardPic = d.data.url;
          } else {
            that.form.applier.identityCardPic = "";
            that.$root.hideMask();
            that.$message.warning(`上传失败请重新上传`);
            return false;
          }
          that.$root.hideMask();
        }).catch(function (e) {
          that.form.applier.identityCardPic = "";
          that.$root.hideMask();
          that.$message.warning(`上传失败请重新上传`);
          return false;
        })
      }
    },
    error(err){
      this.$message.warning(`上传失败，请重新上传`);
    },
    success(obj){

    },
    uploadsuccess2(result, obj){
      var that = this;
      that.$refs[obj.flag][0].result = "";
      that.$root.showMask();
      this.$root.getReq("/web/orderCtl/adjustWTSSize", { "key": obj.key }).then(function (d) {
        if (d.status == 0) {
          that.$refs[obj.flag][0].result = d.data.url;
          that.$root.hideMask();
        } else {
          that.$refs[obj.flag][0].result = "";
          that.$root.hideMask();
          that.$message.warning(`上传失败请重新上传`);
          return false;
        }

      }).catch(function () {
        that.$refs[obj.flag][0].result = "";
        that.$root.hideMask();
        that.$message.warning(`上传失败请重新上传`);
        return false;
      });
    },
    uploadsuccessTmInfo(result){
      var that = this;
      if (result.flag.indexOf("picUrl") >= 0) {
        this.$root.getReq("/web/calculatepriceCtl/toblack", { "key": result.key }).then(function (d) {
          if (d.status == 0) {
            result.dataSouce.picUrl = d.data.url;
            that.$root.hideMask();
          } else {
            that.$root.hideMask();
            that.$message.warning(`上传失败请重新上传`);
            return false;
          }

        }).catch(function () {
          that.$root.hideMask();
          that.$message.warning(`上传失败请重新上传`);
          return false;
        });
      }
      if (result.flag.indexOf("colorizedPicUrl") >= 0) {
        this.$root.getReq("/web/calculatepriceCtl/adjustTMSize", { "key": result.key }).then(function (d) {
          if (d.status == 0) {
            result.dataSouce.colorizedPicUrl = d.data.url;
            that.$root.hideMask();
          } else {
            that.$root.hideMask();
            that.$message.warning(`上传失败请重新上传`);
            return false;
          }

        }).catch(function () {
          that.$root.hideMask();
          that.$message.warning(`上传失败请重新上传`);
          return false;
        });

      }
    },
    word2pic(rowObj){
      if (rowObj.tmName == "" || rowObj.tmName == null) {
        this.$root.showMask();
        this.$root.hideMask();
        return false;
      }
      var obj = { word: rowObj.tmName };
      var that = this;
      this.$root.showMask();
      this.$root.getReq("/web/calculatepriceCtl/word2pic", obj).then(function (d) {
        if (d.status == 0) {
          rowObj.picUrl = d.data.url;
          that.$root.hideMask();
        } else {
          rowObj.picUrl = "";
          that.$root.hideMask();
          that.$message.warning(`上传失败请重新生成`);
          return false;
        }

      }).catch(function () {
        rowObj.picUrl = "";
        that.$root.hideMask();
        that.$message.warning(`上传失败请重新生成`);
        return false;
      });
    },
    orderSubmit(){
      var that = this;
      this.$refs.stuff.validate((valid) => {
        if (valid) {
          for (var i = 0; i < that.form.tminfo.length; i++) {
            var wts = that.form.tminfo[i].sealAuthorizeStuff;
            if (wts == "" || wts == null || wts == undefined) {
              that.$message.warning(`委托书不能为空`);
              return false;
            }
          }
          var obj = { order: this.form.query, tms: this.form.tminfo, applier: this.form.applier, customer: this.form.customer };
          that.$root.postReq("/web/orderCtl/tsclResubmit", obj).then(function (d) {
            if (d.code == "1") {
              that.step = "1";
              that.$refs.grid.$message({
                showClose: true,
                type: 'success',
                duration: 6000,
                message: '提报成功，请在商标档案查看商标进度!'
              });
              that.$refs.card.changeButtonState();
              that.$refs.grid.hideDlgForm();
              that.title = "商标档案";
              that.$root.hideMask();
              that.$refs.grid.fetchData();
            } else {
              that.$message.warning(`操作失败，请刷新页面后重新操作`);
            }
          }).catch(function (e) {
            that.$message.warning(`操作失败，请刷新页面后重新操作`);
          });

        }
      });
    },

    /*列表*/
    dateFormat(row, column) {
      if (!row.created_at || row.created_at == undefined) {
        return "";
      }
      var date = new Date(row.created_at);
      var year = date.getFullYear();
      var month = (date.getMonth() + 1) < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1);
      var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
      return year + '-' + month + '-' + day;
    },
    formatTime(data){
      if (data) {
        var d = new Date(data);
        var datetime = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate();
        return datetime;
      } else {
        return "";
      }

    },
    tableToExcel(jsonData){
      var str = "<tr>";
      str = str + "<td>需求ID</td>";
      str = str + "<td>代理号</td>";
      str = str + "<td>订单号</td>";
      str = str + "<td>申请人</td>";
      str = str + "<td>商标号</td>";
      str = str + "<td>商标名称</td>";
      str = str + "<td>尼斯类型</td>";
      str = str + "<td>商标状态</td>";
      str = str + "<td>创建时间</td>";
      str = str + "<td>提报时间</td>";
      str = str + "<td>来源</td>";
      str = str + "<td>支付状态</td>";
      str = str + "<td>尼斯小类</td>";
      str = str + "<td>办理尼斯数量</td>";
      str = str + "</tr>";
      for (var i = 0; i < jsonData.length; i++) {
        str += '<tr>';
        var jdata = jsonData[i];
        var nclSmallCodes = jdata.nclSmallCodes;
        var reg = /\"name\":\"(.+?)\"/g;
        var nclSmalls = "";
        while((result=reg.exec(nclSmallCodes))!=null){
          nclSmalls = nclSmalls+result[1]+";";
        
        }
        str = str + "<td>需求ID：" + jdata.needId + "</td>";
        str = str + "<td>代理号：" + jdata.proxyCode + "</td>";
        str = str + "<td>订单号：" + jdata.channelOrderNum + "</td>";

        str = str + "<td>" + jdata.applyName + "</td>";
        str = str + "<td>" + jdata.tmRegistNum + "</td>";
        str = str + "<td>" + jdata.tmName + "</td>";
        str = str + "<td>" + jdata.nclOneCodes + "</td>";

        str = str + "<td>" + jdata.tmStatusName + "</td>";
        var time = this.formatTime(jdata.created_at);
        str = str + "<td>" + time + "</td>";
        var time2 = this.formatTime(jdata.submitTime);
        str = str + "<td>" + time2 + "</td>";
        str = str + "<td>" + jdata.tmSourceTypeName + "</td>";
        str = str + "<td>" + jdata.channelPayStatusName + "</td>";
        str = str + "<td>" + nclSmalls + "</td>";
        str = str + "<td>" + jdata.nclCount + "</td>";
        str += "</tr>";
      }

      var worksheet = "Sheet1";
      var uri = 'data:application/vnd.ms-excel;base64,';

      var template = "<html xmlns:o=\'urn:schemas-microsoft-com:office:office\' xmlns:x=\'urn:schemas-microsoft-com:office:excel\' xmlns=\'http://www.w3.org/TR/REC-html40\'>" +
        "<head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>" + worksheet + "</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet>" +
        "</x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>" + str + "</table></body></html>";
      var oa = document.getElementById("grid2_export");
      oa.href = uri + this.base64(template);
      oa.download = "导出.xls";
      oa.click();
      oa.style.display = 'none';
    },
    base64(s) {
      return window.btoa(unescape(encodeURIComponent(s)));
    },
    toolbarclick(key, b, selectedRows){
      var that = this;
      if (key == "tmhzuploadlist") {
        this.$router.push("/products/tmhzuploadlist");
      }
      else if (key == "myexport") {
        if (selectedRows && selectedRows.length > 0) {
          var ids = selectedRows.map(r => {
            return r.id;
          });
          this.$confirm('此操作将导出选中记录, 是否继续?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            this.tableToExcel(selectedRows);

          }).catch(e => {
            console.log("eeeeeeeeeee");
            console.log(e);
          });

        }
      }
      else if (key == "tscl") {
        that.form.query.orderNum = "";
        that.form.query.tsclType = "4";
        if (selectedRows != null && selectedRows.length > 0) {
          var orderNumDiff = 0;
          var objOrderNum = {};
          var objTmStatus = {};
          var resultNumDiff = [];
          var resultTmStatus = [];
          for (var i = 0; i < selectedRows.length; i++) {
            if (!objOrderNum[selectedRows[i].orderNum]) {
              objOrderNum[selectedRows[i].orderNum] = true;
              resultNumDiff.push(selectedRows[i].orderNum);
            }
            if (selectedRows[i].tmStatus == "4" || selectedRows[i].tmStatus == "FILLEXCEPTION") {
              if (!objTmStatus[selectedRows[i].tmStatus]) {
                objTmStatus[selectedRows[i].tmStatus] = true;
                resultTmStatus.push(selectedRows[i].tmStatus);
              }
            }
          }
          if (resultNumDiff.length > 1) {
            that.$refs.grid.$message({
              showClose: true,
              type: 'warning',
              duration: 4000,
              message: `只能选择同一个订单号的数据进行处理`
            });
            return false;
          }
          if (resultTmStatus.length == 0) {
            that.$refs.grid.$message({
              showClose: true,
              type: 'warning',
              duration: 4000,
              message: `只能选择同一个订单号中状态为不予受理或填报异常的数据进行处理`
            });
            return false;
          }
          if (resultTmStatus.length > 1) {
            that.$refs.grid.$message({
              showClose: true,
              type: 'warning',
              duration: 4000,
              message: `只能选择同一个订单号中同一状态的数据进行处理`
            });
            return false;
          }
          that.form.query.orderNum = selectedRows[0].orderNum;
          that.form.query.tsclType = selectedRows[0].tmStatus;
        }
        that.title = "特殊处理";
        that.showData = 2;
        that.step = 1;
        that.stepOneShow = 11;
        that.$refs.card.changeButtonState();
        that.$refs.grid.showDlgForm();
      }
      else if (key == "tmhzlook") {
        if (selectedRows == null || selectedRows.length != 1) {
          this.$message.warning(`请选择一行记录`);
          return false;
        } else {
          if (selectedRows[0].tmRegistNum == null || selectedRows[0].tmRegistNum == "") {
            this.$message.warning(`目前该数据还没有回执，敬请期待`);
            return false;
          }

          var options = { "tmRegistNum": selectedRows[0].tmRegistNum };

          that.$root.postReq("/web/tmflowCtl/getDetail", options).then(function (d) {
            if (d.code == "1") {
              that.tableData = d.data.rows;
              that.tableDataDialogTableVisible = true;
            }
            else {
              that.$message.warning(`操作失败，请刷新页面后重新操作`);
            }

          }).catch(function (e) {
            that.$message.warning(`操作失败，请刷新页面后重新操作!`);
          });

        }
      }
      else if (key == "awte") {
        if (selectedRows == null) {
          this.$message.warning(`请选择一行记录`);
          return false;
        } else {
          this.$confirm('此操作将提交商标到机器人, 是否继续?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            selectedRows.forEach(d => {
              if (d.tmStatus != "WAITARTIFICIALEXAMINE") {
                this.$message.warning('请查看代理号为' + d.proxyCode + '的状态是否是等待人工提交');
                return false;
              } else {
                var param = { status: "WAITCOMMIT", id: d.id };
                this.$root.postReq("/web/trademarkCtl/putStatusById", param).then(rd => {
                  if (rd.code == 1) {
                    that.$refs.grid.fetchData();
                  }
                }).catch(function (e) {
                  that.$message.warning(`操作失败，请刷新页面后重新操作`);
                });
              }
            })
          }).catch(() => {
          });
        }
      }
      else if (key == "repulses") {
        if (selectedRows == null) {
          this.$message.warning(`请选择一行记录`);
          return false;
        } else {
          this.$prompt('', '原因', {
            confirmButtonText: '确定',
            cancelButtonText: '取消'
          }).then(({ value }) => {
            selectedRows.forEach(d => {
              if (d.tmStatus != "WAITARTIFICIALEXAMINE") {
                this.$message.warning('请查看代理号为' + d.proxyCode + '的状态是否是等待人工提交');
                return false;
              } else {
                var param = { status: "FILLEXCEPTION", remarkinfo: value, id: d.id };
                this.$root.postReq("/web/trademarkCtl/putStatusById", param).then(rd => {
                  if (rd.code == 1) {
                    that.$refs.grid.fetchData();
                  }
                }).catch(function (e) {
                  that.$message.warning(`操作失败，请刷新页面后重新操作`);
                });
              }
            })
          }).catch(() => {
          });
        }
      }
      else if (key == "atoback") {
        if (selectedRows == null) {
          this.$message.warning(`请选择一行记录`);
          return false;
        } else {
          this.$confirm('此操作将退回上一状态, 是否继续?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            selectedRows.forEach(d => {
              if (d.tmStatus != "WAITCOMMIT") {
                this.$message.warning('请查看代理号为' + d.proxyCode + '的状态是否是待提交');
                return false;
              } else {
                var param = { status: "WAITARTIFICIALEXAMINE", id: d.id };
                this.$root.postReq("/web/trademarkCtl/putStatusById", param).then(rd => {
                  if (rd.code == 1) {
                    that.$refs.grid.fetchData();
                  }
                }).catch(function (e) {
                  that.$message.warning(`操作失败，请刷新页面后重新操作`);
                });
              }
            })
          }).catch(() => {
          });
        }
      }
      else if (key == "tmtransfer") {
        if (!selectedRows || selectedRows.length < 1) {
          this.$message.warning(`请选择至少一行记录`);
          return false;
        } else {
          var channelOrderNums = [];
          for (var i = 0; i < selectedRows.length; i++) {
            channelOrderNums.push(selectedRows[i].channelOrderNum);
          }
          this.channelOrderNums = channelOrderNums;
          this.showtransfer = true;
        }
      }
      else if (key == "aliDataSync") {
        if (!selectedRows || selectedRows.length < 1) {
          that.$message.warning(`请选择至少一行记录!`);
          return false;
        } else {
          that.$confirm('商标状态为【资料齐全、已提交阿里(待补全信息)、已补全信息(待确认商标)、阿里云审不通过、已失败退款(阿里)、客户反馈(待修改重新同步)、阿里接口错误(需峰擎系统处理)】才能进行阿里数据同步，同步后数据会推送到阿里让客户付款，是否继续?', '重要提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            var idList = [];
            for (var i = 0; i < selectedRows.length; i++) {
              if (selectedRows[i].tmSourceType == "32" && ["SUBALITM", "SUBALITMOK", "DOCFINISH", "ALIPAYREFUND", "ALIAUDITNOT", "ALICUSTOMERREJECTED", "REQALIERROR"].indexOf(selectedRows[i].tmStatus) >= 0) {
                idList.push(selectedRows[i].id);
              }
            }
            if (idList.length == 0) {
              that.$message.warning(`所选择的数据中必须包含阿里云来源，且商标状态为【资料齐全、已提交阿里(待补全信息)、已补全信息(待确认商标)、阿里云审不通过、已失败退款(阿里)、客户反馈(待修改重新同步)、阿里接口错误(需峰擎系统处理)】才能进行同步`);
              return false;
            }
            var env = this.$store.state.env;
            var param = { ids: idList, env: env };
            this.$root.postReq("/web/trademarkCtl/aliDataSync", param).then(rd => {
              if (rd.code == 1) {
                that.$refs.grid.fetchData();
              } else {
                that.$message.warning(rd.msg);
              }
            }).catch(function (e) {
              that.$message.warning(`操作失败，请刷新页面后重新操作`);
            });

          }).catch(() => {
          });
        }

      }
      else if (key == "aliDataClose") {
        if (!selectedRows || selectedRows.length < 1) {
          that.$message.warning(`请选择至少一行记录!`);
          return false;
        } else {
          that.$confirm('商标状态为【资料齐全、已提交阿里(待补全信息)、已失败退款(阿里)、阿里云审不通过、客户反馈(待修改重新同步)、阿里接口错误(需峰擎系统处理)、已补全信息(待确认商标)】才能进行阿里数据关闭，是否继续?', '重要提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            var idList = [];
            for (var i = 0; i < selectedRows.length; i++) {
              if (selectedRows[i].tmSourceType == "32" && ["DOCFINISH", "SUBALITM", "ALIPAYREFUND", "ALIAUDITNOT", "ALICUSTOMERREJECTED", "REQALIERROR", "SUBALITMOK"].indexOf(selectedRows[i].tmStatus) >= 0) {
                idList.push(selectedRows[i].id);
              }
            }
            if (idList.length == 0) {
              that.$message.warning(`所选择的数据中必须包含阿里云来源，且商标状态为【资料齐全、已提交阿里(待补全信息)、已失败退款(阿里)、阿里云审不通过、客户反馈(待修改重新同步)、阿里接口错误(需峰擎系统处理)、已补全信息(待确认商标)】才能进行关闭`);
              return false;
            }
            var env = this.$store.state.env;
            var param = { ids: idList, env: env };
            this.$root.postReq("/web/trademarkCtl/aliDataClose", param).then(rd => {
              if (rd.code == 1) {
                that.$refs.grid.fetchData();
              } else {
                that.$message.warning(rd.msg);
              }
            }).catch(function (e) {
              that.$message.warning(`操作失败，请刷新页面后重新操作`);
            });

          }).catch(() => {
          });
        }

      }
    },
    submittransfer(){
      var that = this;
      this.$refs.transfer.validate((valid) => {
        if (valid) {
          this.$root.postReq("/web/trademarkCtl/tmtransfer", { mobile: this.transferform.mobile, channelOrderNums: this.channelOrderNums }).then(rd => {
            if (rd.code == 1) {
              console.log("--------------------------fetchData");
              that.showtransfer = false;
              that.$refs.grid.fetchData();
            } else {
              that.$message.warning(rd.msg);
            }
          }).catch(function (e) {
            that.$message.warning(`操作失败，请刷新页面后重新操作`);
          });
        } else {
          console.log('error submit!!');
          return false;
        }
      });
    },
    onDlgFormClick(type, b){
      if (type == "mysave") {

      }
      this.title = "商标档案";
    },
    handleSelectionChange: function(val) {
      this.multipleSelection = val;
      console.log(this.cc);
    },
    headerCellStyle: function() {
      return { "background-color": "red" };
    },
    onsave(m){
      console.log(m.content);
    },
    onColFormater(row, column, cellvalue, index){
      if (column.property == "created_at") {
        var date = new Date(row["created_at"]);
        var time = date.toLocaleDateString();
        return time;
      }
      if (column.property == "lastUp") {
        var date = new Date(row["lastUp"]);
        var time = date.toLocaleDateString();
        return time;
      }
      if (column.property == "submitTime") {
        if (!row["submitTime"]) {
          return "---";
        }
        var date1 = new Date(row["submitTime"]);
        var time1 = date1.toLocaleDateString();
        return time1;
      }
      return cellvalue;
    },

    rowClick(row, key){
      var that = this;
      if (key == "yyzz") {
        var url = row.applier.businessLicensePic;
        if (url == null || url == "") {
          this.$message.warning(`营业执照尚未上传`);
        } else {
          window.open(row.applier.businessLicensePic);
        }
      }
      if (key == "sfz") {
        var url = row.applier.identityCardPic;
        if (url == null || url == "") {
          this.$message.warning(`身份证尚未上传`);
        } else {
          window.open(row.applier.identityCardPic);
        }
      }
      if (key == "tedit") {
        this.$router.push("/platform/trademarkdetail/" + row.proxyCode);
      }
      if (key == "wte") {
        this.$confirm('此操作将提交商标到机器人, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          if (row.tmStatus != "WAITARTIFICIALEXAMINE") {
            this.$message.warning('请查看状态是否是等待人工提交');
            return false;
          } else {
            var param = { status: "WAITCOMMIT", id: row.id };
            this.$root.postReq("/web/trademarkCtl/putStatusById", param).then(rd => {
              if (rd.code == 1) {
                console.log("--------------------------fetchData");
                that.$refs.grid.fetchData();
              }
            }).catch(function (e) {
              that.$message.warning(`操作失败，请刷新页面后重新操作`);
            });
          }
        }).catch(() => {
        });
      }
      if (key == "repulse") {
        if (row.tmStatus != "WAITARTIFICIALEXAMINE") {
          this.$message.warning('请查看状态是否是等待人工提交');
          return false;
        } else {
          this.$prompt('', '原因', {
            confirmButtonText: '确定',
            cancelButtonText: '取消'
          }).then(({ value }) => {
            var param = { status: "FILLEXCEPTION", remarkinfo: value, id: row.id };
            this.$root.postReq("/web/trademarkCtl/putStatusById", param).then(rd => {
              if (rd.code == 1) {
                that.$refs.grid.fetchData();
              }
            }).catch(function (e) {
              that.$message.warning(`操作失败，请刷新页面后重新操作`);
            });

          }).catch(() => {
          });
        }
      }
      if (key == "toback") {
        this.$confirm('此操作将退回上一状态, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          if (row.tmStatus != "WAITCOMMIT") {
            this.$message.warning('请查看状态是否是待提交');
            return false;
          } else {
            var param = { status: "WAITARTIFICIALEXAMINE", id: row.id };
            this.$root.postReq("/web/trademarkCtl/putStatusById", param).then(rd => {
              if (rd.code == 1) {
                console.log("--------------------------fetchData");
                that.$refs.grid.fetchData();
              }
            }).catch(function (e) {
              that.$message.warning(`操作失败，请刷新页面后重新操作`);
            });
          }
        }).catch(() => {
        });
      }
      if (key == "sbty") {
        var url = row.picUrl;
        console.log(row.tmFormType);
        if (row.tmFormType == "6" || row.tmFormType == "7") {
          url = row.colorizedPicUrl;
        }
        if (url == null || url == "") {
          this.$message.warning(`商标图样尚未上传`);
        } else {
          window.open(url);
        }
      }

      if (key == "wts") {
        var url = row.sealAuthorizeStuff;
        if (url == null || url == "") {
          this.$message.warning(`商标委托书尚未上传`);
        } else {
          window.open(row.sealAuthorizeStuff);
        }
      }
      if (key == "mydetail") {
        var url = "";
        var a = window.location.href;
        var url = a.split("/autosubmitinside")[0];
        var channelCode = this.$store.state.channelCode;
        var itemCode = this.$store.state.itemCode;
        var openid = this.$store.state.openid;
        var env = this.$store.state.env;
        var channelOrderNum = row.channelOrderNum;
        var queryParam = row.orderNum;
        var queryTmId = row.id;
        if (!channelCode || !itemCode || !openid || !queryParam || !channelOrderNum) {
          this.$message.warning(`参数错误`);
          return;
        }
        url = url + "/autosubmitinside?env=" + env + "&appCode=100099&channelCode=" + channelCode + "&itemCode=" + itemCode + "&openid=" + openid + "&channelOrderNum=" + channelOrderNum + "&queryParam=" + queryParam + "&queryTmId=" + queryTmId + "#/automatictmsubmitedit";
        window.location.href = url;
        return
      }
      if (key == "uploadALIPAPERS2") {
        this.showUploadStuff = true;

      }
    },
  },
  computed: {
    headStyle: function() {
      return { "background-color": "white" };
    }
  },
  vname: "gsb-autosubmittminside"
}
