소스 검색

钻铤导出

lining 6 년 전
부모
커밋
6b817b35ab

+ 2 - 0
src/dashoo.cn/backend/api/business/limsdoctemplate/limstemplateenum.go

@@ -129,5 +129,7 @@ const (
 	DAYT_PIPEDRILLPIPE_DETAIL string = "DAYT.PipeDrillPipe.Detail"
 	// 方钻杆检测记录
 	DAYT_PETROLEUMPIPE_DETAIL string = "DAYT.PetroleumPipe.Detail"
+	// 钻铤检测记录
+	DAYT_DRILLCOLLAR_DETAIL string = "DAYT.DrillCollar.Detail"
 
 )

+ 50 - 43
src/dashoo.cn/backend/api/business/limsdrillcollar/limsdrillcollar.go

@@ -3,47 +3,54 @@ package limsdrillcollar
 import "time"
 
 type LimsReportDrillCollar struct {
-	Id                int       `xorm:"not null pk autoincr INT(10)"`
-	Product           string    `xorm:"comment('产品名称') VARCHAR(50)"`
-	Specifications    string    `xorm:"comment('规格型号') VARCHAR(50)"`
-	SamplingBase      int       `xorm:"comment('抽样基数') INT(10)"`
-	SampleQuantity    int       `xorm:"comment('样品数量') INT(10)"`
-	SampleNumber      string    `xorm:"comment('样品编号') VARCHAR(50)"`
-	CloseDistanceOut  float64   `xorm:"comment('紧密距外螺纹') DECIMAL(10,2)"`
-	CloseDistanceIn   float64   `xorm:"comment('紧密距内螺纹') DECIMAL(10,2)"`
-	TaperToleranceOut float64   `xorm:"comment('锥度公差外螺纹') DECIMAL(10,2)"`
-	TaperToleranceIn  float64   `xorm:"comment('锥度公差内螺纹') DECIMAL(10,2)"`
-	PitchToleranceOut float64   `xorm:"comment('螺距公差外螺纹') DECIMAL(10,2)"`
-	PitchToleranceIn  float64   `xorm:"comment('螺距公差内螺纹') DECIMAL(10,2)"`
-	ShoulderSurface   float64   `xorm:"comment('螺纹轴线与台肩面垂直度') DECIMAL(10,2)"`
-	EndFace           float64   `xorm:"comment('螺纹轴线与端面垂直度') DECIMAL(10,2)"`
-	MajorAxis         float64   `xorm:"comment('管体外径长轴') DECIMAL(10,2)"`
-	ShortAxis         float64   `xorm:"comment('管体外径短轴') DECIMAL(10,2)"`
-	OutDiaDif         float64   `xorm:"comment('外径差') DECIMAL(10,2)"`
-	LPC               float64   `xorm:"comment('LPC') DECIMAL(10,2)"`
-	DF                float64   `xorm:"comment('DF') DECIMAL(10,2)"`
-	QC                float64   `xorm:"comment('QC') DECIMAL(10,2)"`
-	DRG               float64   `xorm:"comment('DRG') DECIMAL(10,2)"`
-	WallDif1          string    `xorm:"comment('壁厚差t大1') DECIMAL(10,2)"`
-	WallDif2          string    `xorm:"comment('壁厚差t大2') DECIMAL(10,2)"`
-	WallDif3          string    `xorm:"comment('壁厚差t大3') DECIMAL(10,2)"`
-	ExDiameterM1      string    `xorm:"comment('壁厚差t小1') DECIMAL(10,2)"`
-	ExDiameterM2      string    `xorm:"comment('壁厚差t小2') DECIMAL(10,2)"`
-	ExDiameterM3      string    `xorm:"comment('壁厚差t小3') DECIMAL(10,2)"`
-	WallDifference1   string    `xorm:"comment('壁厚差△1') DECIMAL(10,2)"`
-	WallDifference2   string    `xorm:"comment('壁厚差△2') DECIMAL(10,2)"`
-	WallDifference3   string    `xorm:"comment('壁厚差△3') DECIMAL(10,2)"`
-	InterDiameter     float64   `xorm:"comment('管体内径') DECIMAL(10,2)"`
-	TubeLength        float64   `xorm:"comment('管体长度') DECIMAL(10,2)"`
-	Appearance        string    `xorm:"comment('外观检验') VARCHAR(255)"`
-	Inspector         string    `xorm:"comment('检验员') VARCHAR(50)"`
-	Audit             string    `xorm:"comment('审核') VARCHAR(255)"`
-	InspectionDate    time.Time `xorm:"comment('检验日期') DATETIME"`
-	Remark            string    `xorm:"comment('备注') VARCHAR(255)"`
-	CreateUserId      int       `xorm:"INT(11)"`
-	CreateOn          time.Time `xorm:"DATETIME"`
-	CreateBy          string    `xorm:"VARCHAR(50)"`
-	ModifiedOn        time.Time `xorm:"DATETIME"`
-	ModifiedUserId    int       `xorm:"INT(11)"`
-	ModifiedBy        string    `xorm:"VARCHAR(50)"`
+	Id                 int       `xorm:"not null pk autoincr INT(10)"`
+	EId                int       `xorm:"comment('委托单ID') INT(10)"`
+	TaskBalanceId      int       `xorm:"comment('任务分配表ID') INT(10)"`
+	DataEntryId        int       `xorm:"comment('数据记录表ID') INT(10)"`
+	Product            string    `xorm:"comment('产品名称') VARCHAR(50)"`
+	Specifications     string    `xorm:"comment('规格型号') VARCHAR(50)"`
+	SamplingBase       int       `xorm:"comment('抽样基数') INT(10)"`
+	SampleQuantity     int       `xorm:"comment('样品数量') INT(10)"`
+	SampleNumber       string    `xorm:"comment('样品编号') VARCHAR(50)"`
+	CloseDistanceOut   float64   `xorm:"comment('紧密距外螺纹') DECIMAL(10,2)"`
+	CloseDistanceIn    float64   `xorm:"comment('紧密距内螺纹') DECIMAL(10,2)"`
+	TaperToleranceOut1 float64   `xorm:"comment('锥度公差外螺纹') DECIMAL(10,2)"`
+	TaperToleranceOut2 float64   `xorm:"comment('锥度公差外螺纹') DECIMAL(10,2)"`
+	TaperToleranceIn1  float64   `xorm:"comment('锥度公差内螺纹') DECIMAL(10,2)"`
+	TaperToleranceIn2  float64   `xorm:"comment('锥度公差内螺纹') DECIMAL(10,2)"`
+	PitchToleranceOut1 float64   `xorm:"comment('螺距公差外螺纹') DECIMAL(10,2)"`
+	PitchToleranceOut2 float64   `xorm:"comment('螺距公差外螺纹') DECIMAL(10,2)"`
+	PitchToleranceIn1  float64   `xorm:"comment('螺距公差内螺纹') DECIMAL(10,2)"`
+	PitchToleranceIn2  float64   `xorm:"comment('螺距公差内螺纹') DECIMAL(10,2)"`
+	ShoulderSurface    float64   `xorm:"comment('螺纹轴线与台肩面垂直度') DECIMAL(10,2)"`
+	EndFace            float64   `xorm:"comment('螺纹轴线与端面垂直度') DECIMAL(10,2)"`
+	MajorAxis          float64   `xorm:"comment('管体外径长轴') DECIMAL(10,2)"`
+	ShortAxis          float64   `xorm:"comment('管体外径短轴') DECIMAL(10,2)"`
+	OutDiaDif          float64   `xorm:"comment('外径差') DECIMAL(10,2)"`
+	LPC                float64   `xorm:"comment('LPC') DECIMAL(10,2)"`
+	DF                 float64   `xorm:"comment('DF') DECIMAL(10,2)"`
+	QC                 float64   `xorm:"comment('QC') DECIMAL(10,2)"`
+	DRG                float64   `xorm:"comment('DRG') DECIMAL(10,2)"`
+	WallDif1           float64    `xorm:"comment('壁厚差t大1') DECIMAL(10,2)"`
+	WallDif2           float64    `xorm:"comment('壁厚差t大2') DECIMAL(10,2)"`
+	WallDif3           float64    `xorm:"comment('壁厚差t大3') DECIMAL(10,2)"`
+	ExDiameterM1       float64    `xorm:"comment('壁厚差t小1') DECIMAL(10,2)"`
+	ExDiameterM2       float64    `xorm:"comment('壁厚差t小2') DECIMAL(10,2)"`
+	ExDiameterM3       float64    `xorm:"comment('壁厚差t小3') DECIMAL(10,2)"`
+	WallDifference1    float64    `xorm:"comment('壁厚差△1') DECIMAL(10,2)"`
+	WallDifference2    float64    `xorm:"comment('壁厚差△2') DECIMAL(10,2)"`
+	WallDifference3    float64    `xorm:"comment('壁厚差△3') DECIMAL(10,2)"`
+	InterDiameter      float64   `xorm:"comment('管体内径') DECIMAL(10,2)"`
+	TubeLength         float64   `xorm:"comment('管体长度') DECIMAL(10,2)"`
+	Appearance         string    `xorm:"comment('外观检验') VARCHAR(255)"`
+	Inspector          string    `xorm:"comment('检验员') VARCHAR(50)"`
+	Audit              string    `xorm:"comment('审核') VARCHAR(255)"`
+	InspectionDate     time.Time `xorm:"comment('检验日期') DATETIME"`
+	Remark             string    `xorm:"comment('备注') VARCHAR(255)"`
+	CreateUserId       int       `xorm:"INT(11)"`
+	CreateOn           time.Time `xorm:"DATETIME"`
+	CreateBy           string    `xorm:"VARCHAR(50)"`
+	ModifiedOn         time.Time `xorm:"DATETIME"`
+	ModifiedUserId     int       `xorm:"INT(11)"`
+	ModifiedBy         string    `xorm:"VARCHAR(50)"`
 }

