8/22 工位调整 第三方单据调整
							parent
							
								
									b49c1e3c11
								
							
						
					
					
						commit
						91945f4e09
					
				| @ -0,0 +1,357 @@ | |||||||
|  | <template> | ||||||
|  |   <div> | ||||||
|  |     <el-form :model="formData" style="width: 100%;" ref="dataForm" :rules="formRules" | ||||||
|  |              label-width="auto" | ||||||
|  |     > | ||||||
|  |       <el-row :gutter="24" class="el-row"> | ||||||
|  |         <el-col :span="12" class="el-col"> | ||||||
|  |           <el-form-item label="工位名称:" prop="workplaceName" class="query-form-item"> | ||||||
|  |             <el-input | ||||||
|  |               disabled | ||||||
|  |               v-model="busData.workplaceName" style="width: 80%" | ||||||
|  |               auto-complete="off" | ||||||
|  |             ></el-input> | ||||||
|  |           </el-form-item> | ||||||
|  |         </el-col> | ||||||
|  |         <el-col :span="12" class="el-col"> | ||||||
|  |           <el-form-item label="业务名称:" prop="busName" class="query-form-item"> | ||||||
|  |             <el-input | ||||||
|  |               v-model="formData.busName" style="width: 80%" | ||||||
|  |               auto-complete="off" | ||||||
|  |             ></el-input> | ||||||
|  |           </el-form-item> | ||||||
|  |         </el-col> | ||||||
|  |       </el-row> | ||||||
|  |       <el-row :gutter="24" class="el-row"> | ||||||
|  |         <el-col :span="12" class="el-col"> | ||||||
|  |           <el-form-item label="是否配套系统:" prop="isMatching" class="query-form-item"> | ||||||
|  |             <el-select v-model="formData.isMatching" style="width: 80%" placeholder="选择扫码方式" clearable | ||||||
|  |                        @change="change" | ||||||
|  |             > | ||||||
|  |               <el-option label="否" :value="0"></el-option> | ||||||
|  |               <el-option label="是" :value="1"></el-option> | ||||||
|  |             </el-select> | ||||||
|  |           </el-form-item> | ||||||
|  |         </el-col> | ||||||
|  |         <el-col :span="12" class="el-col"> | ||||||
|  |           <el-form-item label="单据类型:" prop="documentTypeCode" class="query-form-item"> | ||||||
|  |             <el-select v-model="formData.documentTypeCode" placeholder="请选择单据类型" | ||||||
|  |                        style="width: 80%" | ||||||
|  |                        clearable | ||||||
|  |             > | ||||||
|  |               <el-option | ||||||
|  |                 v-for="item in busTypes" | ||||||
|  |                 :key="item.name" | ||||||
|  |                 :label="item.name" | ||||||
|  |                 :value="item.code" | ||||||
|  |               > | ||||||
|  |                 <span style="float: left">{{ item.name }}</span> | ||||||
|  |               </el-option> | ||||||
|  |             </el-select> | ||||||
|  |           </el-form-item> | ||||||
|  |         </el-col> | ||||||
|  |       </el-row> | ||||||
|  | 
 | ||||||
