@@ -340,7 +400,6 @@
@row-click="itemClickRow1"
@selection-change="selectionItem1"
highlight-current-row
- v-loading="dataListLoading"
style="width: 100%">
{
+ if (data.code === 0) {
+ this.tableData = data.rows
+ } else {
+ this.tableData = []
+ }
+ })
+ this.inspectionStandardModalFlag = true
+ },
+
+ //表格的新增
+ rowClassName ({ row, rowIndex }) {
+ row.xh = rowIndex + 1
+ },
+
+ //单选框选中数据
+ handleDetailSelectionChange (selection) {
+ this.checkedDetail = selection
+ },
+
+ // 点击新增
+ handleAddBtn () {
+ let obj = {
+ collectionSource: '',
+ defaultValue: '',
+ minValue: '',
+ maxValue: '',
+ condition: ''
+ }
+ this.tableData.push(obj)
+ },
+
+ //删除
+ handleDeleteBtn () {
+ if (this.checkedDetail.length === 0) {
+ this.$alert("请先选择要删除的数据", "提示", {
+ confirmButtonText: "确定",
+ })
+ } else {
+ this.$confirm("请是否确认删除该检验标准?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ callback: (action) => {
+ if (action === "confirm") {
+ let val = this.checkedDetail
+ val.forEach((val, index) => {
+ this.tableData.forEach((v, i) => {
+ if (val.xh === v.xh) {
+ this.tableData.splice(i, 1)
+ }
+ })
+ })
+ this.$message({
+ message: "删除成功!",
+ type: "success",
+ })
+ return
+ } else {
+ this.$message({
+ message: "已取消删除操作",
+ type: "warning",
+ })
+ return
+ }
+ },
+ })
+ }
+ },
+
+ // 回车事件
+ nextFocus1 (index) {
+ let a1 = `${index + 1}` + `a`
+ this.$nextTick(() => {
+ this.$refs[a1].focus()
+ })
+ },
+ nextFocus2 (index) {
+ let a2 = `${index + 1}` + `b`
+ this.$nextTick(() => {
+ this.$refs[a2].focus()
+ })
+ },
+ nextFocus3 (index) {
+ let a3 = `${index + 1}` + `c`
+ this.$nextTick(() => {
+ this.$refs[a3].focus()
+ })
+ },
+
+ // 新增检验标准
+ saveInspectionStandard () {
+ this.standardData.standardList = this.tableData
+ saveInspectionStandard(this.standardData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.inspectionStandardModalFlag = false
+ this.tableData = []
+ this.$message({
+ message: '操作成功',
+ type: 'success',
+ duration: 1500,
+ onClose: () => {}
+ })
+ } else {
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
+ }
+ })
+ },
+
+
// 获取用户的bu
getSiteAndBuByUserName () {
let tempData = {
@@ -1124,7 +1314,6 @@
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
}
- this.dataListLoading = false
})
},
@@ -1288,7 +1477,7 @@
this.detailData.inspectionTypeName = row.inspectionTypeName
templateDetailsSearch(this.detailData).then(({data}) => {
this.detailList = data.rows
- this.objectSearch()
+ //this.objectSearch()
})
this.detailModelFlag = true
},