+ 150 - 0
src/dashoo.cn/backend/api/business/limsdrillcollar/limsdrillcollarService.go

@@ -1,8 +1,16 @@
 package limsdrillcollar
 
 import (
+	"dashoo.cn/backend/api/business/limsdataentry"
+	"dashoo.cn/utils"
+	"github.com/360EntSecGroup-Skylar/excelize"
 	"github.com/go-xorm/xorm"
 	. "dashoo.cn/backend/api/mydb"
+	"os"
+	"strconv"
+	"strings"
+	"time"
+	. "github.com/linxGnu/goseaweedfs"
 )
 
 type LimsDrillCollarService struct {
@@ -14,3 +22,145 @@ func GetLimsDrillCollarService(xormEngine *xorm.Engine) *LimsDrillCollarService
 	s.DBE = xormEngine
 	return s
 }
+
+/**
+ * 数据录入导出
+ */
+func (s *LimsDrillCollarService) DocDataToExcel(entrustMainEntity limsdataentry.DataEntryEntrustModel, dataentrymainlist limsdataentry.LimsDateEntry, tablename string, seqStr string, retUrl string) (reportUrl string, err error) {
+	var dataentrylist []LimsReportDrillCollar
+	s.GetEntitysByWhere(tablename, " DataEntryId='"+utils.ToStr(dataentrymainlist.Id)+"'", &dataentrylist)
+	//模板下载到服务器
+	_dir := utils.Cfg.MustValue("file", "tmplateDir") + utils.ToStr(dataentrymainlist.Id)
+	fileurl := strings.Split(retUrl, "|")
+	utils.DownloadFile("http://"+fileurl[0], fileurl[1], _dir)
+
+	xlsx, err := excelize.OpenFile(utils.Cfg.MustValue("file", "tmplateDir") + utils.ToStr(dataentrymainlist.Id) + "/" + fileurl[1])
+	if err != nil {
+		utils.LogError(err)
+		return "", err
+	}
+	tmpDocName := utils.ToStr(dataentrymainlist.Id) + "_" + strconv.Itoa(time.Now().Nanosecond()) + ".xlsx"
+	//提前生成文件在服务器的存储路径
+	_pdir := utils.Cfg.MustValue("file", "docDir") + utils.ToStr(dataentrymainlist.Id) + "/"
+	exist, _ := utils.PathExists(_pdir)
+	var dirErr error
+	if !exist {
+		dirErr = os.Mkdir(_pdir, os.ModePerm)
+	}
+	if dirErr != nil {
+		utils.LogError(err)
+		return "", dirErr
+	}
+	excelrow := 16
+	var copysheetssnum = 1
+	if (len(dataentrylist) > excelrow) {
+		if (len(dataentrylist)%excelrow > 0) {
+			copysheetssnum = len(dataentrylist)/excelrow + 1
+		} else {
+			copysheetssnum = len(dataentrylist) / excelrow
+		}
+		sheetIdx := 3
+		for i := 1; i < copysheetssnum; i++ {
+			xlsx.NewSheet(1+sheetIdx, "Sheet"+strconv.Itoa(1+sheetIdx))
+			err = xlsx.CopySheet(1, 1+sheetIdx)
+			xlsx.NewSheet(2+sheetIdx, "Sheet"+strconv.Itoa(2+sheetIdx))
+			err = xlsx.CopySheet(2, 2+sheetIdx)
+			xlsx.NewSheet(3+sheetIdx, "Sheet"+strconv.Itoa(3+sheetIdx))
+			// index := xlsx.NewSheet("Sheet" + strconv.Itoa(sheetIdx))
+			err = xlsx.CopySheet(3, 3+sheetIdx)
+			sheetIdx += 3
+		}
+	}
+	sheetIdx1 := 1
+	sheetIdx2 := 2
+	sheetIdx3 := 3
+	startIdx := 0
+	for  i := 0; i < copysheetssnum; i++ {
+		step := 0
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "C5", dataentrymainlist.Product)
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "L5", dataentrymainlist.Spec)
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "C7", dataentrymainlist.SamplingBase)
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "L7", dataentrymainlist.Spec)
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "C43", dataentrymainlist.Appearance)
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "C45", dataentrymainlist.Remark)
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx2), "C5", dataentrymainlist.Product)
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx2), "G5", dataentrymainlist.Spec)
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx2), "C7", dataentrymainlist.SamplingBase)
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx2), "G7", dataentrymainlist.Spec)
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx2), "C43", dataentrymainlist.Appearance)
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx2), "C45", dataentrymainlist.Remark)
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "C5", dataentrymainlist.Product)
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "K5", dataentrymainlist.Spec)
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "C7", dataentrymainlist.SamplingBase)
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "K7", dataentrymainlist.Spec)
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "C43", dataentrymainlist.Appearance)
+		xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "C45", dataentrymainlist.Remark)
+
+
+		for ; startIdx < (len(dataentrylist)); startIdx++ {
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "A"+strconv.Itoa(11+step), dataentrylist[startIdx].SampleNumber)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "B"+strconv.Itoa(11+step), dataentrylist[startIdx].CloseDistanceOut)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "C"+strconv.Itoa(11+step), dataentrylist[startIdx].CloseDistanceIn)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "D"+strconv.Itoa(11+step), dataentrylist[startIdx].TaperToleranceOut1)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "E"+strconv.Itoa(11+step), dataentrylist[startIdx].TaperToleranceOut2	)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "F"+strconv.Itoa(11+step), dataentrylist[startIdx].TaperToleranceIn1)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "G"+strconv.Itoa(11+step), dataentrylist[startIdx].TaperToleranceIn2)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "H"+strconv.Itoa(11+step), dataentrylist[startIdx].PitchToleranceOut1)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "I"+strconv.Itoa(11+step), dataentrylist[startIdx].PitchToleranceOut2)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "J"+strconv.Itoa(11+step), dataentrylist[startIdx].PitchToleranceIn1)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "K"+strconv.Itoa(11+step), dataentrylist[startIdx].PitchToleranceIn2)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "L"+strconv.Itoa(11+step), dataentrylist[startIdx].ShoulderSurface)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx1), "M"+strconv.Itoa(11+step), dataentrylist[startIdx].EndFace)
+
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx2), "A"+strconv.Itoa(11+step), dataentrylist[startIdx].SampleNumber)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx2), "B"+strconv.Itoa(11+step), dataentrylist[startIdx].MajorAxis)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx2), "C"+strconv.Itoa(11+step), dataentrylist[startIdx].ShortAxis)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx2), "D"+strconv.Itoa(11+step), dataentrylist[startIdx].OutDiaDif)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx2), "E"+strconv.Itoa(11+step), dataentrylist[startIdx].DF)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx2), "F"+strconv.Itoa(11+step), dataentrylist[startIdx].QC)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx2), "G"+strconv.Itoa(11+step), dataentrylist[startIdx].DRG)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx2), "H"+strconv.Itoa(11+step), dataentrylist[startIdx].LPC)
+
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "A"+strconv.Itoa(11+step), dataentrylist[startIdx].SampleNumber)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "B"+strconv.Itoa(11+step), dataentrylist[startIdx].WallDif1)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "C"+strconv.Itoa(11+step), dataentrylist[startIdx].ExDiameterM1)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "D"+strconv.Itoa(11+step), dataentrylist[startIdx].WallDifference1)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "E"+strconv.Itoa(11+step), dataentrylist[startIdx].WallDif2)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "F"+strconv.Itoa(11+step), dataentrylist[startIdx].ExDiameterM2)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "G"+strconv.Itoa(11+step), dataentrylist[startIdx].WallDifference2)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "H"+strconv.Itoa(11+step), dataentrylist[startIdx].WallDif3)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "I"+strconv.Itoa(11+step), dataentrylist[startIdx].ExDiameterM3)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "J"+strconv.Itoa(11+step), dataentrylist[startIdx].WallDifference3)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "K"+strconv.Itoa(11+step), dataentrylist[startIdx].InterDiameter)
+			xlsx.SetCellValue("Sheet"+strconv.Itoa(sheetIdx3), "L"+strconv.Itoa(11+step), dataentrylist[startIdx].TubeLength)
+
+			step+=2
+			if (startIdx+1)%excelrow == 0 {
+				sheetIdx1 = sheetIdx1 + 3
+				sheetIdx2 = sheetIdx2 + 3
+				sheetIdx3 = sheetIdx3 + 3
+				startIdx++
+				step = 0
+				break
+			}
+		}
+	}
+
+	//4. 将文件保存到服务器相关目录上
+	xlsx.SaveAs(utils.Cfg.MustValue("file", "docDir") + utils.ToStr(dataentrymainlist.Id) + "/" + tmpDocName)
+
+	//5. 上传文件到文件服务器
+	DocFilePath := utils.Cfg.MustValue("file", "docDir") + utils.ToStr(dataentrymainlist.Id) + "/" + tmpDocName
+	var sw *Seaweed
+	var filer []string
+	if _filer := os.Getenv("GOSWFS_FILER_URL"); _filer != "" {
+		filer = []string{_filer}
+	}
+	sw = NewSeaweed("http", utils.Cfg.MustValue("file", "upFileHost"), filer, 2*1024*1024, 5*time.Minute)
+	_, _, fID, err := sw.UploadFile(DocFilePath, "", "")
+	retDocUrl := utils.Cfg.MustValue("file", "downFileHost") + "/" + fID
+	//6. 删除本地文件,释放空间
+	os.Remove(DocFilePath)
+	//7. 保存住报告URL(由controller层调用生成或修改生成报告记录)
+	return retDocUrl, err
+}

