|  | @@ -13,13 +13,13 @@
 | 
	
		
			
				|  |  |              <a-form-model layout="inline" :model="form" :rules="rules"  ref="form">
 | 
	
		
			
				|  |  |                <a-row :gutter="24">
 | 
	
		
			
				|  |  |                  <a-col :md="8" :sm="24">
 | 
	
		
			
				|  |  | -                  <a-form-model-item label="料品编码"  prop='inventoryCode' :labelCol="{offset: 1}">
 | 
	
		
			
				|  |  | -                    <a-input-search placeholder="请输入" v-model="form.inventoryCode" @search="onSearchInvebtory" readOnly></a-input-search>
 | 
	
		
			
				|  |  | +                  <a-form-model-item label="组织"  prop='pkOrg' :labelCol="{offset: 2}">
 | 
	
		
			
				|  |  | +                    <a-input-search placeholder="请输入" v-model="form.pkOrg" @search="onSearchPlanOrg" readOnly></a-input-search>
 | 
	
		
			
				|  |  |                    </a-form-model-item>
 | 
	
		
			
				|  |  |                  </a-col>
 | 
	
		
			
				|  |  | -                <a-col  :md="8" :sm="24">
 | 
	
		
			
				|  |  | -                  <a-form-model-item label="料品名称" name='inventoryName' >
 | 
	
		
			
				|  |  | -                    <a-input placeholder="请输入" v-model="form.inventoryName" disabled ></a-input>
 | 
	
		
			
				|  |  | +                <a-col :md="8" :sm="24">
 | 
	
		
			
				|  |  | +                  <a-form-model-item label="组织编码"  prop='orgCode' >
 | 
	
		
			
				|  |  | +                    <a-input placeholder="请输入" v-model="form.orgCode" disabled></a-input>
 | 
	
		
			
				|  |  |                    </a-form-model-item>
 | 
	
		
			
				|  |  |                  </a-col>
 | 
	
		
			
				|  |  |                  <a-col :md="8" :sm="24">
 | 
	
	
		
			
				|  | @@ -27,20 +27,31 @@
 | 
	
		
			
				|  |  |                        <a-input placeholder="请输入" v-model="form.model" disabled></a-input>
 | 
	
		
			
				|  |  |                      </a-form-model-item>
 | 
	
		
			
				|  |  |                    </a-col>
 | 
	
		
			
				|  |  | -                  <a-col :md="8" :sm="24">
 | 
	
		
			
				|  |  | -                    <a-form-model-item label="安全库存" name='safetyStock' :labelCol="{offset: 2}">
 | 
	
		
			
				|  |  | -                      <a-input-number  :default-value="0"  v-model="form.safetyStock"/>
 | 
	
		
			
				|  |  | +                <a-col :md="8" :sm="24">
 | 
	
		
			
				|  |  | +                  <a-form-model-item label="料品编码"  prop='inventoryCode' >
 | 
	
		
			
				|  |  | +                    <a-input-search placeholder="请输入" v-model="form.inventoryCode" @search="onSearchInvebtory" readOnly></a-input-search>
 | 
	
		
			
				|  |  | +                  </a-form-model-item>
 | 
	
		
			
				|  |  | +                </a-col>
 | 
	
		
			
				|  |  | +                <a-col  :md="8" :sm="24">
 | 
	
		
			
				|  |  | +                  <a-form-model-item label="料品名称" name='inventoryName' >
 | 
	
		
			
				|  |  | +                    <a-input placeholder="请输入" v-model="form.inventoryName" disabled ></a-input>
 | 
	
		
			
				|  |  | +                  </a-form-model-item>
 | 
	
		
			
				|  |  | +                </a-col>
 | 
	
		
			
				|  |  | +                <a-col :md="8" :sm="24">
 | 
	
		
			
				|  |  | +                    <a-form-model-item label="规格" name='model' :labelCol="{offset: 1}">
 | 
	
		
			
				|  |  | +                      <a-input placeholder="请输入" v-model="form.specs" disabled></a-input>
 | 
	
		
			
				|  |  |                      </a-form-model-item>
 | 
	
		
			
				|  |  |                    </a-col>
 | 
	
		
			
				|  |  |                    
 | 
	
		
			
				|  |  | +                  
 | 
	
		
			
				|  |  |                    <a-col :md="8" :sm="24" >
 | 
	
		
			
				|  |  | -                    <a-form-model-item label="料品属性" name='fixedLength' >
 | 
	
		
			
				|  |  | -                        <a-input placeholder="请输入" v-model="form.attribute" disabled/>
 | 
	
		
			
				|  |  | +                    <a-form-model-item label="料品属性" name='fixedLength' :labelCol="{offset: 1}">
 | 
	
		
			
				|  |  | +                        <a-input placeholder="请输入" v-model="form.attribute" disabled />
 | 
	
		
			
				|  |  |                      </a-form-model-item>
 | 
	
		
			
				|  |  |                    </a-col>
 | 
	
		
			
				|  |  |                    <a-col :md="8" :sm="24">
 | 
	
		
			
				|  |  | -                    <a-form-model-item label="规格" name='model' :labelCol="{offset: 1}">
 | 
	
		
			
				|  |  | -                      <a-input placeholder="请输入" v-model="form.specs" disabled></a-input>
 | 
	
		
			
				|  |  | +                    <a-form-model-item label="安全库存" name='safetyStock' >
 | 
	
		
			
				|  |  | +                      <a-input-number  :default-value="0"  v-model="form.safetyStock"/>
 | 
	
		
			
				|  |  |                      </a-form-model-item>
 | 
	
		
			
				|  |  |                    </a-col>
 | 
	
		
			
				|  |  |                </a-row>
 | 
	
	
		
			
				|  | @@ -48,6 +59,7 @@
 | 
	
		
			
				|  |  |          </div>
 | 
	
		
			
				|  |  |       </a-card>
 | 
	
		
			
				|  |  |       <inventoryPopup ref="inventoryPopup" @okData="okData"></inventoryPopup>
 | 
	
		
			
				|  |  | +     <organizationPopup ref="organizationPopup" @okData="okDataOrganization"></organizationPopup>
 | 
	
		
			
				|  |  |      </a-modal>
 | 
	
		
			
				|  |  |    </template>
 | 
	
		
			
				|  |  |    <script>
 | 
	
	
		
			
				|  | @@ -57,11 +69,13 @@
 | 
	
		
			
				|  |  |        import moment from "moment"
 | 
	
		
			
				|  |  |        import { httpAction ,getAction,postAction,putAction} from '@/api/manage'
 | 
	
		
			
				|  |  |        import inventoryPopup from '../../Popup/inventoryPopup.vue'
 | 
	
		
			
				|  |  | +      import organizationPopup from '../../Popup/organizationPopup.vue'
 | 
	
		
			
				|  |  |        export default {
 | 
	
		
			
				|  |  |          name: 'safetyStockListAdd',
 | 
	
		
			
				|  |  |          mixins: [JEditableTableModelMixin],
 | 
	
		
			
				|  |  |          components: {
 | 
	
		
			
				|  |  | -          inventoryPopup
 | 
	
		
			
				|  |  | +          inventoryPopup,
 | 
	
		
			
				|  |  | +          organizationPopup
 | 
	
		
			
				|  |  |          },
 | 
	
		
			
				|  |  |          data() {
 | 
	
		
			
				|  |  |            return {
 | 
	
	
		
			
				|  | @@ -73,6 +87,9 @@
 | 
	
		
			
				|  |  |                inventoryCode: [
 | 
	
		
			
				|  |  |                  { required: true, trigger: 'blur' },
 | 
	
		
			
				|  |  |                ],
 | 
	
		
			
				|  |  | +              pkOrg:[
 | 
	
		
			
				|  |  | +                { required: true, trigger: 'blur' },
 | 
	
		
			
				|  |  | +              ],
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |            }
 | 
	
		
			
				|  |  |          },
 | 
	
	
		
			
				|  | @@ -129,18 +146,35 @@
 | 
	
		
			
				|  |  |              onSelectChange(selectedRowKeys, selectionRows) {
 | 
	
		
			
				|  |  |                  this.selectedRowKeys = selectedRowKeys;
 | 
	
		
			
				|  |  |              },
 | 
	
		
			
				|  |  | +            onSearchPlanOrg(){
 | 
	
		
			
				|  |  | +                this.$refs.organizationPopup.visible = true
 | 
	
		
			
				|  |  | +                this.$refs.organizationPopup.getData()
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  | +            okDataOrganization(data){
 | 
	
		
			
				|  |  | +                this.$set(this.form,'pkOrg',data.Name)
 | 
	
		
			
				|  |  | +                this.$set(this.form,'Org',data.ID)
 | 
	
		
			
				|  |  | +                this.$set(this.form,'orgCode',data.Code)
 | 
	
		
			
				|  |  | +                this.$refs.form.clearValidate()
 | 
	
		
			
				|  |  | +                console.log(this.form);
 | 
	
		
			
				|  |  | +            },
 | 
	
		
			
				|  |  |              okData(data){
 | 
	
		
			
				|  |  |                this.$set(this.form,'inventoryCode',data.Code)
 | 
	
		
			
				|  |  |                this.$set(this.form,'inventoryName',data.Name)
 | 
	
		
			
				|  |  |                this.$set(this.form,'specs',data.SPECS)
 | 
	
		
			
				|  |  |                this.$set(this.form,'inventory',data.ID )
 | 
	
		
			
				|  |  |                this.$set(this.form,'attribute',data.Code1 )
 | 
	
		
			
				|  |  | +              this.$refs.form.clearValidate()
 | 
	
		
			
				|  |  |              },
 | 
	
		
			
				|  |  |              onSearch(){
 | 
	
		
			
				|  |  |              },
 | 
	
		
			
				|  |  |              onSearchInvebtory(){
 | 
	
		
			
				|  |  | -              this.$refs.inventoryPopup.visible = true
 | 
	
		
			
				|  |  | -              this.$refs.inventoryPopup.getData()
 | 
	
		
			
				|  |  | +              if(this.form.pkOrg&&this.form.pkOrg!==''){
 | 
	
		
			
				|  |  | +                this.$refs.inventoryPopup.visible = true
 | 
	
		
			
				|  |  | +                this.$refs.inventoryPopup.getData()
 | 
	
		
			
				|  |  | +              }else{
 | 
	
		
			
				|  |  | +                this.$message.warning('请选择组织!')
 | 
	
		
			
				|  |  | +              }
 | 
	
		
			
				|  |  | +              
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          }
 |