|  |       <el-row :gutter="24" class="el-row"> | ||||||
|  |         <el-col :span="12" class="el-col"> | ||||||
|  |           <el-form-item label="扫码方式:" prop="scanType" class="query-form-item"> | ||||||
|  |             <el-select v-model="formData.scanType" style="width: 80%" placeholder="选择扫码方式" clearable | ||||||
|  |                        @change="changeCheckInsert" | ||||||
|  |             > | ||||||
|  |               <el-option label="扫码生成业务单" :value="1"></el-option> | ||||||
|  |               <el-option label="按单校验三期" :value="2"></el-option> | ||||||
|  |               <el-option label="按单不校验三期" :value="3"></el-option> | ||||||
|  |             </el-select> | ||||||
|  |           </el-form-item> | ||||||
|  |         </el-col> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |         <el-col :span="12" class="el-col"> | ||||||
|  |           <el-form-item label="结果处理:" prop="checkInsert" class="query-form-item"> | ||||||
|  |             <el-select v-model="formData.checkInsert" style="width: 80%" placeholder="选择扫码方式" clearable | ||||||
|  |                        :disabled="formData.scanType == 1" | ||||||
|  |             > | ||||||
|  |               <el-option label="自动添加" :value="1"></el-option> | ||||||
|  |               <el-option label="自动不添加" :value="2"></el-option> | ||||||
|  |               <el-option label="根据提醒决定" :value="3"></el-option> | ||||||
|  |             </el-select> | ||||||
|  |           </el-form-item> | ||||||
|  |         </el-col> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |         <el-col :span="12" class="el-col"> | ||||||
|  |           <el-form-item label="异常提醒方式:" prop="warnType" class="query-form-item"> | ||||||
|  |             <el-select v-model="formData.warnType" style="width: 80%" placeholder="选择扫码方式" clearable> | ||||||
|  |               <el-option label="信息提醒" :value="1"></el-option> | ||||||
|  |               <el-option label="信息弹框提醒" :value="2"></el-option> | ||||||
|  |               <el-option label="不提醒" :value="3"></el-option> | ||||||
|  |             </el-select> | ||||||
|  |           </el-form-item> | ||||||
|  |         </el-col> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |         <el-col :span="12" class="el-col"> | ||||||
|  |           <el-form-item label="默认仓库:" prop="invCode" class="query-form-item"> | ||||||
|  |             <el-select v-model="formData.invCode" placeholder="请选择仓库" | ||||||
|  |                        style="width: 80%" | ||||||
|  |                        clearable | ||||||
|  |                        @change="handleInvChange" | ||||||
|  |             > | ||||||
|  |               <el-option | ||||||
|  |                 v-for="item in invList" | ||||||
|  |                 :key="item.name" | ||||||
|  |                 :label="item.name" | ||||||
|  |                 :value="item.code" | ||||||
|  |               > | ||||||
|  |                 <span style="float: left">{{ item.name }}</span> | ||||||
|  |               </el-option> | ||||||
|  |             </el-select> | ||||||
|  |           </el-form-item> | ||||||
|  |         </el-col> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |         <el-col :span="12" class="el-col"> | ||||||
|  |           <el-form-item label="往来单位类型:" prop="corpType" class="query-form-item"> | ||||||
|  |             <el-select v-model="formData.corpType" style="width: 80%" placeholder="选择往来单位类型" clearable> | ||||||
|  |               <el-option label="客户" :value="1"></el-option> | ||||||
|  |               <el-option label="供应商" :value="2"></el-option> | ||||||
|  |               <el-option label="内部科室" :value="3"></el-option> | ||||||
|  |               <el-option label="特殊往来" :value="4"></el-option> | ||||||
|  |             </el-select> | ||||||
|  |           </el-form-item> | ||||||
|  |         </el-col> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |         <el-col :span="12" class="el-col"> | ||||||
|  |           <el-form-item label="往来类型标题:" prop="unitTittle" class="query-form-item"> | ||||||
|  |             <el-input | ||||||
|  |               v-model="formData.unitTittle" style="width: 80%" | ||||||
|  |               auto-complete="off" | ||||||
|  |             ></el-input> | ||||||
|  |           </el-form-item> | ||||||
|  |         </el-col> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |       </el-row> | ||||||
|  | 
 | ||||||
|  |       <!--<el-col :span="12" class="el-col">--> | ||||||
|  |       <!--  <el-form-item label="往来单位类型:" prop="corpType" class="query-form-item">--> | ||||||
|  |       <!--    <el-select v-model="formData.corpType" style="width: 80%" placeholder="选择往来单位类型" clearable>--> | ||||||
|  |       <!--      <el-option label="客户" :value="1"></el-option>--> | ||||||
|  |       <!--      <el-option label="供应商" :value="2"></el-option>--> | ||||||
|  |       <!--      <el-option label="内部科室" :value="3"></el-option>--> | ||||||
|  |       <!--      <el-option label="特殊往来" :value="4"></el-option>--> | ||||||
|  |       <!--    </el-select>--> | ||||||
|  |       <!--  </el-form-item>--> | ||||||
|  |       <!--</el-col>--> | ||||||
|  |       <!--    <el-row :gutter="24" class="el-row"> | ||||||
|  |             <el-col :span="22" class="el-col"> | ||||||
|  |               <el-form-item label="备注:" prop="remake" class="query-form-item"> | ||||||
|  |                 <el-input | ||||||
|  |                   v-model="formData.remake" style="width: 100%" | ||||||
|  |                   auto-complete="off" | ||||||
|  |                 ></el-input> | ||||||
|  |               </el-form-item> | ||||||
|  |             </el-col> | ||||||
|  |           </el-row>--> | ||||||
|  | 
 | ||||||
