Merge remote-tracking branch 'origin/dev_pro_河南鹤壁_泽淇实业' into dev_pro_河南鹤壁_泽淇实业
| | |
| | | size: Cookies.get("size") || "default", |
| | | }); |
| | | app._context.components.ElDialog.props.closeOnClickModal.default = false; |
| | | const ElTable = app._context.components.ElTable; |
| | | if (ElTable?.props?.tooltipOptions) { |
| | | if (ElTable.props.tooltipOptions === Object) { |
| | | ElTable.props.tooltipOptions = { |
| | | type: Object, |
| | | default: () => ({ |
| | | appendTo: "body", |
| | | }), |
| | | }; |
| | | } else if (typeof ElTable.props.tooltipOptions === "object") { |
| | | ElTable.props.tooltipOptions.default = |
| | | ElTable.props.tooltipOptions.default || |
| | | (() => ({ |
| | | appendTo: "body", |
| | | })); |
| | | } |
| | | } |
| | | |
| | | app.mount("#app"); |
| | |
| | | @change="handleQuery"> |
| | | <el-option label="零售客户" |
| | | value="零售客户" /> |
| | | <el-option label="进销商客户" |
| | | value="进销商客户" /> |
| | | <el-option label="经销商客户" |
| | | value="经销商客户" /> |
| | | </el-select> |
| | | <el-button type="primary" |
| | | @click="handleQuery" |
| | |
| | | clearable> |
| | | <el-option label="零售客户" |
| | | value="零售客户" /> |
| | | <el-option label="进销商客户" |
| | | value="进销商客户" /> |
| | | <el-option label="经销商客户" |
| | | value="经销商客户" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <span class="info-value">{{ detailForm.companyAddress }}</span> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <!-- <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">银行基本户:</span> |
| | | <span class="info-value">{{ detailForm.basicBankAccount }}</span> |
| | | </div> |
| | | </el-col> |
| | | </el-col> --> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <!-- <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">银行账号:</span> |
| | |
| | | <span class="info-value">{{ detailForm.bankCode }}</span> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-row> --> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | |
| | | @change="handleQuery"> |
| | | <el-option label="零售客户" |
| | | value="零售客户" /> |
| | | <el-option label="进销商客户" |
| | | value="进销商客户" /> |
| | | <el-option label="经销商客户" |
| | | value="经销商客户" /> |
| | | </el-select> |
| | | <el-button type="primary" |
| | | @click="handleQuery" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <!-- <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="银行基本户:" |
| | | prop="basicBankAccount"> |
| | |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-row> --> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <!-- <el-col :span="12"> |
| | | <el-form-item label="开户行号:" |
| | | prop="bankCode"> |
| | | <el-input v-model="form.bankCode" |
| | | placeholder="请输入" |
| | | clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-col> --> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客户分类:" |
| | | prop="customerType"> |
| | |
| | | clearable> |
| | | <el-option label="零售客户" |
| | | value="零售客户" /> |
| | | <el-option label="进销商客户" |
| | | value="进销商客户" /> |
| | | <el-option label="经销商客户" |
| | | value="经销商客户" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <span class="info-value">{{ detailForm.companyAddress }}</span> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <!-- <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">银行基本户:</span> |
| | | <span class="info-value">{{ detailForm.basicBankAccount }}</span> |
| | | </div> |
| | | </el-col> |
| | | </el-col> --> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <!-- <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | | <span class="info-label">银行账号:</span> |
| | |
| | | <span class="info-value">{{ detailForm.bankCode }}</span> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-row> --> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <div class="info-item"> |
| | |
| | | // prop: "followUpTime", |
| | | // width: 120, |
| | | // }, |
| | | { |
| | | label: "银行基本户", |
| | | prop: "basicBankAccount", |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "银行账号", |
| | | prop: "bankAccount", |
| | | width: 220, |
| | | }, |
| | | { |
| | | label: "开户行号", |
| | | prop: "bankCode", |
| | | width: 220, |
| | | }, |
| | | // { |
| | | // label: "银行基本户", |
| | | // prop: "basicBankAccount", |
| | | // width: 220, |
| | | // }, |
| | | // { |
| | | // label: "银行账号", |
| | | // prop: "bankAccount", |
| | | // width: 220, |
| | | // }, |
| | | // { |
| | | // label: "开户行号", |
| | | // prop: "bankCode", |
| | | // width: 220, |
| | | // }, |
| | | { |
| | | label: "维护人", |
| | | prop: "maintainer", |
| | |
| | | }, |
| | | rules: { |
| | | customerName: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | taxpayerIdentificationNumber: [ |
| | | { required: true, message: "请输入", trigger: "blur" }, |
| | | ], |
| | | companyAddress: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | companyPhone: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | // taxpayerIdentificationNumber: [ |
| | | // { required: true, message: "请输入", trigger: "blur" }, |
| | | // ], |
| | | // companyAddress: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | // companyPhone: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | // contactPerson: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | // contactPhone: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | maintainer: [{ required: false, message: "请选择", trigger: "change" }], |
| | |
| | | import { deptTreeSelect } from "@/api/system/user.js"; |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import { parseTime } from "@/utils/ruoyi"; |
| | | |
| | | const tableColumn = ref([ |
| | | { |
| | |
| | | { |
| | | label: "创建时间", |
| | | prop: "createTime", |
| | | formatData: val => { |
| | | if (!val) return ""; |
| | | return parseTime(val, "{y}-{m}-{d} {h}:{i}:{s}"); |
| | | }, |
| | | }, |
| | | { |
| | | label: "操作", |
| | |
| | | <el-form-item label="产品名称:" |
| | | prop="productName"> |
| | | <el-input v-model="form.productName" |
| | | type="textarea" |
| | | resize="vertical" |
| | | placeholder="请输入产品名称" |
| | | maxlength="20" |
| | | maxlength="50" |
| | | show-word-limit |
| | | clearable |
| | | @keydown.enter.prevent /> |
| | |
| | | :rules="modelRules" |
| | | ref="modelFormRef"> |
| | | <el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="产品编号:" |
| | | prop="productCode"> |
| | | <el-input v-model="modelForm.productCode" |
| | | placeholder="请输入产品编号" |
| | | clearable |
| | | @keydown.enter.prevent /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="产品编号:" |
| | | prop="productCode"> |
| | | <el-input v-model="modelForm.productCode" |
| | | placeholder="请输入产品编号" |
| | | clearable |
| | | @keydown.enter.prevent /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="规格型号:" |
| | | prop="model"> |
| | |
| | | <el-descriptions-item label="发货日期">{{ currentDelivery.shippingInfo.shippingDate || '--' }}</el-descriptions-item> |
| | | <el-descriptions-item label="审核状态">{{ currentDelivery.shippingInfo.status || '--' }}</el-descriptions-item> |
| | | <el-descriptions-item label="发货车牌号">{{ currentDelivery.shippingInfo.shippingCarNumber || '--' }}</el-descriptions-item> |
| | | <el-descriptions-item label="快递公司">{{ currentDelivery.shippingInfo.expressCompany || '--' }}</el-descriptions-item> |
| | | <el-descriptions-item label="快递公司" v-if="false">{{ currentDelivery.shippingInfo.expressCompany || '--' }}</el-descriptions-item> |
| | | <el-descriptions-item label="快递单号" |
| | | :span="2">{{ currentDelivery.shippingInfo.expressNumber || '--' }}</el-descriptions-item> |
| | | :span="2" v-if="false">{{ currentDelivery.shippingInfo.expressNumber || '--' }}</el-descriptions-item> |
| | | </el-descriptions> |
| | | <div style="margin-top: 20px;"> |
| | | <h4>产品明细</h4> |
| | |
| | | <el-table-column prop="productCategory" label="产品大类" align="center" /> |
| | | <el-table-column prop="specificationModel" label="规格型号" align="center" /> |
| | | <el-table-column prop="unit" label="单位" align="center" /> |
| | | <el-table-column prop="expressCompany" label="快递公司" align="center" /> |
| | | <el-table-column prop="expressNumber" label="快递单号" align="center" /> |
| | | <el-table-column prop="expressCompany" label="快递公司" align="center" v-if="false" /> |
| | | <el-table-column prop="expressNumber" label="快递单号" align="center" v-if="false" /> |
| | | <el-table-column prop="shippingCarNumber" label="发货车牌" align="center" /> |
| | | <el-table-column prop="shippingDate" label="发货日期" align="center" /> |
| | | <el-table-column prop="quantity" label="售后数量" align="center" /> |
| | |
| | | dataType: "slot", |
| | | slot: "shippingStatus", |
| | | }, |
| | | { label: "快递公司", prop: "expressCompany", width: 140 }, |
| | | { label: "快递单号", prop: "expressNumber", width: 160 }, |
| | | // { label: "快递公司", prop: "expressCompany", width: 140 }, |
| | | // { label: "快递单号", prop: "expressNumber", width: 160 }, |
| | | { |
| | | label: "发货车牌", |
| | | prop: "shippingCarNumber", |
| | |
| | | {{ row.relayState === "1" ? "合闸" : row.relayState === "0" ? "拉闸" : "未知" }} |
| | | </el-tag> |
| | | </template> |
| | | <template #syncTime="{ row }"> |
| | | {{ row.syncTime ? dayjs(row.syncTime).format('YYYY-MM-DD HH:mm:ss') : '-' }} |
| | | </template> |
| | | <template #operate="{ row }"> |
| | | <el-button link type="primary" @click="openForm('edit', row)">编辑</el-button> |
| | | <el-button v-if="row.source === 'manual'" link type="danger" @click="handleDelete(row)">删除</el-button> |
| | |
| | | <script setup> |
| | | import { onMounted, reactive, ref, toRefs } from "vue"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import dayjs from "dayjs"; |
| | | import FormDia from "./components/formDia.vue"; |
| | | import { meterListPage, meterSync, meterDelete } from "@/api/energyManagement/tqdianbiao.js"; |
| | | |
| | |
| | | { label: "来源", prop: "source", dataType: "slot", slot: "source", width: 80 }, |
| | | { label: "继电器", prop: "relayState", dataType: "slot", slot: "relayState", width: 90 }, |
| | | { label: "备注", prop: "description", minWidth: 100 }, |
| | | { label: "同步时间", prop: "syncTime", minWidth: 160 }, |
| | | { label: "同步时间", prop: "syncTime", dataType: "slot", slot: "syncTime", minWidth: 160 }, |
| | | { label: "操作", prop: "operate", dataType: "slot", slot: "operate", width: 120, fixed: "right" }, |
| | | ]); |
| | | |
| | |
| | | <el-form-item label="保养项目"> |
| | | <el-input |
| | | v-model="form.machineryCategory" |
| | | type="textarea" |
| | | placeholder="请输入保养项目" |
| | | /> |
| | | </el-form-item> |
| | |
| | | <el-form-item label="保养项目" prop="machineryCategory"> |
| | | <el-input |
| | | v-model.trim="form.machineryCategory" |
| | | type="textarea" |
| | | placeholder="请输入保养项目" |
| | | maxlength="100" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | |
| | | <el-table-column |
| | | label="出库日期" |
| | | prop="createTime" |
| | | width="180" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column label="规格型号" prop="model" show-overflow-tooltip /> |
| | | <el-table-column label="批号" prop="batchNo" show-overflow-tooltip /> |
| | | <el-table-column label="单位" prop="unit" show-overflow-tooltip /> |
| | | <el-table-column label="批号" prop="batchNo" width="150" show-overflow-tooltip /> |
| | | <el-table-column label="单位" prop="unit" width="80" show-overflow-tooltip /> |
| | | <el-table-column |
| | | label="出库数量" |
| | | prop="stockOutNum" |
| | | width="80" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column label="出库人" prop="createBy" show-overflow-tooltip /> |
| | | <el-table-column label="出库人" prop="createBy" width="100" show-overflow-tooltip /> |
| | | <el-table-column label="来源" prop="recordType" show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | {{ getRecordType(scope.row.recordType) }} |
| | |
| | | width="60"/> |
| | | <el-table-column label="入库批次" |
| | | prop="inboundBatches" |
| | | width="200" |
| | | width="150" |
| | | show-overflow-tooltip/> |
| | | <el-table-column label="入库时间" |
| | | prop="createTime" |
| | | width="160" |
| | | show-overflow-tooltip/> |
| | | <el-table-column label="产品大类" |
| | | prop="productName" |
| | |
| | | show-overflow-tooltip/> |
| | | <el-table-column label="批号" |
| | | prop="batchNo" |
| | | width="180" |
| | | show-overflow-tooltip/> |
| | | <el-table-column label="单位" |
| | | prop="unit" |
| | |
| | | prop="qualifiedQuantity" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | <!-- <el-table-column |
| | | label="不合格库存数量" |
| | | prop="unQualifiedQuantity" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | /> --> |
| | | <!-- <el-table-column |
| | | label="合格冻结数量" |
| | | prop="qualifiedLockedQuantity" |
| | | show-overflow-tooltip |
| | |
| | | label="不合格冻结数量" |
| | | prop="unQualifiedLockedQuantity" |
| | | show-overflow-tooltip |
| | | /> |
| | | /> --> |
| | | <el-table-column |
| | | label="库存预警数量" |
| | | prop="warnNum" |
| | |
| | | prop="updateTime" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column fixed="right" label="操作" min-width="180" align="center"> |
| | | <el-table-column fixed="right" label="操作" min-width="100" align="center"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | link |
| | |
| | | " |
| | | >领用</el-button |
| | | > |
| | | <el-button |
| | | <!-- <el-button |
| | | link |
| | | type="primary" |
| | | v-if=" |
| | |
| | | " |
| | | @click="handleFrozen(scope.row)" |
| | | >冻结</el-button |
| | | > |
| | | > --> |
| | | <el-button |
| | | link |
| | | type="primary" |
| | |
| | | placeholder="请选择库存类型"> |
| | | <el-option label="合格库存" |
| | | value="qualified" /> |
| | | <el-option label="不合格库存" |
| | | value="unqualified" /> |
| | | <!-- <el-option label="不合格库存" |
| | | value="unqualified" /> --> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="库存数量" |
| | |
| | | /> |
| | | <el-table-column label="规格型号" prop="model" show-overflow-tooltip /> |
| | | <el-table-column label="单位" prop="unit" show-overflow-tooltip /> |
| | | <el-table-column label="批号" prop="batchNo" show-overflow-tooltip /> |
| | | <!-- <el-table-column label="批号" prop="batchNo" show-overflow-tooltip /> --> |
| | | <el-table-column |
| | | label="合格库存数量" |
| | | prop="qualifiedQuantity" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | <!-- <el-table-column |
| | | label="不合格库存数量" |
| | | prop="unQualifiedQuantity" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | /> --> |
| | | <!-- <el-table-column |
| | | label="合格冻结数量" |
| | | prop="qualifiedLockedQuantity" |
| | | show-overflow-tooltip |
| | |
| | | label="不合格冻结数量" |
| | | prop="unQualifiedLockedQuantity" |
| | | show-overflow-tooltip |
| | | /> |
| | | /> --> |
| | | <el-table-column |
| | | label="库存预警数量" |
| | | prop="warnNum" |
| | |
| | | const { form, rules } = toRefs(data); |
| | | const { form: searchForm } = useFormData({ |
| | | ...data.searchForm, |
| | | // 设置录入日期范围为当天 |
| | | entryDate: [ |
| | | dayjs().startOf("day").format("YYYY-MM-DD"), |
| | | dayjs().endOf("day").format("YYYY-MM-DD"), |
| | | ], |
| | | entryDateStart: dayjs().startOf("day").format("YYYY-MM-DD"), |
| | | entryDateEnd: dayjs().endOf("day").format("YYYY-MM-DD"), |
| | | }); |
| | | |
| | | // 产品表单弹框数据 |
| | |
| | | @change="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="快递单号:"> |
| | | <el-form-item label="快递单号:" v-if="false"> |
| | | <el-input |
| | | v-model="searchForm.expressNumber" |
| | | placeholder="请输入" |
| | |
| | | <el-table-column |
| | | label="快递公司" |
| | | prop="expressCompany" |
| | | v-if="false" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | | label="快递单号" |
| | | prop="expressNumber" |
| | | v-if="false" |
| | | show-overflow-tooltip |
| | | /> |
| | | <el-table-column |
| | |
| | | @change="handleShippingTypeChange" |
| | | > |
| | | <el-option label="货车" value="货车" /> |
| | | <el-option label="快递" value="快递" /> |
| | | <el-option label="快递" value="快递" v-if="false" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24" v-else> |
| | | <el-col :span="24" v-else-if="false"> |
| | | <el-form-item label="快递公司:" prop="expressCompany"> |
| | | <el-input |
| | | v-model="form.expressCompany" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30" v-if="form.type === '快递'"> |
| | | <el-row :gutter="30" v-if="false"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="快递单号:" prop="expressNumber"> |
| | | <el-input |
| | |
| | | <el-descriptions-item label="发货车牌号">{{ |
| | | detailRow.shippingCarNumber || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="快递公司">{{ |
| | | <el-descriptions-item label="快递公司" v-if="false">{{ |
| | | detailRow.expressCompany || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="快递单号" :span="2">{{ |
| | | <el-descriptions-item label="快递单号" :span="2" v-if="false">{{ |
| | | detailRow.expressNumber || "--" |
| | | }}</el-descriptions-item> |
| | | <el-descriptions-item label="出库单号" :span="2">{{ |
| | |
| | | <el-select v-model="logisticsCompany" placeholder="请选择物流公司" style="width: 100%"> |
| | | <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-option label="中通快递" value="中通快递" v-if="false"></el-option> |
| | | <el-option label="申通快递" value="申通快递" v-if="false"></el-option> |
| | | <el-option label="韵达速递" value="韵达速递"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | style="margin-bottom: 20px;"> |
| | | <div> |
| | | <span class="search_title">客户名称:</span> |
| | | <el-input v-model="searchForm.searchText" |
| | | <el-input v-model="searchForm.customerName" |
| | | style="width: 240px" |
| | | placeholder="输入客户名称搜索" |
| | | @change="handleQuery" |
| | |
| | | const recordTotal = ref(0); |
| | | const data = reactive({ |
| | | searchForm: { |
| | | searchText: "", |
| | | customerName: "", |
| | | invoiceDate: "", |
| | | }, |
| | | }); |
| | |
| | | </el-table-column> |
| | | <el-table-column label="快递公司" |
| | | prop="expressCompany" |
| | | v-if="false" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="快递单号" |
| | | prop="expressNumber" |
| | | v-if="false" |
| | | show-overflow-tooltip /> |
| | | <el-table-column label="发货车牌" |
| | | minWidth="100px" |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="是否生产:" |
| | | prop="isProduction"> |
| | | <el-radio-group v-model="productForm.isProduction"> |
| | | <el-radio label="是" |
| | | :value="true" /> |
| | | <el-radio label="否" |
| | | :value="false" /> |
| | | </el-radio-group> |
| | | <div style="display: flex; align-items: center; width: 100%;"> |
| | | <el-radio-group v-model="productForm.isProduction"> |
| | | <el-radio label="是" |
| | | :value="true" /> |
| | | <el-radio label="否" |
| | | :value="false" /> |
| | | </el-radio-group> |
| | | <div |
| | | v-if="currentStock !== null" |
| | | :style="{ |
| | | marginLeft: '20px', |
| | | padding: '0 12px', |
| | | height: '28px', |
| | | lineHeight: '28px', |
| | | borderRadius: '4px', |
| | | fontSize: '13px', |
| | | fontWeight: '500', |
| | | display: 'inline-block', |
| | | whiteSpace: 'nowrap', |
| | | backgroundColor: (productForm.quantity || 0) > currentStock ? '#fff0f0' : '#f0f9eb', |
| | | border: (productForm.quantity || 0) > currentStock ? '1px solid #ffcccc' : '1px solid #e1f3d8', |
| | | color: (productForm.quantity || 0) > currentStock ? '#f56c6c' : '#67c23a' |
| | | }" |
| | | > |
| | | <span>当前库存:{{ currentStock }} {{ productForm.unit || '' }}</span> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | <el-option label="货车" |
| | | value="货车" /> |
| | | <el-option label="快递" |
| | | v-if="false" |
| | | value="快递" /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24" |
| | | v-else> |
| | | v-else-if="false"> |
| | | <el-form-item label="快递公司:" |
| | | prop="expressCompany"> |
| | | <el-input v-model="deliveryForm.expressCompany" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="30" |
| | | v-if="deliveryForm.type === '快递'"> |
| | | v-if="false"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="快递单号:" |
| | | prop="expressNumber"> |
| | |
| | | item?.qualifiedQuantity ?? |
| | | item?.stockQuantity; |
| | | return quantity ?? 0; |
| | | }; |
| | | const currentStock = ref(null); |
| | | const fetchCurrentStock = async (productModelId) => { |
| | | if (!productModelId) { |
| | | currentStock.value = null; |
| | | return; |
| | | } |
| | | try { |
| | | const res = await getStockInventoryByModelId(productModelId); |
| | | const rawList = Array.isArray(res?.data) |
| | | ? res.data |
| | | : res?.data?.records || res?.data?.rows || []; |
| | | let total = 0; |
| | | rawList.forEach(item => { |
| | | total += Number(getDeliveryBatchQuantity(item) || 0); |
| | | }); |
| | | currentStock.value = total; |
| | | } catch (e) { |
| | | console.error(e); |
| | | currentStock.value = 0; |
| | | } |
| | | }; |
| | | const getCurrentDeliveryRowQuantity = () => { |
| | | return Number(currentDeliveryRow.value?.noQuantity || 0); |
| | |
| | | // 获取tree子数据 |
| | | const getModels = value => { |
| | | productForm.value.productCategory = findNodeById(productOptions.value, value); |
| | | currentStock.value = null; |
| | | modelList({ id: value }).then(res => { |
| | | modelOptions.value = res; |
| | | }); |
| | |
| | | if (index !== -1) { |
| | | productForm.value.specificationModel = modelOptions.value[index].model; |
| | | productForm.value.unit = modelOptions.value[index].unit; |
| | | fetchCurrentStock(value); |
| | | } else { |
| | | productForm.value.specificationModel = null; |
| | | productForm.value.unit = null; |
| | | currentStock.value = null; |
| | | } |
| | | }; |
| | | const findNodeById = (nodes, productId) => { |
| | |
| | | |
| | | productOperationType.value = type; |
| | | productForm.value = {}; |
| | | currentStock.value = null; |
| | | if (type === "add") { |
| | | productForm.value.isProduction = false; |
| | | } |
| | |
| | | ); |
| | | if (currentModel) { |
| | | productForm.value.productModelId = currentModel.id; |
| | | fetchCurrentStock(currentModel.id); |
| | | } |
| | | } |
| | | } catch (e) { |