机械化标准配置,新增配置时,无法输入,只能点选;添加完要么弹窗不关闭,要么增加数量录入
This commit is contained in:
		
							parent
							
								
									a3a3958137
								
							
						
					
					
						commit
						bb693e384a
					
				| 
						 | 
				
			
			@ -201,13 +201,34 @@
 | 
			
		|||
            :props="{ value: 'typeId', label: 'typeName' }"
 | 
			
		||||
            @change="changeType"
 | 
			
		||||
            style="width: 100%"
 | 
			
		||||
            clearable
 | 
			
		||||
            filterable
 | 
			
		||||
          ></el-cascader>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
        <el-form-item label="规格型号" prop="typeModel">
 | 
			
		||||
          <el-select v-model="form.typeModel" multiple placeholder="请选择规格型号" clearable style="width: 100%">
 | 
			
		||||
          <el-select
 | 
			
		||||
            v-model="form.typeModel"
 | 
			
		||||
            multiple
 | 
			
		||||
            placeholder="请选择规格型号"
 | 
			
		||||
            clearable
 | 
			
		||||
            style="width: 100%"
 | 
			
		||||
            filterable
 | 
			
		||||
          >
 | 
			
		||||
            <el-option v-for="item in typeModelOptions" :key="item.typeId" :label="item.name" :value="item.typeId" />
 | 
			
		||||
          </el-select>
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
 | 
			
		||||
        <el-form-item label="数量" prop="num">
 | 
			
		||||
          <el-input-number
 | 
			
		||||
            v-model="form.num"
 | 
			
		||||
            placeholder="请输入数量"
 | 
			
		||||
            style="width: 100%"
 | 
			
		||||
            :precision="0"
 | 
			
		||||
            :step="10"
 | 
			
		||||
            :min="0"
 | 
			
		||||
            :max="9999"
 | 
			
		||||
          />
 | 
			
		||||
        </el-form-item>
 | 
			
		||||
      </el-form>
 | 
			
		||||
      <div slot="footer" class="dialog-footer">
 | 
			
		||||
        <template>
 | 
			
		||||
| 
						 | 
				
			
			@ -303,7 +324,8 @@ export default {
 | 
			
		|||
      form: {
 | 
			
		||||
        configId: '', // 配置名称id
 | 
			
		||||
        typeIds: [], // 物资名称
 | 
			
		||||
        typeModel: [] // 规格型号
 | 
			
		||||
        typeModel: [], // 规格型号
 | 
			
		||||
        num: 0 // 数量
 | 
			
		||||
      },
 | 
			
		||||
      formRules: {
 | 
			
		||||
        configId: [{ required: true, message: '请选择配置名称', trigger: 'change' }],
 | 
			
		||||
| 
						 | 
				
			
			@ -419,6 +441,7 @@ export default {
 | 
			
		|||
      this.form.configId = this.form.configId || ''
 | 
			
		||||
      this.form.typeIds = []
 | 
			
		||||
      this.form.typeModel = []
 | 
			
		||||
      this.form.num = 0
 | 
			
		||||
      this.getConfigOpt()
 | 
			
		||||
      this.getTypeOptions()
 | 
			
		||||
      this.$nextTick(() => {
 | 
			
		||||
| 
						 | 
				
			
			@ -474,7 +497,8 @@ export default {
 | 
			
		|||
          try {
 | 
			
		||||
            const params = {
 | 
			
		||||
              configId: this.form.configId,
 | 
			
		||||
              typeIds: this.form.typeModel
 | 
			
		||||
              typeIds: this.form.typeModel,
 | 
			
		||||
              num: this.form.num
 | 
			
		||||
            }
 | 
			
		||||
            console.log('🚀 ~ 提交 params:', params)
 | 
			
		||||
            addConfigDetails(params)
 | 
			
		||||
| 
						 | 
				
			
			@ -520,17 +544,17 @@ export default {
 | 
			
		|||
    },
 | 
			
		||||
    /** 导出按钮作 */
 | 
			
		||||
    handleExport() {
 | 
			
		||||
      const formatTime = (date) => {
 | 
			
		||||
        const year = date.getFullYear();
 | 
			
		||||
        const month = String(date.getMonth() + 1).padStart(2, '0');
 | 
			
		||||
        const day = String(date.getDate()).padStart(2, '0');
 | 
			
		||||
        const hours = String(date.getHours()).padStart(2, '0');
 | 
			
		||||
        const minutes = String(date.getMinutes()).padStart(2, '0');
 | 
			
		||||
        const seconds = String(date.getSeconds()).padStart(2, '0');
 | 
			
		||||
        return `${year}${month}${day}_${hours}${minutes}${seconds}`;
 | 
			
		||||
      };
 | 
			
		||||
      const formatTime = date => {
 | 
			
		||||
        const year = date.getFullYear()
 | 
			
		||||
        const month = String(date.getMonth() + 1).padStart(2, '0')
 | 
			
		||||
        const day = String(date.getDate()).padStart(2, '0')
 | 
			
		||||
        const hours = String(date.getHours()).padStart(2, '0')
 | 
			
		||||
        const minutes = String(date.getMinutes()).padStart(2, '0')
 | 
			
		||||
        const seconds = String(date.getSeconds()).padStart(2, '0')
 | 
			
		||||
        return `${year}${month}${day}_${hours}${minutes}${seconds}`
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      const currentTime = formatTime(new Date());
 | 
			
		||||
      const currentTime = formatTime(new Date())
 | 
			
		||||
      let queryTemp = this.queryParams
 | 
			
		||||
      this.download(
 | 
			
		||||
        '/material/standardConfig/export',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue