zhy
2023-10-30 35738d1b2c095b2eca0211efdc4fa59507189e6f
admin-web/src/views/foundation/material/edit.vue
@@ -2,27 +2,29 @@
  <win-md :title="setting.title" @close="close" :width="'800px'">
    <el-form ref="ruleForm" :model="formData" :rules="rules" class="demo-ruleForm" label-width="100px">
      <el-form-item label="物品编号">
        <el-input v-model="formData.code88" disabled clearable maxlength="20" show-word-limit style="width: 100%"/>
        <el-input v-model="formData.goodsCode" disabled clearable maxlength="20" show-word-limit style="width: 100%"/>
      </el-form-item>
      <el-form-item label="物品名称" prop="name">
        <el-input v-model="formData.name" clearable maxlength="20" show-word-limit style="width: 100%"/>
      <el-form-item label="物品名称" prop="goodsName">
        <el-input v-model="formData.goodsName" clearable maxlength="20" show-word-limit style="width: 100%"/>
      </el-form-item>
      <el-form-item style="margin-left: -100px;" v-for="(m, i) in formData.code">
        <el-form-item label="规格型号" prop="name" style="float: left;">
          <el-input v-model="m.name" clearable maxlength="20" show-word-limit style="width: 100%"/>
      <el-form-item label="分类" prop="categoryId">
        <el-input v-model="formData.categoryId" clearable maxlength="20" show-word-limit style="width: 100%"/>
      </el-form-item>
      <el-form-item style="margin-left: -100px;" v-for="(m, i) in formData.models">
        <el-form-item label="规格型号" prop="modelName" style="float: left;">
          <el-input v-model="m.modelName" clearable maxlength="20" show-word-limit style="width: 100%"/>
        </el-form-item>
        <el-form-item label="单位" prop="name" style="float: left;">
          <el-input v-model="m.code" clearable maxlength="20" show-word-limit style="width: 100%"/>
        <el-form-item label="单位" prop="unit" style="float: left;">
          <el-input v-model="m.unit" clearable maxlength="20" show-word-limit style="width: 100%"/>
        </el-form-item>
        <my-button name="新增型号" type="" @click="addCode"/>
        <my-button name="删除" type="" @click="delCode(i)"/>
      </el-form-item>
      <el-form-item label="状态">
        <el-switch
          v-model="formData.status"
          active-color="#0d997c"
          inactive-color="#C0CCDA">
        </el-switch>
      <el-form-item label="状态" prop="states">
        <el-radio-group v-model="formData.states">
          <el-radio :label="1" border>启用</el-radio>
          <el-radio :label="0" border>禁用</el-radio>
        </el-radio-group>
      </el-form-item>
    </el-form>
    <div slot="footer" align="center" class="dialog-footer">
@@ -54,13 +56,14 @@
        radio1: '',
        code: '',
        name: '',
        status: true,
        states: '',
        summary: '',
        code:[
        categoryId: null,
        models:[
          {
            name:'12',
            code:'13'
          },
            modelName:'',
            unit:''
          }
        ]
      },
      rules: {
@@ -77,15 +80,15 @@
  },
  methods: {
    addCode(){
      this.formData.code.push(
      this.formData.models.push(
        {
          name:'',
          code:''
          modelName:'',
          unit:''
        }
      )
    },
    delCode(index){
      this.formData.code.splice(index, 1)
      this.formData.models.splice(index, 1)
    },
    getEditInfo(id){
@@ -99,7 +102,7 @@
          const params = Object.assign({}, this.formData)
          if(this.setting.id){
            // 编辑接口
            finsystenant.edit(params).then(res => {
            finsystenant.editcode(params).then(res => {
              if (res) {
                this.$message.success('保存成功!')
                this.close()
@@ -110,7 +113,7 @@
            })
          }else{
            params.orgId = this.setting.orgId
            finsystenant.add(params).then(res => {
            finsystenant.addcode(params).then(res => {
              if (res) {
                this.$message.success('保存成功!')
                this.close()