| | |
| | | style="width: 140px"> |
| | | <el-option label="未入库" |
| | | :value="0" /> |
| | | <el-option label="已入库" |
| | | <el-option label="部分入库" |
| | | :value="1" /> |
| | | <el-option label="已入库" |
| | | :value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | type="danger">不足</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="入库状态" |
| | | width="100px" |
| | | align="center"> |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.productStockStatus == 1" |
| | | type="success">已入库</el-tag> |
| | | <el-tag v-else-if="scope.row.productStockStatus == 0" |
| | | type="info">未出库</el-tag> |
| | | <el-tag v-else |
| | | type="danger">不足</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <!-- <el-table-column label="发货状态" width="140" align="center"> |
| | | <template #default="scope"> |
| | | <el-tag :type="getShippingStatusType(scope.row)" size="small"> |
| | |
| | | <el-tag v-if="Number(scope.row.stockStatus) === 0" |
| | | type="info">未入库</el-tag> |
| | | <el-tag v-else-if="Number(scope.row.stockStatus) === 1" |
| | | type="success">部分入库</el-tag> |
| | | <el-tag v-else-if="Number(scope.row.stockStatus) === 2" |
| | | type="success">已入库</el-tag> |
| | | <el-tag v-else |
| | | type="info">-</el-tag> |
| | |
| | | :key="item.id" |
| | | :label="item.customerName" |
| | | :value="item.id"> |
| | | {{ |
| | | item.customerName + "——" + item.taxpayerIdentificationNumber |
| | | }} |
| | | {{ item.customerName + (item.taxpayerIdentificationNumber ? "——" + item.taxpayerIdentificationNumber : "") }} |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="规格型号" |
| | | prop="specificationModel" |
| | | min-width="160"> |
| | | min-width="200"> |
| | | <template #default="scope"> |
| | | <el-select v-if="scope.row.__editing" |
| | | v-model="scope.row.productModelId" |
| | |
| | | min-width="160"> |
| | | <template #default="scope"> |
| | | <el-input-number v-if="scope.row.__editing" |
| | | controls-position="right" |
| | | v-model="scope.row.thickness" |
| | | :min="0" |
| | | :step="0.000000000000001" |
| | | :precision="15" |
| | | :step="1" |
| | | :precision="2" |
| | | style="width: 100%" |
| | | placeholder="请输入" |
| | | clearable /> |
| | |
| | | min-width="160"> |
| | | <template #default="scope"> |
| | | <el-input-number v-if="scope.row.__editing" |
| | | controls-position="right" |
| | | v-model="scope.row.width" |
| | | :min="0" |
| | | :step="1" |
| | |
| | | min-width="160"> |
| | | <template #default="scope"> |
| | | <el-input-number v-if="scope.row.__editing" |
| | | controls-position="right" |
| | | v-model="scope.row.height" |
| | | :min="0" |
| | | :step="1" |
| | |
| | | </el-table-column> |
| | | <el-table-column label="结算单片面积(㎡)" |
| | | prop="settlePieceArea" |
| | | min-width="160"> |
| | | min-width="200"> |
| | | <template #default="scope"> |
| | | <el-input-number v-if="scope.row.__editing" |
| | | controls-position="right" |
| | | v-model="scope.row.settlePieceArea" |
| | | :min="0" |
| | | :step="0.00001" |
| | | :precision="5" |
| | | :step="1" |
| | | :precision="10" |
| | | style="width: 100%" |
| | | placeholder="请输入" |
| | | clearable |
| | |
| | | min-width="150"> |
| | | <template #default="scope"> |
| | | <el-input-number v-if="scope.row.__editing" |
| | | controls-position="right" |
| | | v-model="scope.row.quantity" |
| | | :step="0.1" |
| | | :step="1" |
| | | :min="0" |
| | | :precision="2" |
| | | :precision="0" |
| | | style="width: 100%" |
| | | placeholder="请输入" |
| | | clearable |
| | |
| | | </el-table-column> |
| | | <el-table-column label="面积(m²)" |
| | | prop="actualTotalArea" |
| | | min-width="160"> |
| | | min-width="200"> |
| | | <template #default="scope"> |
| | | <el-input-number v-if="scope.row.__editing" |
| | | controls-position="right" |
| | | v-model="scope.row.actualTotalArea" |
| | | :min="0" |
| | | :step="0.00001" |
| | | :precision="5" |
| | | :step="1" |
| | | :precision="10" |
| | | style="width: 100%" |
| | | placeholder="自动计算" /> |
| | | <span v-else>{{ scope.row.actualTotalArea ?? "" }}</span> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="含税单价(元)" |
| | | prop="taxInclusiveUnitPrice" |
| | | min-width="140"> |
| | | min-width="160"> |
| | | <template #default="scope"> |
| | | <el-input-number v-if="scope.row.__editing" |
| | | :step="0.01" |
| | |
| | | </el-table-column> |
| | | <el-table-column label="楼层编号" |
| | | prop="floorCode" |
| | | min-width="140" |
| | | min-width="250" |
| | | show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | <el-input v-if="scope.row.__editing" |
| | |
| | | <FormDialog v-model="importUpload.open" |
| | | :title="importUpload.title" |
| | | :width="'600px'" |
| | | @close="importUpload.open = false" |
| | | @close="onClose" |
| | | @confirm="submitImportFile" |
| | | @cancel="importUpload.open = false"> |
| | | @cancel="onClose"> |
| | | <el-upload ref="importUploadRef" |
| | | :limit="1" |
| | | accept=".xlsx,.xls" |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | <!-- 入库产品选择弹窗 --> |
| | | <el-dialog v-model="stockDialogVisible" |
| | | title="选择入库产品" |
| | | width="60%" |
| | | :close-on-click-modal="false"> |
| | | <el-table :data="stockProductList" |
| | | border |
| | | stripe |
| | | v-loading="stockLoading" |
| | | height="400px" |
| | | @selection-change="val => selectedStockProductIds = val.map(item => item.id)"> |
| | | <el-table-column type="selection" |
| | | width="55" |
| | | align="center" /> |
| | | <el-table-column align="center" |
| | | label="序号" |
| | | type="index" |
| | | width="60" /> |
| | | <el-table-column prop="productCategory" |
| | | label="产品大类" |
| | | show-overflow-tooltip /> |
| | | <el-table-column prop="specificationModel" |
| | | label="规格型号" |
| | | show-overflow-tooltip /> |
| | | <el-table-column prop="quantity" |
| | | label="数量" |
| | | width="100" /> |
| | | <el-table-column prop="floorCode" |
| | | label="楼层编号" |
| | | show-overflow-tooltip /> |
| | | </el-table> |
| | | <template #footer> |
| | | <el-button @click="stockDialogVisible = false">取消</el-button> |
| | | <el-button type="primary" |
| | | @click="submitStock" |
| | | :disabled="selectedStockProductIds.length === 0"> |
| | | 确认入库 |
| | | </el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | const processFlowSelectBoundRouteId = ref(null); |
| | | const processFlowSelectBoundRouteName = ref(""); |
| | | |
| | | // 入库弹窗相关 |
| | | const stockDialogVisible = ref(false); |
| | | const stockProductList = ref([]); |
| | | const selectedStockProductIds = ref([]); |
| | | const stockLoading = ref(false); |
| | | const currentStockLedgerId = ref(null); |
| | | |
| | | // 用户信息表单弹框数据 |
| | | const operationType = ref(""); |
| | | const dialogFormVisible = ref(false); |
| | |
| | | entryDateStart: undefined, |
| | | entryDateEnd: undefined, |
| | | deliveryStatus: undefined, // 发货状态:1未发货 2审批中 3审批失败 4已发货 |
| | | stockStatus: undefined, // 入库状态:0未入库 1已入库 |
| | | stockStatus: undefined, // 入库状态:0未入库 1部分入库 2已入库 |
| | | }, |
| | | form: { |
| | | salesContractNo: "", |
| | |
| | | ElMessage.warning("所选数据缺少id,无法入库"); |
| | | return; |
| | | } |
| | | if (Number(row.stockStatus) === 1) { |
| | | ElMessage.info("该台账已入库,无需重复操作"); |
| | | if (Number(row.stockStatus) === 2) { |
| | | ElMessage.info("该台账已全部入库,无需重复操作"); |
| | | return; |
| | | } |
| | | |
| | | currentStockLedgerId.value = id; |
| | | selectedStockProductIds.value = []; |
| | | stockProductList.value = []; |
| | | stockDialogVisible.value = true; |
| | | stockLoading.value = true; |
| | | |
| | | try { |
| | | await ElMessageBox.confirm("确认对所选台账执行入库?", "提示", { |
| | | const res = await productList({ salesLedgerId: id, type: 1 }); |
| | | stockProductList.value = []; |
| | | stockProductList.value = |
| | | res.data.filter(item => item.productStockStatus == 0) || []; |
| | | } catch (e) { |
| | | proxy?.$modal?.msgError?.("获取产品列表失败"); |
| | | } finally { |
| | | stockLoading.value = false; |
| | | } |
| | | }; |
| | | |
| | | const submitStock = async () => { |
| | | if (selectedStockProductIds.value.length === 0) { |
| | | ElMessage.warning("请选择至少一个产品进行入库"); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | await ElMessageBox.confirm("确认对所选产品执行入库?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | |
| | | } catch { |
| | | return; |
| | | } |
| | | |
| | | proxy?.$modal?.loading?.("正在入库,请稍候..."); |
| | | try { |
| | | await salesStock({ id }); |
| | | await salesStock({ |
| | | salesLedgerId: currentStockLedgerId.value, |
| | | salesLedgerProducts: selectedStockProductIds.value, |
| | | }); |
| | | proxy?.$modal?.msgSuccess?.("入库成功"); |
| | | stockDialogVisible.value = false; |
| | | await getList(); |
| | | } catch (e) { |
| | | proxy?.$modal?.msgError?.("入库失败,请稍后重试"); |
| | |
| | | const downloadTemplate = () => { |
| | | proxy.download("/sales/ledger/exportTemplate", {}, "销售台账导入模板.xlsx"); |
| | | }; |
| | | const onClose = () => { |
| | | importUpload.open = false; |
| | | if (importUploadRef.value) { |
| | | importUploadRef.value.clearFiles(); |
| | | } |
| | | }; |
| | | |
| | | // 提交导入文件 |
| | | const submitImportFile = () => { |
| | |
| | | const isTrue = true; |
| | | selectedRows.value.forEach(row => { |
| | | if (row.deliveryStatus != 1 && row.deliveryStatus != 3) { |
| | | proxy.$modal.msgWarning("仅未发货或审批失败的台账可以合并发货"); |
| | | proxy.$modal.msgWarning("仅未发货或审批失败的台账可以发货"); |
| | | isTrue = false; |
| | | return; |
| | | } |