|
@@ -350,6 +350,133 @@
|
|
|
<span v-else>{{scope.row.lengths}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ label="添加化学成分信息"
|
|
|
+ width="110px"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ v-if="filterForm.data.gx==='LG'"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-popover
|
|
|
+ placement="top"
|
|
|
+ title="添加化学成分信息"
|
|
|
+ width="600"
|
|
|
+ :ref="'popover-' + scope.row.id"
|
|
|
+ trigger="click"
|
|
|
+ @show="gethxcfDate(scope.row)"
|
|
|
+ >
|
|
|
+ <div style="float:left">
|
|
|
+ <el-button
|
|
|
+ class="button"
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ icon="el-icon-edit-outline"
|
|
|
+ @click="addhxcf(scope.row)"
|
|
|
+ :loading="loading"
|
|
|
+ >
|
|
|
+ 保存
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div class="box-bottom">
|
|
|
+ <P><el-button class="el-icon-plus" style="float:right;margin-top:34px;padding:9px 20px;margin-right: 4px" type="min" @click.prevent="addRow(scope.row)"></el-button></P>
|
|
|
+ <p><el-button class="el-icon-minus" style="position:relative;top:34px;left:380px;padding:9px 20px" type="min" @click.prevent="delData(scope.row)"></el-button></p>
|
|
|
+ <el-form
|
|
|
+ size="mini"
|
|
|
+ ref="dialog_form_hxcf"
|
|
|
+ label-width="0px"
|
|
|
+ :model="hxcfDataObj"
|
|
|
+ >
|
|
|
+ <el-table
|
|
|
+ id="multipleTable"
|
|
|
+ ref="multipleTable"
|
|
|
+ :data="gridData"
|
|
|
+ tooltip-effect="dark"
|
|
|
+ v-loading="gridDataLoading"
|
|
|
+ border
|
|
|
+ stripe
|
|
|
+ style="width: 80%"
|
|
|
+ @selection-change="selectRow"
|
|
|
+ @cell-click="cellClickHxcf"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ width="40"
|
|
|
+ align="center"
|
|
|
+ fixed="left"
|
|
|
+ class-name="cnspicuous"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ sortable
|
|
|
+ label="成分信息"
|
|
|
+ prop="chemcode"
|
|
|
+ align="center"
|
|
|
+ min-width="100px"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-form-item
|
|
|
+ v-if="scope.row.isSelection"
|
|
|
+ :prop="scope.row.seq + '.chemcode'"
|
|
|
+ :rules="hxcfRules.chemcode"
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ filterable
|
|
|
+ collapse-tags
|
|
|
+ v-model="hxcfDataObj[scope.row.seq].chemcode"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item of nameObj.hxcf.arr"
|
|
|
+ :key="item.id"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <span v-else>{{nameObj.hxcf.obj[scope.row.chemcode] ? nameObj.hxcf.obj[scope.row.chemcode].name : scope.row.chemcode }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column sortable min-width="100" prop="nkstdmin" align="center" label="下限值">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-form-item
|
|
|
+ v-if="scope.row.isSelection"
|
|
|
+ :prop="scope.row.seq + '.nkstdmin'"
|
|
|
+ :rules="hxcfRules.nkstdmin"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ style="width: 100%;"
|
|
|
+ v-model="hxcfDataObj[scope.row.seq].nkstdmin"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <span v-else>{{scope.row.nkstdmin}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column sortable min-width="100" prop="nkstdmax" align="center" label="上限值">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-form-item
|
|
|
+ v-if="scope.row.isSelection"
|
|
|
+ :prop="scope.row.seq + '.nkstdmax'"
|
|
|
+ :rules="hxcfRules.nkstdmax"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ style="width: 100%;"
|
|
|
+ v-model="hxcfDataObj[scope.row.seq].nkstdmax"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <span v-else>{{scope.row.nkstdmax}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-button slot="reference" class= "el-tooltip" size="mini" type="text">点击添加数据</el-button>
|
|
|
+ </el-popover>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
sortable
|
|
|
prop="planweight"
|
|
@@ -848,6 +975,8 @@ export default {
|
|
|
seqArr: [],
|
|
|
editSetFlag: '',
|
|
|
isCheck: false, // 是否为审核人
|
|
|
+ visible: false,
|
|
|
+ selectlistRow: [],
|
|
|
filterForm: {
|
|
|
show: true,
|
|
|
data: {
|
|
@@ -957,10 +1086,27 @@ export default {
|
|
|
singleTableHeight: 100,
|
|
|
tableData: [
|
|
|
],
|
|
|
+ gridData: [],
|
|
|
loading: false,
|
|
|
tableLoading: false,
|
|
|
+ gridDataLoading: false,
|
|
|
multipleSelection: [],
|
|
|
+ hxcfSelection: [],
|
|
|
+ hxcfDataObj: {},
|
|
|
tableFormDataObj: {},
|
|
|
+ hxcfRules: {
|
|
|
+ chemcode: [
|
|
|
+ { required: true, message: '该项不能为空', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ nkstdmin: [
|
|
|
+ { required: true, message: '该项不能为空', trigger: 'change' },
|
|
|
+ { validator: zCheckNumber1, trigger: 'change' }
|
|
|
+ ],
|
|
|
+ nkstdmax: [
|
|
|
+ { required: true, message: '该项不能为空', trigger: 'change' },
|
|
|
+ { validator: zCheckNumber1, trigger: 'change' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
tableFormRules: {
|
|
|
grades: [
|
|
|
{ required: true, message: '该项不能为空', trigger: 'change' }
|
|
@@ -1069,6 +1215,10 @@ export default {
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
+ hxcf: {
|
|
|
+ obj: {},
|
|
|
+ arr: []
|
|
|
+ },
|
|
|
workprocid: {
|
|
|
obj: {},
|
|
|
arr: []
|
|
@@ -1208,6 +1358,7 @@ export default {
|
|
|
// that.getLocation();
|
|
|
that.getUnitIdData();
|
|
|
that.getLocateIdData();
|
|
|
+ that.gethxcf();
|
|
|
// that.getTableData();
|
|
|
},
|
|
|
methods: {
|
|
@@ -1231,7 +1382,6 @@ export default {
|
|
|
type = '型钢'
|
|
|
}
|
|
|
let url = 'pass/product/v1/emssteel/getGrades/?type=' + type;
|
|
|
-
|
|
|
that.axios.get(url)
|
|
|
.then(function (res) {
|
|
|
if (res.code === '0') {
|
|
@@ -1254,6 +1404,182 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ gethxcfDate(row){
|
|
|
+ let that = this;
|
|
|
+ let url = 'pass/ems/v1/chemicalconstituentss/getDataByGmid';
|
|
|
+ let params ={};
|
|
|
+ params = {
|
|
|
+ gmid: row.id
|
|
|
+ }
|
|
|
+ that.gridDataLoading = true;
|
|
|
+ that.axios.get(url, {
|
|
|
+ params: params
|
|
|
+ }).then(function (res) {
|
|
|
+ if (res.code === '0') {
|
|
|
+ let arr = [];
|
|
|
+ for(let i = 0 ; i < res.data.length; i++){
|
|
|
+ let item = res.data[i];
|
|
|
+ arr.push({
|
|
|
+ seq: i,
|
|
|
+ gmid: item.gmid,
|
|
|
+ chemcode: item.chemCode,
|
|
|
+ nkstdmin: item.nkStdMin,
|
|
|
+ nkstdmax: item.nkStdMax
|
|
|
+ })
|
|
|
+ }
|
|
|
+ that.gridData = arr;
|
|
|
+ that.gridDataLoading = false;
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ }).catch(function () {
|
|
|
+ that.leftTableLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ addhxcf(row){
|
|
|
+ let that = this;
|
|
|
+ if (that.hxcfSelection.length > 0){
|
|
|
+ that.$refs['dialog_form_hxcf'].validate((valid, obj) => {
|
|
|
+
|
|
|
+ if (valid) {
|
|
|
+ let SubmitData = [];
|
|
|
+ for (let key in that.hxcfDataObj) {
|
|
|
+ SubmitData.push({
|
|
|
+ gmid: row.id,
|
|
|
+ chemCode: that.hxcfDataObj[key].chemcode,
|
|
|
+ nkStdMin: that.hxcfDataObj[key].nkstdmin,
|
|
|
+ nkStdMax: that.hxcfDataObj[key].nkstdmax
|
|
|
+ });
|
|
|
+ }
|
|
|
+ that.gridDataLoading = true;
|
|
|
+ that.axios.put('pass/ems/v1/chemicalconstituentss/update', SubmitData)
|
|
|
+ .then(function (res) {
|
|
|
+ if (res.code === '0') {
|
|
|
+ that.$message({
|
|
|
+ message: '保存成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ that.gethxcfDate(row);
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ that.gridDataLoading = false;
|
|
|
+ }).catch(function () {
|
|
|
+ that.gridDataLoading = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message.error('至少要选择一条数据');
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ gethxcf () {
|
|
|
+ let that = this;
|
|
|
+ let url = 'pass/ems/v1/qcmbasechems/getIdAndName'
|
|
|
+ that.axios.get(url)
|
|
|
+ .then(function (res) {
|
|
|
+ if (res.code === '0') {
|
|
|
+ let arr = [];
|
|
|
+ let obj = {};
|
|
|
+ for (let item of res.data) {
|
|
|
+ arr.push({
|
|
|
+ id: item.chemCode,
|
|
|
+ name: item.chemName
|
|
|
+ })
|
|
|
+ obj[item.id] = {
|
|
|
+ name: item.chemName,
|
|
|
+ id: item.id
|
|
|
+ }
|
|
|
+ }
|
|
|
+ that.nameObj.hxcf.arr = arr;
|
|
|
+ that.nameObj.hxcf.obj = obj;
|
|
|
+ } else {
|
|
|
+ that.$message.error(res.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ selectRow (val) {
|
|
|
+ let that = this;
|
|
|
+ let hxcfDataObj = {};
|
|
|
+ let arr = [];
|
|
|
+ for (let item of val) {
|
|
|
+ arr.push(item.seq);
|
|
|
+ }
|
|
|
+ this.seqArr = arr.sort(sortNumber);
|
|
|
+ for (let item of that.gridData) {
|
|
|
+ item.isSelection = false;
|
|
|
+ }
|
|
|
+ for (let item of val) {
|
|
|
+ let obj = {};
|
|
|
+ let xId = item.seq;
|
|
|
+ if (that.hxcfDataObj[xId]) {
|
|
|
+ hxcfDataObj[xId] = that.hxcfDataObj[xId];
|
|
|
+ } else {
|
|
|
+ for (let key in item) {
|
|
|
+ obj[key] = item[key];
|
|
|
+ }
|
|
|
+ hxcfDataObj[xId] = obj;
|
|
|
+ }
|
|
|
+ item.isSelection = true;
|
|
|
+ }
|
|
|
+ that.hxcfDataObj = hxcfDataObj;
|
|
|
+ that.hxcfSelection = val;
|
|
|
+ },
|
|
|
+ addRow (row) {
|
|
|
+ let that = this;
|
|
|
+ let seq = that.gridData.length;
|
|
|
+ var list = {
|
|
|
+ seq:seq+1,
|
|
|
+ chemcode:'',
|
|
|
+ nkstdmin: 0,
|
|
|
+ nkstdmax: 0
|
|
|
+ }
|
|
|
+ this.gridData.unshift(list)
|
|
|
+ },
|
|
|
+ delData () {
|
|
|
+ let that = this;
|
|
|
+ let gridData = that.gridData;
|
|
|
+ //let val = that.hxcfSelection;
|
|
|
+ if( that.hxcfSelection.length >0 ){
|
|
|
+ let SubmitData = [];
|
|
|
+ for (let item of that.hxcfSelection) {
|
|
|
+ SubmitData.push({
|
|
|
+ gmid: item.gmid,
|
|
|
+ chemCode: item.chemcode,
|
|
|
+ nkStdMin: item.nkstdmin,
|
|
|
+ nkStdMax: item.nkstdmax
|
|
|
+ });
|
|
|
+ }
|
|
|
+ that.axios.delete('pass/ems/v1/chemicalconstituentss/delete', {
|
|
|
+ data: SubmitData,
|
|
|
+ contentType: 'application/json;charset=UTF-8'
|
|
|
+ }).then(function (res) {
|
|
|
+ if (res.code === '0') {
|
|
|
+ that.$message({
|
|
|
+ message: '删除成功',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ that.hxcfSelection.forEach((val, index) => {
|
|
|
+ gridData.forEach((v, i) => {
|
|
|
+ if (val.seq === v.seq) {
|
|
|
+ gridData.splice(i, 1)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ //this.$refs.multipleTable.clearSelection();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // that.$confirm('是否删除已选数据?', '提示', {
|
|
|
+ // confirmButtonText: '确定',
|
|
|
+ // cancelButtonText: '取消',
|
|
|
+ // state: 'warning'
|
|
|
+ // }).then(() => {
|
|
|
+ // });
|
|
|
+ } else {
|
|
|
+ this.$message.error('至少要选择一条数据');
|
|
|
+ }
|
|
|
+ },
|
|
|
// 获取高线规格
|
|
|
getSpecifications () {
|
|
|
let that = this
|
|
@@ -1329,7 +1655,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 获取炼钢规格
|
|
|
- getSpecificationsAsLg () {
|
|
|
+ getSpecificationsAsLg() {
|
|
|
let that = this
|
|
|
let url = 'pass/product/v1/emsvqcmbasespecbillet/getbasespecbillet';
|
|
|
that.axios.get(url)
|
|
@@ -1445,6 +1771,7 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
// 保存数据
|
|
|
dataSave () {
|
|
|
let that = this;
|
|
@@ -1718,6 +2045,13 @@ export default {
|
|
|
return true;
|
|
|
}
|
|
|
},
|
|
|
+ //成分标准选择
|
|
|
+ checkboxTcf(row, index){
|
|
|
+ if(row.isSelection){
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ },
|
|
|
// 获取标准计量单位
|
|
|
getUnitIdData () {
|
|
|
let that = this
|
|
@@ -2081,6 +2415,20 @@ export default {
|
|
|
// 把每一行的索引放进row
|
|
|
row.index = rowIndex;
|
|
|
},
|
|
|
+ cellClickHxcf(row, column, cell, event){
|
|
|
+ let _this = this;
|
|
|
+ this.rowIndex = row.index;
|
|
|
+ this.columnId = column.id;
|
|
|
+ _this.editSetFlag = row.index + column.id;
|
|
|
+ _this.focusTarget = event.target;
|
|
|
+ while (_this.focusTarget.tagName !== 'TD') {
|
|
|
+ _this.focusTarget = _this.focusTarget.parentElement;
|
|
|
+ }
|
|
|
+ _this.$nextTick(() => {
|
|
|
+ let target = this.focusTarget;
|
|
|
+ $(target).find('input').focus();
|
|
|
+ });
|
|
|
+ },
|
|
|
cellClick (row, column, cell, event) {
|
|
|
let _this = this;
|
|
|
this.rowIndex = row.index;
|