|  |     </el-form> | ||||||
|  |     <div slot="footer" class="dialog-footer"> | ||||||
|  |       <el-button @click.native="hideForm">取消</el-button> | ||||||
|  |       <el-button | ||||||
|  |         type="primary" | ||||||
|  |         @click.native="formSubmit()" | ||||||
|  |       >提交 | ||||||
|  |       </el-button | ||||||
|  |       > | ||||||
|  |     </div> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script> | ||||||
|  | import { getInvListByUser } from '@/api/system/invWarehouse' | ||||||
|  | import { getCollectBusType } from '@/api/basic/collectPoint/gatherOrderType' | ||||||
|  | import { getBusTypeList } from '@/api/basic/busType' | ||||||
|  | import { addBusType, updateType } from '@/api/basic/workPlace/sysWorkplaceDocuments' | ||||||
|  | 
 | ||||||
|  | export default { | ||||||
|  |   props: { | ||||||
|  |     closeDialog: { | ||||||
|  |       type: Function, | ||||||
|  |       required: true | ||||||
|  |     }, | ||||||
|  |     workplaceId: { | ||||||
|  |       type: Object, | ||||||
|  |       required: true | ||||||
|  |     }, | ||||||
|  |     busData: { | ||||||
|  |       type: Object, | ||||||
|  |       required: true | ||||||
|  |     }, | ||||||
|  |     upData: { | ||||||
|  |       type: Object, | ||||||
|  |       required: true | ||||||
|  |     }, | ||||||
|  |     //判断类型 编辑 || 新增 | ||||||
|  |     busName: { | ||||||
|  |       type: Object, | ||||||
|  |       required: true | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   data() { | ||||||
|  |     return { | ||||||
|  |       formData: { | ||||||
|  |         scanType: 1, | ||||||
|  |         checkInsert: 1, | ||||||
|  |         isMatching: 1, | ||||||
|  |         documentTypeCode: null | ||||||
|  |       }, | ||||||
|  |       invList: [], | ||||||
|  |       busTypes: [], | ||||||
|  |       formRules: { | ||||||
|  |         busName: [ | ||||||
|  |           { required: true, message: '请输入业务名称', trigger: 'blur' } | ||||||
|  |         ], | ||||||
|  |         isMatching: [ | ||||||
|  |           { required: true, message: '请选择是否配套系统', trigger: 'blur' } | ||||||
|  |         ], | ||||||
|  |         documentTypeCode: [ | ||||||
|  |           { required: true, message: '请选择单据类型', trigger: 'blur' } | ||||||
|  |         ], | ||||||
|  |         scanType: [ | ||||||
|  |           { required: true, message: '请选择扫码方式', trigger: 'blur' } | ||||||
|  |         ], | ||||||
|  |         checkInsert: [ | ||||||
|  |           { required: true, message: '处理结果不能为空', trigger: 'blur' } | ||||||
|  |         ], | ||||||
|  |         warnType: [ | ||||||
|  |           { required: true, message: '请选择异常方式提醒', trigger: 'blur' } | ||||||
|  |         ], | ||||||
|  |         corpType: [ | ||||||
|  |           { required: true, message: '请选择往来单位类型', trigger: 'blur' } | ||||||
|  |         ], | ||||||
|  |         unitTittle: [ | ||||||
|  |           { required: true, message: '请输入往来类型标题', trigger: 'blur' } | ||||||
|  |         ], | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   methods: { | ||||||
|  |     getInvList() { | ||||||
|  |       let query = { | ||||||
|  |         advanceType: 1, | ||||||
|  |         deptCode: this.busData.deptCode | ||||||
|  |       } | ||||||
|  |       getInvListByUser(query) | ||||||
|  |         .then((response) => { | ||||||
|  |           this.invList = response.data || [] | ||||||
|  |         }) | ||||||
|  |         .catch(() => { | ||||||
|  |         }) | ||||||
|  |     }, | ||||||
|  |     getBusType() { | ||||||
|  |       let query = { | ||||||
|  |         page: 1, | ||||||
|  |         limit: 50 | ||||||
|  |       } | ||||||
|  |       getCollectBusType(query) | ||||||
|  |         .then((response) => { | ||||||
|  |           let busTypeList = response.data.list || [] | ||||||
|  |           let busTypes = busTypeList.map(busType => { | ||||||
|  |             return { | ||||||
|  |               code: busType.fromBusTypeCode, | ||||||
|  |               name: busType.name | ||||||
|  |             } | ||||||
|  |           }) | ||||||
|  |           this.busTypes = busTypes | ||||||
|  |         }) | ||||||
|  |         .catch(() => { | ||||||
|  |         }) | ||||||
|  |     }, | ||||||
|  |     change() { | ||||||
|  |       this.formData.documentTypeCode = null | ||||||
|  |       if (this.formData.isMatching == 0) { | ||||||
|  |         this.getBusType() | ||||||
|  |       } else { | ||||||
|  |         this.getBusTypeList() | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     getBusTypeList() { | ||||||
|  |       let query = { | ||||||
|  |         enable: 1, | ||||||
|  |         page: 1, | ||||||
|  |         limit: 50 | ||||||
|  |       } | ||||||
|  |       getBusTypeList(query).then(res => { | ||||||
|  |         if (res.code == 20000) { | ||||||
|  |           this.busTypes = res.data.list || [] | ||||||
|  |           let busTypeList = res.data.list || [] | ||||||
|  |           // _this.options.getWorkPlace = res.data.list || []; | ||||||
|  |           let busTypes = busTypeList.map(busType => { | ||||||
|  |             return { | ||||||
|  |               code: busType.action, | ||||||
|  |               name: busType.name | ||||||
|  |             } | ||||||
|  |           }) | ||||||
|  |           this.busTypes = busTypes | ||||||
|  |         } else { | ||||||
|  |           this.$message.error('获取错误') | ||||||
|  |         } | ||||||
|  |       }) | ||||||
|  |     }, | ||||||
|  |     formSubmit() { | ||||||
|  |       this.formData.workplaceCode = this.workplaceId | ||||||
|  |       if (this.upData != null) { | ||||||
|  |         updateType(this.formData).then(res => { | ||||||
|  |           if (res.code == 20000) { | ||||||
|  |             this.closeDialog() | ||||||
|  |             this.$message.success('更新成成') | ||||||
|  |           } else { | ||||||
|  |             this.$message.error('更新失败') | ||||||
|  |           } | ||||||
|  |         }) | ||||||
|  |       } else { | ||||||
|  |         this.$refs['dataForm'].validate((valid) => { | ||||||
|  |           if (valid){ | ||||||
|  |             addBusType(this.formData).then(res => { | ||||||
|  |               if (res.code == 20000) { | ||||||
|  |                 this.$message.success('新增成功') | ||||||
|  |                 this.closeDialog() | ||||||
|  |               } else { | ||||||
|  |                 this.$message.error('新增失败') | ||||||
|  |               } | ||||||
|  |             }) | ||||||
|  |           }else { | ||||||
|  | 
 | ||||||
|  |           } | ||||||
|  |         }) | ||||||
|  |         // this.formData | ||||||
|  | 
 | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |     }, | ||||||
|  |     hideForm() { | ||||||
|  |       this.closeDialog() | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   created() { | ||||||
|  |     if (this.upData != null) { | ||||||
|  |       this.formData = this.upData | ||||||
|  |       this.formData.invCode = this.upData.invCode + '' | ||||||
|  |       if (this.formData.isMatching == 0) { | ||||||
|  |         this.getBusType() | ||||||
|  |       } else { | ||||||
|  |         this.getBusTypeList() | ||||||
|  |       } | ||||||
|  |     } else { | ||||||
|  |       this.getBusTypeList() | ||||||
|  |     } | ||||||
|  |     this.getInvList() | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  | } | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <style scoped> | ||||||
|  | 
 | ||||||
|  | </style> | ||||||
					Loading…
					
					
				
		Reference in New Issue