123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <template>
- <!-- 添加物资信息 -->
- <div class="addWagonLoad">
- <PageTitle>返回</PageTitle>
- <div class="form-box" style="margin-right: 10rem">
- <dil-form :formId="326" v-model="form1" ref="from1"></dil-form>
- </div>
- <div class="form-box f1">
- <el-form :inline="true" :model="formInline" class="demo-form-inline">
- <div class="disableBox">
- <el-form-item>
- <el-input v-model="materialTypeName" disabled>
- </el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="drawer = true">物资种类</el-button>
- </el-form-item>
- </div>
- </el-form>
- </div>
- <el-drawer
- :visible.sync="drawer"
- :direction="direction"
- :before-close="handleClose">
- <el-input
- placeholder="请输入内容"
- v-model="inputText"
- clearable>
- </el-input>
- <el-button type="primary" class="btn" @click="onclick">
- <i class="el-icon-search"></i>查询
- </el-button>
- <div><dilTable v-bind.sync="options" @radio-change="currentRadioChange" ></dilTable></div>
- </el-drawer>
- <div class="button-box">
- <el-button @click="cancel">取消</el-button>
- <el-button type="primary" @click="makeSure">确定</el-button>
- </div>
- </div>
- </template>
- <script>
- import PageTitle from "@/components/Page/Title";
- export default {
- components: { PageTitle },
- data() {
- return {
- form1: {},
- drawer: false,
- direction: 'rtl',
- inputText:"",
- options:{
- requestUrl:"/api/v1/rms/getMaterialTypeList?apiId=376",
- selectionType:"radio",
- mapList:[]
- }
- };
- },
- mounted() {},
- methods: {
- currentRadioChange(selection){
- this.mapList=selection,
- console.log(this.mapList)
- this.materialTypeName=this.mapList.materialTypeName
- },
- onclick(){
- this.options.requestUrl="/api/v1/rms/getMaterialTypeList?apiId=376&con=" +this.inputText;
- },
- makeSure() {
- let RmsMaterial = {
- materialCode:this.form1.materialCode,
- materialName:this.form1.materialName,
- materialSpecification:this.form1.materialSpecification,
- materialModel:this.form1.materialModel,
- materialTypeId:this.mapList.materialTypeId,
- unitOfMeasureId:this.form1.unitOfMeasureId,
- materialTheoreticalWeight:this.form1.materialTheoreticalWeight,
- };
- if(
- RmsMaterial.materialCode==null ||
- RmsMaterial.materialName==null ||
- RmsMaterial.materialSpecification==null ||
- RmsMaterial.materialModel==null ||
- RmsMaterial.materialTypeId==null ||
- RmsMaterial.unitOfMeasureId==null ||
- RmsMaterial.materialTheoreticalWeight==null
- )this.$message.error("存在空值!");
- else
- this.axios
- .post(
- "/api/v1/rms/insertMaterial",
- RmsMaterial
- )
- .then((res) => {
- if (res.data.code == 200) {
- this.$message({
- type: "success",
- message: "新增成功!",
- });
- // this.$refs.table.refreshData();
- this.$router.go(-1);
- } else {
- this.$message.error("新增失败,可能存在重复!");
- }
- this.$refs['table'].resetField();
- });
- },
- // 取消
- cancel() {
- this.$router.go(-1);
- },
- },
- handleClose(done) {
- this.$confirm('确认关闭?')
- .then(_ => {
- done();
- })
- .catch(_ => {});
- }
- };
- </script>
- <style lang='scss' >
- .button-box{
- display: flex;
- justify-content: center;
- .el-button{
- width: 80px;
- margin-right: 10px;
- }
- }
- .disableBox{
- display: flex;
- text-align: center;
- align-items: center;
- justify-content: center;
- margin-top: 1.5rem;
- margin-bottom: 1.25rem;
- }
- .btn-left {
- margin-left: 470px;
- }
- .input {
- margin-left: 90px;
- }
- .common{
- font-weight: 700;
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
- Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
- font-size: 1rem;
- cursor: default;
- color: #2c3e50;
- }
- .f1{
- margin-top: -2.5rem;
- margin-left: 22.3rem;
- }
- .f11{
- margin-top: -3rem;
- // margin-left: 29rem;
- }
- .f2{
- margin-top: -2.5rem;
- margin-left: 20.7rem;
- }
- .f3{
- margin-top: -2.5rem;
- margin-left: 25rem;
- }
- .form-box{
- display: flex;
- justify-content: center;
- .el-form-item{
- display: flex;
- justify-content: center;
- .el-form-item__label{
- display: flex;
- align-items: center;
- }
- .el-form-item__content{
- .el-input{
- .el-input__inner{
- width: 250px;
- }
- }
- }
- }
- }
- </style>
|