+ 10 - 0
src/dashoo.cn/backend/api/controllers/lims/limsdataentry.go

@@ -1,6 +1,7 @@
 package lims
 
 import (
+	"dashoo.cn/backend/api/business/limsdrillcollar"
 	"dashoo.cn/backend/api/business/limspetroleumpipe"
 	"dashoo.cn/backend/api/business/limspipedrillpipe"
 	"encoding/base64"
@@ -2453,6 +2454,15 @@ func (this *LimsDataEntryController) exportdatatoexcel(fileurl string, dataentry
 		//var userlist limsdataentry.UserModel
 		//svc.GetEntityByWhere(BaseUserName, "Id = '"+utils.ToStr(dataentrylist.JHUserId)+"'", &userlist)
 		DocUrl, err = svc.DocDataToExcel(entrustlist[0], dataentrylist, this.User.AccCode+LimsPetroleUmPipeName, "", fileurl)
+	case limsdoctemplate.DAYT_DRILLCOLLAR_DETAIL:
+		//seqStr := codecSvc.GetReportLeakProtectSequence(this.User.AccCode)
+		svc := limsdrillcollar.GetLimsDrillCollarService(utils.DBE)
+		//检测结论
+		//err = svc.GetTestCheck(this.User.AccCode+LimsReportLeakProtectName, dataentrylist.Id)
+		//获取校核人签名
+		//var userlist limsdataentry.UserModel
+		//svc.GetEntityByWhere(BaseUserName, "Id = '"+utils.ToStr(dataentrylist.JHUserId)+"'", &userlist)
+		DocUrl, err = svc.DocDataToExcel(entrustlist[0], dataentrylist, this.User.AccCode+LimsReportDrillCollarName, "", fileurl)
 	}
 	return DocUrl, err
 }

