| | |
| | | <div style=" margin-bottom: 10px; border-bottom: 1px solid #f6f6f6;"> |
| | | <el-button type="primary" @click="handleAdd(OperationType = 1)" v-if="addBtnShow">新增</el-button> |
| | | <el-button type="primary" @click="submitForm" :disabled="subDisabled">保 存</el-button> |
| | | <el-button type="primary" @click="set_CheckBill(1, form)">审 核</el-button> |
| | | <!-- <el-button type="primary" @click="set_CheckBill(1, form)">审 核</el-button> --> |
| | | <el-button type="primary" @click="close">退 出</el-button> |
| | | <!-- <el-button @click="cancel">取 消</el-button> --> |
| | | </div> |
| | |
| | | <el-row> |
| | | <el-col :span="6"> |
| | | <el-form-item v-show="HIsShow" label="单据号" prop="HBillNo"> |
| | | <el-input v-model="form.HBillNo" placeholder="请输入单据号" /> |
| | | <el-input v-model="form.HBillNo" placeholder="请输入单据号" disabled/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item v-show="HIsShow" label="日期" prop="HDate"> |
| | | <el-date-picker v-model="form.HDate" type="date" placeholder="选择日期" format="yyyy-MM-dd"> |
| | | <el-date-picker v-model="form.HDate" type="date" placeholder="选择日期" format="yyyy-MM-dd HH:mm:ss"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-col :span="6"> |
| | | <el-form-item v-show="HIsShow" label="内部单据号" prop="HInnerBillNo"> |
| | | <el-input v-model="form.HInnerBillNo" placeholder="请输入" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item v-show="HIsShow" label="子单据类型" prop="HBillSubType"> |
| | | <el-select v-model="form.HBillSubType" placeholder="请选择子单据类型"> |
| | | <el-option label="采购入库" value="采购入库"></el-option> |
| | | <el-option label="生产入库" value="生产入库"></el-option> |
| | | <el-option label="客返" value="客返"></el-option> |
| | | <el-option label="供应商返还" value="供应商返还"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-button type="success" plain icon="el-icon-arrow-down" @click="handleMoveRowDown(zbSelForm)" |
| | | size="mini">下移</el-button> |
| | | <el-button type="success" plain icon="el-icon-printer" @click="get_ICInventoryMould(zbSelForm)">容器库存</el-button> |
| | | <el-button type="success" plain icon="el-icon-printer" @click="get_ContainerInstantStock(zbSelForm)">容器即时库存</el-button> |
| | | </div> |
| | | <el-table :data="editData" style="width: 100%" height="300" width="100%" ref="zbTable" |
| | | @selection-change="handleTableZbEdit" :row-class-name="rowSysZbIndex" show-summary border> |
| | |
| | | <span>{{ scope.row.HUnitName }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="库存数量" width="120"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.KuHQty || 0 }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" label="应收数量" width="120"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ scope.row.HQtyMust }}</span> |
| | |
| | | HModName: "Sc_MouldProdBackBillEdit", |
| | | formShow: false, |
| | | temp: undefined, |
| | | HBillSubType: '', |
| | | formLoading: true, |
| | | zzSelDis: false, |
| | | rowHideShow: false, |
| | |
| | | ], |
| | | HStockOrgID: [ |
| | | { required: true, message: "组织不能为空", trigger: "blur" } |
| | | ], |
| | | HBillSubType: [ |
| | | { required: true, message: "子单据类型不能为空", trigger: "blur" } |
| | | ], |
| | | HSecManagerName: [ |
| | | { required: true, message: "验收员不能为空", trigger: "blur" } |
| | |
| | | this.form.HDeptID = data.HDeptID |
| | | this.form.HDeptName = data.HDeptName |
| | | this.form.HStockOrgID = data.HStockOrgID == null ? 0 : data.HStockOrgID |
| | | this.form.HBillSubType = data.HBillSubType |
| | | this.ifOrganizationEdit = true |
| | | console.log(dataArray) |
| | | //子表 赋值 |
| | |
| | | HInterID: 0, |
| | | HDate: new Date(), |
| | | HStockOrgID:sessionStorage["OrganizationID"] - 0, |
| | | HBillSubType:'', |
| | | HSupTypeID: 1, |
| | | HSupName:'', |
| | | HSupID:0, |
| | |
| | | //新增获取单据号 |
| | | this.getHBillNo() |
| | | let date = new Date() |
| | | this.form.HDate = moment(date).format('YYYY-MM-DD') |
| | | this.form.HDate = moment(date).format('YYYY-MM-DD HH:mm:ss') |
| | | if (this.OperationType == 1) { |
| | | this.handleAddSysZb() |
| | | } |
| | |
| | | this.formLoading = false |
| | | }) |
| | | }, |
| | | |
| | | //#region 查看容器即时库存 |
| | | async get_ContainerInstantStock(zbSelForm) { |
| | | if (!this.zbIndex) { |
| | | this.$modal.msgError("请选择一行数据"); |
| | | return; |
| | | } |
| | | |
| | | var index = zbSelForm.index - 1; |
| | | const rowData = this.editData[index]; |
| | | |
| | | if (rowData.HMaterID==0) { |
| | | this.$modal.msgError("请先选择容器"); |
| | | return; |
| | | } |
| | | |
| | | const whId = rowData.HWHID || this.form.HWHID; |
| | | if (!whId || whId == 0) { |
| | | this.$modal.msgError("请先选择有效的仓库"); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | this.$modal.loading("正在查询库存..."); |
| | | |
| | | // 获取仓库名称 |
| | | const whResponse = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", { |
| | | params: { |
| | | "sql": `select HName from Gy_Warehouse where HItemID = ${whId}`, |
| | | "user": sessionStorage["HUserName"], |
| | | "ModRightNameCheck": "" |
| | | } |
| | | }); |
| | | |
| | | const whName = whResponse.data.data[0]?.HName; |
| | | if (!whName) { |
| | | this.$modal.closeLoading(); |
| | | this.$modal.msgError("未找到仓库信息"); |
| | | return; |
| | | } |
| | | |
| | | // 获取所有库存数据 |
| | | var sql = "exec h_p_Kf_ICInventory_Mould ''"; |
| | | const response = await axios.get(this.$baseUrl + "/CommonModel/searchMethod", { |
| | | params: { |
| | | "sql": sql, |
| | | "user": sessionStorage["HUserName"], |
| | | "ModRightNameCheck": "" |
| | | } |
| | | }); |
| | | |
| | | let totalQty = 0; |
| | | |
| | | if (response.data.count == 1 && response.data.data) { |
| | | // 基础过滤:容器ID + 仓库名称 |
| | | let filteredData = response.data.data.filter(item => |
| | | item['HMaterID'] == rowData.HMaterID && item['仓库'] === whName |
| | | ); |
| | | |
| | | // 如果有库位,按库位过滤 |
| | | if (rowData.HSPName) { |
| | | filteredData = filteredData.filter(item => item['仓位'] === rowData.HSPName); |
| | | } |
| | | |
| | | // 计算总库存 |
| | | filteredData.forEach(item => { |
| | | totalQty += Number(item['库存数量'] || 0); |
| | | }); |
| | | } |
| | | |
| | | // 更新当前行的库存数量 |
| | | this.$set(this.editData, index, { |
| | | ...rowData, |
| | | KuHQty: totalQty |
| | | }); |
| | | |
| | | this.$modal.closeLoading(); |
| | | this.$modal.msgSuccess(`库存查询成功,当前库存:${totalQty}`); |
| | | |
| | | } catch (error) { |
| | | this.$modal.closeLoading(); |
| | | this.$modal.msgError("查询库存失败"); |
| | | } |
| | | }, |
| | | //#endregion |
| | | getHBillNo() { |
| | | axios.get(this.$baseUrl + "/WEBSController/GetMaxBillNo_Json", { |
| | | params: { |
| | |
| | | //新增获取单据号 |
| | | this.getHBillNo() |
| | | let date = new Date() |
| | | this.form.HDate = moment(date).format('YYYY-MM-DD') |
| | | this.form.HDate = moment(date).format('YYYY-MM-DD HH:mm:ss') |
| | | |
| | | //设置源单类型 |
| | | this.form.HSourceBillType = this.HSouceBillType |
| | |
| | | if (this.copyType == 1) { |
| | | this.getHBillNo() |
| | | let date = new Date() |
| | | this.form.HDate = moment(date).format('YYYY-MM-DD') |
| | | this.form.HDate = moment(date).format('YYYY-MM-DD HH:mm:ss') |
| | | } else { |
| | | if (data[0].HSourceInterID != "0") { |
| | | this.ifOrganizationEdit = true |
| | |
| | | , "HChecker": data[0].审核人 |
| | | , "HCloseMan": data[0].关闭人 |
| | | , "HUpDater": data[0].修改人 |
| | | ,"HBillSubType": data[0].子单据类型 |
| | | , "HDeleteMan": data[0].作废人 |
| | | , "HMakeDate": data[0].制单日期 == null ? "" : data[0].制单日期 |
| | | , "HCheckDate": data[0].审核日期 == null ? "" : data[0].审核日期 |
| | |
| | | }else if(!item.HWHID){ |
| | | fhck = true |
| | | this.$modal.msgError("第" + (index + 1) + "行:调入仓库未选择!"); |
| | | }else if(!item.HUnitID){ |
| | | fhck = true |
| | | this.$modal.msgError("第" + (index + 1) + "行:计量单位为空!"); |
| | | }else if(item.HQty == 0){ |
| | | } |
| | | // else if(!item.HUnitID){ |
| | | // fhck = true |
| | | // this.$modal.msgError("第" + (index + 1) + "行:计量单位为空!"); |
| | | // } |
| | | else if(item.HQty == 0){ |
| | | fhck = true |
| | | this.$modal.msgError("第" + (index + 1) + "行:数量不能为0!"); |
| | | } |