|
|
|
@ -436,15 +436,27 @@
|
|
|
|
|
<p>验证码: {{ captcha }}</p>
|
|
|
|
|
<el-input v-model="captchaInput" placeholder="请输入验证码"></el-input>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="deleteDialogVisible = false">取消</el-button>
|
|
|
|
|
<el-button type="primary" @click="confirmDelete">确定</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
<el-button @click="deleteDialogVisible = false">取消</el-button>
|
|
|
|
|
<el-button type="primary" @click="confirmDelete">确定</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="提示"
|
|
|
|
|
:visible.sync="mergeVisible"
|
|
|
|
|
width="30%">
|
|
|
|
|
<span>已有相同的物资,是否合并?</span>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="merage()">合 并</el-button>
|
|
|
|
|
<el-button @click="nomerage()">不合并</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { listEhsMaterial, getEhsMaterial, delEhsMaterial, addEhsMaterial, updateEhsMaterial } from "@/api/ehs/ehsMaterial";
|
|
|
|
|
import { listEhsMaterial, getEhsMaterial, delEhsMaterial, addEhsMaterial, updateEhsMaterial, checkRepeat, merageMaterial } from "@/api/ehs/ehsMaterial";
|
|
|
|
|
import {listAllDept } from "@/api/system/dept";
|
|
|
|
|
import {addEhsMaterialDetail,listEhsMaterialDetail, updateEhsMaterialDetail , delEhsMaterialDetail} from "@/api/ehs/EhsMaterialDetail";
|
|
|
|
|
import { getMaterialClassJson } from "@/api/ehs/materialClassMaster";
|
|
|
|
@ -553,6 +565,7 @@
|
|
|
|
|
materialQuantity: '',
|
|
|
|
|
deleteDialogVisible: false,
|
|
|
|
|
materialToDelete: null,
|
|
|
|
|
mergeVisible: false,
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
|
|
|
|
materialQuantity: [
|
|
|
|
@ -670,6 +683,24 @@
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 不合并
|
|
|
|
|
nomerage() {
|
|
|
|
|
this.mergeVisible = false;
|
|
|
|
|
addEhsMaterial(this.form).then(resp => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 合并
|
|
|
|
|
merage() {
|
|
|
|
|
this.mergeVisible = false;
|
|
|
|
|
merageMaterial(this.form).then(resp => {
|
|
|
|
|
this.$modal.msgSuccess("合并成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/*getDictList() {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
let str = "";
|
|
|
|
@ -799,10 +830,15 @@
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
addEhsMaterial(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
checkRepeat(this.form).then(response => {
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
}
|
|
|
|
|
if (response.code === 209) {
|
|
|
|
|
this.mergeVisible = true;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|