123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <template>
- <!-- 修改物资信息 -->
- <div id="contractDetails">
- <page-title>编辑</page-title>
- <div class="main">
- <span class="text">物资信息</span>
- </div>
- <div class="contractTitle">
- <div class="form-box">
- <div class="form-one">
- <dil-form :formId="314" v-model="form1"></dil-form>
- </div>
- </div>
- </div>
-
- <div class="button-box">
- <el-button type="primary" @click="onClickConfirm">确认</el-button>
- <el-button @click="onClickCancel">返回</el-button>
- </div>
- </div>
- </template>
- <script>
- import PageTitle from "@/components/Page/Title";
- //import { sjTime } from "@/js/sharedJsFile";
- export default {
- components: { PageTitle },
- data() {
- return {
- form1: {},
- };
- },
-
- mounted() {
- console.log(this.$route)
- this.information();
- },
- methods: {
- information() {
- //编辑
- this.axios
- .post(
- "/api/v1/rms/getMaterialById/" +
- this.$route.params.materialId
- )
- .then((res) => {
- console.log(res)
- res.data.data.forEach((e) => {
- this.form1 = e;
- console.log(e);
- console.log(this.form1);
- console.log(this.$route.params.materialId);
- });
- });
- },
- // 返回
- onClickCancel() {
- this.$router.go(-1);
- },
- // 确认
- onClickConfirm() {
- console.log(this.form1)
- let RmsMaterial = {
- materialId:this.form1.materialId,
- materialCode:this.form1.materialCode,
- materialName:this.form1.materialName,
- materialSpecification:this.form1.materialSpecification,
- materialModel:this.form1.materialModel,
- materialTypeId:this.form1.materialTypeId,
- unitOfMeasureId:this.form1.unitOfMeasureId,
- materialTheoreticalWeight:this.form1.materialTheoreticalWeight,
- };
- this.axios
- .post(
- "/api/v1/rms/updateMaterial",
- RmsMaterial
- )
- .then((res) => {
- if (res.data.code == "200") {
- this.$router.go(-1);
- }
- });
- },
- },
- // 取消
- cancel() {
- this.$router.go(-1);
- },
- };
- </script>
- <style lang='scss' scoped>
- </style>
|