+ 40 - 17
src/dashoo.cn/backend/api/controllers/limswzjys/limsdrillcollar.go

@@ -35,6 +35,9 @@ func (this *LimsReportDrillCollarController) GetEntityList() {
 		}
 	}
 	Id := this.GetString("Id")
+	EId := this.GetString("EId")
+	TaskBalanceId := this.GetString("TaskBalanceId")
+	DataEntryId := this.GetString("DataEntryId")
 	Product := this.GetString("Product")
 	Specifications := this.GetString("Specifications")
 	SamplingBase := this.GetString("SamplingBase")
@@ -77,9 +80,20 @@ func (this *LimsReportDrillCollarController) GetEntityList() {
 	ModifiedBy := this.GetString("ModifiedBy")
 
 	if Id != "" {
-		where = where + " and Id like '%" + Id + "%'"
+		where = where + " and Id =" + Id
 	}
 
+	if EId != "" {
+		where = where + " and EId =" + EId
+	}
+
+	if TaskBalanceId != "" {
+		where = where + " and TaskBalanceId =" + TaskBalanceId
+	}
+
+	if DataEntryId != "" {
+		where = where + " and DataEntryId =" + DataEntryId
+	}
 
 	if Product != "" {
 		where = where + " and Product like '%" + Product + "%'"
@@ -399,6 +413,9 @@ func (this *LimsReportDrillCollarController) UpdateEntity() {
 	cols := []string{
 
 		"Id",
+		"EId",
+		"TaskBalanceId",
+		"DataEntryId",
 		"Product",
 		"Specifications",
 		"SamplingBase",
@@ -406,28 +423,34 @@ func (this *LimsReportDrillCollarController) UpdateEntity() {
 		"SampleNumber",
 		"CloseDistanceOut",
 		"CloseDistanceIn",
-		"TaperToleranceOut",
-		"TaperToleranceIn",
-		"PitchToleranceOut",
-		"PitchToleranceIn",
+		"TaperToleranceOut1",
+		"TaperToleranceOut2",
+		"TaperToleranceIn1",
+		"TaperToleranceIn2",
+		"PitchToleranceOut1",
+		"PitchToleranceOut2",
+		"PitchToleranceIn1",
+		"PitchToleranceIn2",
 		"ShoulderSurface",
 		"EndFace",
-		"TubeDiameter",
+		"MajorAxis",
+		"ShortAxis",
+		"OutDiaDif",
 		"DF",
 		"QC",
-		"LPB",
+		"DRG",
 		"LPC",
-		"LB",
-		"WallDif",
+		"WallDif1",
+		"WallDif2",
+		"WallDif3",
+		"ExDiameterM1",
+		"ExDiameterM2",
+		"ExDiameterM3",
+		"WallDifference1",
+		"WallDifference2",
+		"WallDifference3",
+		"InterDiameter",
 		"TubeLength",
-		"InnerDiameter",
-		"WallThickness",
-		"JointDiameterM",
-		"JointDiameterF",
-		"WallDifF",
-		"WallDifM",
-		"OuterDiameterF",
-		"OuterDiameterM",
 		"Appearance",
 		"Inspector",
 		"Audit",

+ 8 - 1
src/dashoo.cn/frontend_web/src/pages/lims/dataentry/tacktodo.vue

@@ -939,13 +939,20 @@
               query: queryParams
             })
             break
-          // 石油专用管材钻杆
+          // 石油专用管材钻杆
           case 'DAYT.PetroleumPipe.Detail':
             this.$router.push({
               path: '/lims/wzjys/reportpetroleumpipe/datalist',
               query: queryParams
             })
             break
+          // 钻铤
+          case 'DAYT.DrillCollar.Detail':
+            this.$router.push({
+              path: '/lims/wzjys/reportdrillcollar/datalist',
+              query: queryParams
+            })
+            break
           default:
             this.$message.warning('无模板类型相匹配,请重试')
         }

+ 208 - 35
src/dashoo.cn/frontend_web/src/pages/lims/wzjys/reportdrillcollar/_opera/datalist.vue

@@ -160,34 +160,42 @@
             </el-table-column>
           </el-table-column>
           <el-table-column label="锥度公差·10-3(in/in)" align="center">
-            <el-table-column prop="TaperToleranceOut" sortable min-width="100" label="外螺纹" align="center"
+            <el-table-column prop="TaperToleranceOut" sortable min-width="140" label="外螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.TaperToleranceOut" style="width: 100%"></el-input>
+                  v-model="scope.row.TaperToleranceOut1" style="width: 50%"></el-input>
+                <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
+                          v-model="scope.row.TaperToleranceOut2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="TaperToleranceIn" sortable min-width="100" label="内螺纹" align="center"
+            <el-table-column prop="TaperToleranceIn" sortable min-width="140" label="内螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.TaperToleranceIn" style="width: 100%"></el-input>
+                  v-model="scope.row.TaperToleranceIn1" style="width: 50%"></el-input>
+                <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
+                          v-model="scope.row.TaperToleranceIn2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
           <el-table-column label="螺距公差·10-3(in/in)" align="center">
-            <el-table-column prop="PitchToleranceOut" sortable min-width="100" label="外螺纹" align="center"
+            <el-table-column prop="PitchToleranceOut" sortable min-width="140" label="外螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.PitchToleranceOut" style="width: 100%"></el-input>
+                  v-model="scope.row.PitchToleranceOut1" style="width: 50%"></el-input>
+                <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
+                          v-model="scope.row.PitchToleranceOut2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
-            <el-table-column prop="PitchToleranceIn" sortable min-width="100" label="内螺纹" align="center"
+            <el-table-column prop="PitchToleranceIn" sortable min-width="140" label="内螺纹" align="center"
               show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
-                  v-model="scope.row.PitchToleranceIn" style="width: 100%"></el-input>
+                  v-model="scope.row.PitchToleranceIn1" style="width: 50%"></el-input>
+                <el-input size="small" :disabled="DataStatus != 0 && DataStatus!=5 && DataStatus!=3"
+                          v-model="scope.row.PitchToleranceIn2" style="width: 50%"></el-input>
               </template>
             </el-table-column>
           </el-table-column>
@@ -468,7 +476,44 @@
         <el-button size="mini" type="primary" @click="handleSearch">查 询</el-button>
       </span>
     </el-dialog>
-
+    <el-dialog title="提交校核" :visible.sync="ProoFreadShow" top="5vh">
+      <el-form :model="shenhesubmitForm" label-width="130px" ref="shenhesubmitForm">
+        <el-row>
+          <el-form-item label="校核人" prop="AuthorUser">
+            <el-select ref="consigneeselect" v-model="shenhesubmitForm.AuditorUserId" placeholder="请选择校核人" style="width: 100%;">
+              <el-option v-for="item in acceptUsers" :key="item.id" :label="item.realname" :value="item.id">
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-row>
+        <el-row>
+          <el-form-item label="说明">
+            <el-input type="textarea" v-model="shenhesubmitForm.AuditorRemark" placeholder="请输入说明"></el-input>
+          </el-form-item>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer" style="margin-top: -25px">
+        <el-button size="small" @click="ProoFreadShow = false">取 消</el-button>
+        <el-button type="primary" size="small" @click="makesure()">确 定</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog title="校核信息" :visible.sync="jiaoheshow" top="5vh">
+      <el-form :model="jiaoheForm" label-width="130px" ref="jiaoheForm">
+        <el-form-item label="校核状态">
+          <template>
+            <el-radio class="radio" v-model="jiaoheForm.SuccessStatus" :label="2">校核通过</el-radio>
+            <el-radio class="radio" v-model="jiaoheForm.SuccessStatus" :label="3">校核未通过</el-radio>
+          </template>
+        </el-form-item>
+        <el-form-item label="说明">
+          <el-input type="textarea" v-model="jiaoheForm.AuditorRemark" placeholder="请输入校核说明"></el-input>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer" style="margin-top: -25px">
+        <el-button size="small" @click="jiaoheshow = false">取 消</el-button>
+        <el-button type="primary" size="small" @click="jiaohemakesure()">确 定</el-button>
+      </div>
+    </el-dialog>
     <data-opera ref="DataoperaCompoment" :DataEntryId="DataEntryId+''" :TaskBalanceId="TaskBalanceId+''" :EId="EId+''"
       @init-data="initDatas"></data-opera>
 
@@ -491,11 +536,19 @@
     components: {
       DataOpera
     },
-    data() {
+    data () {
       return {
         dialogVisible: false,
-        activeName: '1',
+        Id: '',
+        EId: '',
+        TaskBalanceId: '',
+        DataEntryId: '',
+        ProoFreadShow: false,
+        jiaoheshow: false,
+        sign: '2',
+        ischeck: 0,
         DataStatus: 0,
+        acceptUsers: [],
         // 列表数据
         entityList: [],
         // 分页参数
@@ -508,6 +561,7 @@
           Prop: ''
         },
         formDataMain: {
+          Id: '',
           Product: '',
           Spec: '',
           SamplingBase: '',
@@ -522,6 +576,9 @@
         searchFormReset: {},
         searchForm: {
           Id: '',
+          EId: '',
+          TaskBalanceId: '',
+          DataEntryId: '',
           Product: '',
           Specifications: '',
           SamplingBase: '',
@@ -553,7 +610,7 @@
           Appearance: '',
           Inspector: '',
           Audit: '',
-          InspectionDate:'',
+          InspectionDate: '',
           Remark: '',
           CreateUserId: '',
           CreateOn: '',
@@ -561,15 +618,26 @@
           ModifiedOn: '',
           ModifiedUserId: '',
           ModifiedBy: ''
+        },
+        // 校核提交
+        shenhesubmitForm: {
+          AuditorUserId: '',
+          DataEntryId: '',
+          SuccessStatus: 1,
+          AuditorRemark: ''
+        },
+        jiaoheForm: {
+          SuccessStatus: 2,
+          AuditorRemark: '',
+          DataEntryId: 0
         }
       }
     },
-    created() {
+    created () {
       this.EId = this.$route.query.eid
       this.TaskBalanceId = this.$route.query.tbid
       this.DataEntryId = this.$route.query.deid
-      this.DataStatus = 0 // parseInt(this.$route.query.datastatus)
-      this.DataDocId = this.$route.query.datadocId
+      this.DataStatus = parseInt(this.$route.query.datastatus)
       this.sign = this.$route.query.sign
       this.ischeck = this.$route.query.ischeck
       // 查询条件初始值备份
@@ -577,13 +645,13 @@
       // 查询列表
       this.getDataEntry()
       this.initDatas()
+      this.getUsersByRole()
       // this.getDictOptions()
     },
     methods: {
-      saveMainInfo() {
+      saveMainInfo () {
         this.$refs['formDataMain'].validate((valid) => {
           if (valid) {
-            console.log("------------this.main",this.formDataMain)
             this.$axios.post('/limsdataentry/updateEntity/' + this.DataEntryId, this.formDataMain).then(res => {
               if (res.data.code === 0) {
                 this.getDataEntry()
@@ -603,7 +671,7 @@
           }
         })
       },
-      getDataEntry() {
+      getDataEntry () {
         this.$axios.get('/limsdataentry/getdataentry/' + this.DataEntryId).then(res => {
           this.formDataMain = res.data
           // this.params.Id = res.data.Id
@@ -611,10 +679,10 @@
           console.log(error)
         })
       },
-      getDataHistory() {
+      getDataHistory () {
 
       },
-      initDatas() {
+      initDatas () {
         // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
@@ -632,6 +700,7 @@
         //   myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
         // }
         // 查询条件
+        this.searchForm.DataEntryId = this.DataEntryId
         Object.assign(params, this.searchForm)
         // 访问接口
         api.getList(myCreateOn.join(','), params, this.$axios).then(res => {
@@ -641,17 +710,122 @@
           console.error(err)
         })
       },
-      addDataEntity() {
+      addDataEntity () {
         // 刷新子列表
         this.$refs['DataoperaCompoment'].resetFormData()
         this.$refs['DataoperaCompoment'].dialogVisible = true
       },
 
-      setProoFreadShow() {
-
+      // 获取校核人列表
+      getUsersByRole () {
+        // request
+        this.$axios.get('/limsdataentry/getuserlistbyjhrole/', {})
+          .then(res => {
+            if (res.data instanceof Array && res.data.length > 0) {
+              this.acceptUsers = res.data
+            }
+          })
+          .catch(err => {
+            // handle error
+            console.error(err)
+          })
+      },
+      setProoFreadShow () {
+        // if (this.formData.PositionCheckId === '') {
+        //   this.$message.warning('检测地点为空,不允许提交!')
+        //   return
+        // }
+        this.ProoFreadShow = true
+      },
+      // 打开校核弹窗
+      jiaoheshowdialog () {
+        this.jiaoheForm.DataEntryId = this.DataEntryId
+        this.jiaoheshow = true
+      },
+      checkstatus () {
+        this.shenhesubmitForm.SuccessStatus = 1
+        this.shenhesubmitForm.DataEntryId = parseInt(this.DataEntryId)
+        let params = this.shenhesubmitForm
+        this.$axios.put('/limsdataentry/checksubmit/', params)
+          .then(res => {
+            // response
+            if (res.data.code === 0) {
+              this.$message({
+                type: 'success',
+                message: res.data.message
+
+              })
+              this.DataStatus = 1
+              // this.initDatas()
+            } else {
+              this.$message({
+                type: 'warning',
+                message: '校核提交错误!'
+              })
+            }
+          })
+          .catch(err => {
+            // handle error
+            console.error(err)
+          })
+      },
+      // 提交校核
+      makesure () {
+        console.log(this.formDataMain.Id, '====')
+        if (!this.formDataMain.Id || this.formDataMain.Id < 0) {
+          this.$message.warning('没有保存,不能提交!')
+          return
+        }
+        this.$confirm('确定提交校核!', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            this.ProoFreadShow = false
+            console.log('1')
+            this.checkstatus()
+          })
+          .catch(() => {})
+      },
+      jiaohecheckstatus () {
+        let params = this.jiaoheForm
+        this.$axios.put('/limsdataentry/jiaohe/', params)
+          .then(res => {
+            // response
+            if (res.data.code === 0) {
+              this.ischeck = '0'
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+              // this.initdata2()
+            } else {
+              this.$message({
+                type: 'warning',
+                message: '校核错误,请先确定您已经录入内容并且录入的内容已经保存'
+              })
+            }
+          })
+          .catch(err => {
+            // handle error
+            console.error(err)
+          })
+      },
+      jiaohemakesure () {
+        this.$confirm('确认校核!', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            this.jiaoheshow = false
+            this.jiaohecheckstatus()
+          })
+          .catch(() => {})
       },
 
-      getDictOptions() {
+      getDictOptions () {
         api.getDictList(this.$axios).then(res => {
 
         }).catch(err => {
@@ -659,7 +833,7 @@
         })
       },
 
-      searchCommand(command) {
+      searchCommand (command) {
         if (command === 'search') {
           this.dialogVisible = true
         } else if (command === 'clear') {
@@ -667,7 +841,7 @@
         }
       },
       // 列表排序功能
-      orderby(column) {
+      orderby (column) {
         if (column.order === 'ascending') {
           this.Column.Order = 'asc'
         } else if (column.order === 'descending') {
@@ -676,27 +850,27 @@
         this.Column.Prop = column.prop
         this.initDatas()
       },
-      clearSearch() {
+      clearSearch () {
         Object.assign(this.searchForm, this.searchFormReset)
         // this.searchForm = this.searchFormReset;
         this.CreateOn = ''
         this.initDatas()
       },
-      handleSearch() {
+      handleSearch () {
         this.currentPage = 1
         this.dialogVisible = false
         this.initDatas()
       },
-      handleCurrentChange(value) {
+      handleCurrentChange (value) {
         this.currentPage = value
         this.initDatas()
       },
-      handleSizeChange(value) {
+      handleSizeChange (value) {
         this.size = value
         this.currentPage = 1
         this.initDatas()
       },
-      deleteEntity(row) {
+      deleteEntity (row) {
         row.deleteConfirmFlag = false
         api.deleteEntity(row.Id, this.$axios).then(res => {
           if (res.data.code === 0) {
@@ -715,12 +889,12 @@
           console.error(err)
         })
       },
-      EditEntity(row) {
+      EditEntity (row) {
         this.$refs['DataoperaCompoment'].subListEditEntity(row.Id)
         this.$refs['DataoperaCompoment'].dialogVisible = true
       },
 
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -733,7 +907,7 @@
         }
       },
 
-      formatDateTime(date) {
+      formatDateTime (date) {
         var y = date.getFullYear()
         var m = date.getMonth() + 1
         m = m < 10 ? ('0' + m) : m
@@ -746,7 +920,6 @@
       }
     }
   }
-
 </script>
 
 <style lang="scss">

+ 136 - 71
src/dashoo.cn/frontend_web/src/pages/lims/wzjys/reportdrillcollar/_opera/operation.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-dialog title="漏电保护信息" :visible.sync="dialogVisible" width="80%">
+    <el-dialog title="石油专用管材钻铤信息" :visible.sync="dialogVisible" width="80%">
       <el-card class="box-card">
         <div slot="header">
           <span>
@@ -23,119 +23,174 @@
 
             <el-col :span="6">
               <el-form-item label="紧密距外螺纹" label-width="120px">
-                <el-input v-model="formData.CloseDistanceOut" style="width:100%" placeholder="请输入">
+                <el-input type="number" step="0.01" v-model.number="formData.CloseDistanceOut" style="width:100%" placeholder="请输入">
                 </el-input>
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
               <el-form-item label="紧密距内螺纹" label-width="120px">
-                <el-input v-model="formData.CloseDistanceIn" style="width:100%" placeholder="请输入">
+                <el-input type="number" step="0.01" v-model.number="formData.CloseDistanceIn" style="width:100%" placeholder="请输入">
                 </el-input>
               </el-form-item>
             </el-col>
-
             <el-col :span="6">
-              <el-form-item label="锥度公差外螺纹" label-width="140px">
-                <el-input v-model="formData.TaperToleranceOut" style="width:100%" placeholder="请输入">
+              <el-form-item label="螺纹轴线与台肩面垂直度" label-width="170px">
+                <el-input type="number" step="0.01" v-model.number="formData.ShoulderSurface" style="width:100%" placeholder="请输入">
                 </el-input>
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
-              <el-form-item label="锥度公差内螺纹" label-width="140px">
-                <el-input v-model="formData.TaperToleranceIn" style="width:100%" placeholder="请输入">
-                </el-input>
+              <el-form-item label="螺纹轴线与端面垂直度" label-width="170px">
+                <el-input type="number" step="0.01" v-model.number="formData.EndFace" style="width:100%" placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
-              <el-form-item label="螺距公差外螺纹" label-width="140px">
-                <el-input v-model="formData.PitchToleranceOut" style="width:100%" placeholder="请输入">
-                </el-input>
+              <el-form-item label="管体外径长轴" label-width="120px">
+                <el-input type="number" step="0.01" v-model.number="formData.MajorAxis" style="width:100%" placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
-              <el-form-item label="螺距公差内螺纹" label-width="140px">
-                <el-input v-model="formData.PitchToleranceIn" style="width:100%" placeholder="请输入">
-                </el-input>
+              <el-form-item label="管体外径短轴" label-width="120px">
+                <el-input type="number" step="0.01" v-model.number="formData.ShortAxis" style="width:100%" placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
-              <el-form-item label="螺纹轴线与台肩面垂直度" label-width="170px">
-                <el-input v-model="formData.ShoulderSurface" style="width:100%" placeholder="请输入">
-                </el-input>
+              <el-form-item label="外径差" label-width="120px">
+                <el-input type="number" step="0.01" v-model.number="formData.OutDiaDif" style="width:100%" placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
-              <el-form-item label="螺纹轴线与端面垂直度" label-width="170px">
-                <el-input v-model="formData.EndFace" style="width:100%" placeholder="请输入"></el-input>
+              <el-form-item label="LPC">
+                <el-input type="number" step="0.01" v-model.number="formData.LPC" style="width:100%" placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
-              <el-form-item label="管体外径长轴" label-width="120px">
-                <el-input v-model="formData.MajorAxis" style="width:100%" placeholder="请输入"></el-input>
+              <el-form-item label="DF">
+                <el-input type="number" step="0.01" v-model.number="formData.DF" style="width:100%" placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
-              <el-form-item label="管体外径短轴" label-width="120px">
-                <el-input v-model="formData.ShortAxis" style="width:100%" placeholder="请输入"></el-input>
+              <el-form-item label="QC">
+                <el-input type="number" step="0.01" v-model.number="formData.QC" style="width:100%" placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
-              <el-form-item label="外径差" label-width="120px">
-                <el-input v-model="formData.OutDiaDif" style="width:100%" placeholder="请输入"></el-input>
+              <el-form-item label="DRG">
+                <el-input type="number" step="0.01" v-model.number="formData.DRG" style="width:100%" placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
-              <el-form-item label="LPC">
-                <el-input v-model="formData.LPC" style="width:100%" placeholder="请输入"></el-input>
+              <el-form-item label="管体长度">
+                <el-input type="number" step="0.01" v-model.number="formData.TubeLength" style="width:100%" placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
-              <el-form-item label="DF">
-                <el-input v-model="formData.DF" style="width:100%" placeholder="请输入"></el-input>
+              <el-form-item label="管体内径">
+                <el-input type="number" step="0.01" v-model.number="formData.InterDiameter" style="width:100%" placeholder="请输入">
+                </el-input>
               </el-form-item>
             </el-col>
-
+          </el-row>
+        </el-form>
+        <el-form label-width="110px" ref="EntityFormtop" label-position="top" :model="formData">
+          <el-row :gutter="10">
             <el-col :span="6">
-              <el-form-item label="QC">
-                <el-input v-model="formData.QC" style="width:100%" placeholder="请输入"></el-input>
+              <el-form-item label="锥度公差外螺纹" label-width="140px">
+                <el-input type="number" step="0.01" v-model.number="formData.TaperToleranceOut1" style="width:50%" placeholder="请输入">
+                </el-input>
+                <el-input type="number" step="0.01" v-model.number="formData.TaperToleranceOut2" style="width:50%" placeholder="请输入">
+                </el-input>
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
-              <el-form-item label="DRG">
-                <el-input v-model="formData.DRG" style="width:100%" placeholder="请输入"></el-input>
+              <el-form-item label="锥度公差内螺纹" label-width="140px">
+                <el-input type="number" step="0.01" v-model.number="formData.TaperToleranceIn1" style="width:50%" placeholder="请输入">
+                </el-input>
+                <el-input type="number" step="0.01" v-model.number="formData.TaperToleranceIn2" style="width:50%" placeholder="请输入">
+                </el-input>
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
-              <el-form-item label="管体长度">
-                <el-input v-model="formData.TubeLength" style="width:100%" placeholder="请输入"></el-input>
+              <el-form-item label="螺距公差外螺纹" label-width="140px">
+                <el-input type="number" step="0.01" v-model.number="formData.PitchToleranceOut1" style="width:50%" placeholder="请输入">
+                </el-input>
+                <el-input type="number" step="0.01" v-model.number="formData.PitchToleranceOut2" style="width:50%" placeholder="请输入">
+                </el-input>
               </el-form-item>
             </el-col>
 
             <el-col :span="6">
-              <el-form-item label="管体内径">
-                <el-input v-model="formData.InterDiameter" style="width:100%" placeholder="请输入">
+              <el-form-item label="螺距公差内螺纹" label-width="140px">
+                <el-input type="number" step="0.01" v-model.number="formData.PitchToleranceIn1" style="width:50%" placeholder="请输入">
+                </el-input>
+                <el-input type="number" step="0.01" v-model.number="formData.PitchToleranceIn2" style="width:50%" placeholder="请输入">
                 </el-input>
               </el-form-item>
             </el-col>
+
+            <el-col :span="8">
+              <el-form-item label="壁厚差">
+                <el-tooltip content="t大" placement="top" effect="dark">
+                  <el-input type="number" step="0.01" v-model.number="formData.WallDif1" style="width:33%" placeholder="t大">
+                  </el-input>
+                </el-tooltip>
+                <el-tooltip content="t小" placement="top" effect="dark">
+                  <el-input type="number" step="0.01" v-model.number="formData.ExDiameterM1" style="width:33%" placeholder="t小">
+                  </el-input>
+                </el-tooltip>
+                <el-tooltip content="△" placement="top" effect="dark">
+                  <el-input type="number" step="0.01" v-model.number="formData.WallDifference1" style="width:34%" placeholder="△">
+                  </el-input>
+                </el-tooltip>
+              </el-form-item>
+            </el-col>
+
             <el-col :span="6">
-              <el-form-item label="外观检验">
-                <el-input v-model="formData.Appearance" style="width:100%" placeholder="请输入"></el-input>
+              <el-form-item label="壁厚差">
+                <el-tooltip content="t大" placement="top" effect="dark">
+                  <el-input type="number" step="0.01" v-model.number="formData.WallDif2" style="width:33%" placeholder="t大">
+                  </el-input>
+                </el-tooltip>
+                <el-tooltip content="t小" placement="top" effect="dark">
+                  <el-input type="number" step="0.01" v-model.number="formData.ExDiameterM2" style="width:33%" placeholder="t小">
+                  </el-input>
+                </el-tooltip>
+                <el-tooltip content="△" placement="top" effect="dark">
+                  <el-input type="number" step="0.01" v-model.number="formData.WallDifference2" style="width:34%" placeholder="△">
+                  </el-input>
+                </el-tooltip>
               </el-form-item>
             </el-col>
 
+            <el-col :span="6">
+              <el-form-item label="壁厚差">
+                <el-tooltip content="t大" placement="top" effect="dark">
+                  <el-input type="number" step="0.01" v-model.number="formData.WallDif3" style="width:33%" placeholder="t大">
+                  </el-input>
+                </el-tooltip>
+                <el-tooltip content="t小" placement="top" effect="dark">
+                  <el-input type="number" step="0.01" v-model.number="formData.ExDiameterM3" style="width:33%" placeholder="t小">
+                  </el-input>
+                </el-tooltip>
+                <el-tooltip content="△" placement="top" effect="dark">
+                  <el-input type="number" step="0.01" v-model.number="formData.WallDifference3" style="width:34%" placeholder="△">
+                  </el-input>
+                </el-tooltip>
+              </el-form-item>
+            </el-col>
 
             <el-col :span="24">
               <el-form-item :span="24" style="text-align: center;">
@@ -173,7 +228,7 @@
       DataEntryId: String
     },
 
-    data() {
+    data () {
       return {
         saveBtnName: '新增',
         continueInsertChecked: false,
@@ -182,6 +237,9 @@
         historyData: {},
         formData: {
           Id: '',
+          EId: '',
+          TaskBalanceId: '',
+          DataEntryId: '',
           Product: '',
           Specifications: '',
           SamplingBase: '',
@@ -189,31 +247,38 @@
           SampleNumber: '',
           CloseDistanceOut: '',
           CloseDistanceIn: '',
-          TaperToleranceOut: '',
-          TaperToleranceIn: '',
-          PitchToleranceOut: '',
-          PitchToleranceIn: '',
+          TaperToleranceOut1: '',
+          TaperToleranceOut2: '',
+          TaperToleranceIn1: '',
+          TaperToleranceIn2: '',
+          PitchToleranceOut1: '',
+          PitchToleranceOut2: '',
+          PitchToleranceIn1: '',
+          PitchToleranceIn2: '',
           ShoulderSurface: '',
           EndFace: '',
-          TubeDiameter: '',
+          MajorAxis: '',
+          ShortAxis: '',
+          OutDiaDif: '',
           DF: '',
           QC: '',
           DRG: '',
           LPC: '',
-          WallDif: '',
+          WallDif1: '',
+          WallDif2: '',
+          WallDif3: '',
+          ExDiameterM1: '',
+          ExDiameterM2: '',
+          ExDiameterM3: '',
+          WallDifference1: '',
+          WallDifference2: '',
+          WallDifference3: '',
+          InterDiameter: '',
           TubeLength: '',
-          InnerDiameter: '',
-          WallThickness: '',
-          JointDiameterM: '',
-          JointDiameterF: '',
-          WallDifF: '',
-          WallDifM: '',
-          OuterDiameterF: '',
-          OuterDiameterM: '',
           Appearance: '',
           Inspector: '',
           Audit: '',
-          InspectionDate:'',
+          InspectionDate: '',
           CreateUserId: '',
           CreateOn: '',
           CreateBy: '',
@@ -223,7 +288,7 @@
         }
       }
     },
-    created() {
+    created () {
       this.getDictOptions()
 
       if (this.serviceId > 0) {
@@ -240,10 +305,9 @@
       Object.assign(this.historyData, this.formData)
     },
     methods: {
-      initDatas() {
+      initDatas () {
         if (this.formData.Id) {
           api.getEntity(this.formData.Id, this.$axios).then(res => {
-            console.log('initDatas')
             this.formData = res.data
             this.$emit('init-data')
             if (this.continueInsertChecked) {
@@ -254,7 +318,7 @@
           })
         }
       },
-      resetFormData() {
+      resetFormData () {
         Object.assign(this.formData, this.historyData)
         this.saveBtnName = '新增'
         this.formData.Id = 0
@@ -262,7 +326,7 @@
         this.formData.TaskBalanceId = this.TaskBalanceId
         this.formData.DataEntryId = this.DataEntryId
       },
-      subListEditEntity(entityId) {
+      subListEditEntity (entityId) {
         this.serviceId = entityId
         this.formData.Id = this.serviceId
         this.saveBtnName = '修改' // 修改
@@ -270,7 +334,7 @@
         this.initDatas()
       },
 
-      getDictOptions() {
+      getDictOptions () {
         api.getDictList(this.$axios).then(res => {
 
         }).catch(err => {
@@ -279,10 +343,12 @@
       },
 
       // 保存信息
-      saveEntity() {
-        console.log(this.formData, '===========')
+      saveEntity () {
         this.$refs['EntityForm'].validate((valid) => {
           if (valid) {
+            this.formData.EId = parseInt(this.formData.EId)
+            this.formData.DataEntryId = parseInt(this.formData.DataEntryId)
+            this.formData.TaskBalanceId = parseInt(this.formData.TaskBalanceId)
             if (!this.formData.Id) {
               this.addEntity()
             } else {
@@ -293,7 +359,7 @@
           }
         })
       },
-      addEntity() {
+      addEntity () {
         api.addEntity(this.formData, this.$axios).then(res => {
           if (res.data.code === 0) {
             // 保存成功后,初始化数据,变成修改
@@ -314,7 +380,7 @@
           console.error(err)
         })
       },
-      updateEntity() {
+      updateEntity () {
         api.updateEntity(this.formData.Id, this.formData, this.$axios).then(res => {
           if (res.data.code === 0) {
             // 保存成功后,初始化数据,变成修改
@@ -333,11 +399,11 @@
           console.error(err)
         })
       },
-      continueInsertChange() {
+      continueInsertChange () {
         this.formData.Id = 0
         this.saveBtnName = '新增'
       },
-      jstimehandle(val) {
+      jstimehandle (val) {
         if (val === '') {
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
@@ -350,7 +416,7 @@
         }
       },
 
-      formatDateTime(date) {
+      formatDateTime (date) {
         var y = date.getFullYear()
         var m = date.getMonth() + 1
         m = m < 10 ? ('0' + m) : m
@@ -363,7 +429,6 @@
       }
     }
   }
-
 </script>
 
 <style lang="scss">