123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- <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-input v-model="materialTypeName" disabled> </el-input>
- <el-button type="primary" @click="openDrawer">物资种类</el-button>
- </div>
- <div class="eldrawer">
- <el-drawer
- :visible.sync="drawer"
- :direction="direction"
- :before-close="handleClose"
- >
- <el-input
- placeholder="请输入内容"
- v-model="inputText"
- clearable
- style="width:250px"
- >
- </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>
- <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: "",
- materialTypeId: "",
- materialTypeName: null,
- options: {
- requestUrl: "/api/v1/rms/getMaterialTypeList?apiId=376",
- selectionType: "radio"
- },
- mapList: {}
- };
- },
- mounted() {},
- methods: {
- currentRadioChange(selection) {
- console.log(selection);
- this.mapList = selection;
- this.materialTypeId = this.mapList.materialTypeId;
- console.log(this.mapList);
- this.materialTypeName = this.mapList.materialTypeName;
- },
- openDrawer() {
- this.options.requestUrl =
- "/api/v1/rms/getMaterialTypeList?apiId=376&i=" + new Date();
- this.drawer = true;
- this.inputText = null;
- },
- onclick() {
- this.options.requestUrl =
- "/api/v1/rms/getMaterialTypeList?apiId=376&con=" + this.inputText;
- },
- makeSure() {
- let RmsMaterial = {
- materialName: this.form1.materialName,
- materialSpecification: this.form1.materialSpecification,
- materialModel: this.form1.materialModel,
- materialTypeId: this.materialTypeId,
- unitOfMeasureId: this.form1.unitOfMeasureId,
- materialTheoreticalWeight: this.form1.materialTheoreticalWeight
- };
- if (RmsMaterial.materialName == 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.$router.go(-1);
- } else if (res.data.code == "201") {
- this.$message.warning("该物资已存在");
- } else {
- this.$message.error("新增失败");
- }
-
- });
- },
-
- 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: 2rem;
- margin-bottom: 1.25rem;
- margin-right: 10px;
- }
- .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 {
- display: flex;
- justify-content: center;
- align-items: center;
- margin-top: 20px;
- .el-input {
- width: 250px;
- }
- }
- .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;
- align-items: 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>
|