You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

239 lines
9.8 KiB

<template>
<j-modal
:title="title"
:width="width"
:visible="visible"
:confirmLoading="confirmLoading"
switchFullscreen
@ok="handleOk"
@cancel="handleCancel"
cancelText="关闭">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="24">
<a-form-item label="物料组" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-search-select-tag v-decorator="['materialGroup']" dict="" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="物料号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-search-select-tag v-decorator="['materialNumber']" dict="" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="物料描述" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['materialDescription']" placeholder="请输入物料描述" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="仓储地点_id" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-search-select-tag v-decorator="['unitWasteWarehouseCodeId']" dict="" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="生产时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-date placeholder="请选择生产时间" v-decorator="['productionTime']" :trigger-change="true" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="保质期" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-date placeholder="请选择保质期" v-decorator="['expirationDate']" :trigger-change="true" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="是否到货" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag type="list" v-decorator="['arrivalNotice']" :trigger-change="true" dictCode="" placeholder="请选择是否到货" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="入库时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-date placeholder="请选择入库时间" v-decorator="['storageTime']" :trigger-change="true" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="入库人" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-search-select-tag v-decorator="['librarySign']" dict="" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="核算属性" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-search-select-tag v-decorator="['accountingAttributes']" dict="" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="器材编号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-search-select-tag v-decorator="['equipment']" dict="" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="WBS" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-search-select-tag v-decorator="['wbs']" dict="" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="物料名称及规格型号" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-search-select-tag v-decorator="['materialName']" dict="" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag type="list" v-decorator="['materialUnit']" :trigger-change="true" dictCode="" placeholder="请选择单位" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="单价" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number v-decorator="['materialPrice']" placeholder="请输入单价" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number v-decorator="['materialAmount']" placeholder="请输入金额" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['supplier']" placeholder="请输入供应商" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="批次" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['supplierBatch']" placeholder="请输入批次" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="批次入库时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-date placeholder="请选择批次入库时间" v-decorator="['warehousingTime']" :trigger-change="true" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="用途" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input v-decorator="['purpose']" placeholder="请输入用途" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="删除标志" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number v-decorator="['delFlag']" placeholder="请输入删除标志" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="删除时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-date placeholder="请选择删除时间" v-decorator="['delTime']" :trigger-change="true" style="width: 100%" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</j-modal>
</template>
<script>
import { httpAction } from '@/api/manage'
import pick from 'lodash.pick'
import { validateDuplicateValue } from '@/utils/util'
import JDate from '@/components/jeecg/JDate'
import JDictSelectTag from "@/components/dict/JDictSelectTag"
import JSearchSelectTag from '@/components/dict/JSearchSelectTag'
export default {
name: "ProcessMaterialWarehousingListModal",
components: {
JDate,
JDictSelectTag,
JSearchSelectTag,
},
props:{
mainId:{
type:Array,
required:false,
}
},
data () {
return {
form: this.$form.createForm(this),
title:"操作",
width:800,
visible: false,
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
},
url: {
add: "/hy/processMaterialWarehousing/addProcessMaterialWarehousingList",
edit: "/hy/processMaterialWarehousing/editProcessMaterialWarehousingList",
}
}
},
created () {
},
methods: {
add () {
this.edit({});
},
edit (record) {
this.form.resetFields();
this.model = Object.assign({}, record);
this.visible = true;
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.model,'materialGroup','materialNumber','materialDescription','unitWasteWarehouseCodeId','productionTime','expirationDate','arrivalNotice','storageTime','librarySign','accountingAttributes','equipment','wbs','materialName','materialUnit','materialPrice','materialAmount','supplier','supplierBatch','warehousingTime','purpose','processMaterialWarehousingId','commodityId','commodityDetailsId','warehouseId','supplierId','delFlag','delTime'))
})
},
close () {
this.$emit('close');
this.visible = false;
},
handleOk () {
const that = this;
// 触发表单验证
this.form.validateFields((err, values) => {
if (!err) {
that.confirmLoading = true;
let httpurl = '';
let method = '';
if(!this.model.id){
httpurl+=this.url.add;
method = 'post';
}else{
httpurl+=this.url.edit;
method = 'put';
}
let formData = Object.assign(this.model, values);
formData['processMaterialWarehousingId'] = this.mainId
console.log("表单提交数据",formData)
httpAction(httpurl,formData,method).then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
}
})
},
handleCancel () {
this.close()
},
popupCallback(row){
this.form.setFieldsValue(pick(row,'materialGroup','materialNumber','materialDescription','unitWasteWarehouseCodeId','productionTime','expirationDate','arrivalNotice','storageTime','librarySign','accountingAttributes','equipment','wbs','materialName','materialUnit','materialPrice','materialAmount','supplier','supplierBatch','warehousingTime','purpose','processMaterialWarehousingId','commodityId','commodityDetailsId','warehouseId','supplierId','delFlag','delTime'))
},
}
}
</script>