zhangwencui
3 天以前 f08a81f01bc4a4104dd9ef04e071bb0bd0eb8afe
src/views/wls/materialstock/index.vue
@@ -19,7 +19,7 @@
import { MdItemTypeTree } from '#/views/mes/md/item/type/components';
import { WmBatchDetail } from '#/views/wls/batch/components';
import AreaForm from '#/views/wls/warehouse/area/modules/form.vue';
import { WmStockAdjustModal } from './components';
import { WmStockAdjustModal, WmStockMoveModal } from './components';
import { useGridColumns, useGridFormSchema } from './data';
@@ -30,6 +30,11 @@
const [StockAdjustModal, stockAdjustModalApi] = useVbenModal({
  connectedComponent: WmStockAdjustModal,
  destroyOnClose: true,
});
const [StockMoveModal, stockMoveModalApi] = useVbenModal({
  connectedComponent: WmStockMoveModal,
  destroyOnClose: true,
});
@@ -74,6 +79,16 @@
  gridApi.query();
}
/** 打开移库弹窗 */
function handleOpenStockMove(row: MesWmMaterialStockApi.MaterialStock) {
  stockMoveModalApi.setData(row).open();
}
/** 移库成功回调 */
function handleStockMoveSuccess() {
  gridApi.query();
}
/** 打开批次详情弹窗 */
function handleOpenBatchDetail(row: MesWmMaterialStockApi.MaterialStock) {
  if (!row.batchId) {
@@ -108,7 +123,7 @@
    schema: useGridFormSchema(),
  },
  gridOptions: {
    columns: useGridColumns(handleFrozenChange),
    columns: useGridColumns(handleFrozenChange, handleOpenStockMove),
    height: 'auto',
    keepSource: true,
    proxyConfig: {
@@ -139,6 +154,7 @@
  <Page auto-content-height><AreaModal />
    <WmBatchDetail ref="batchDetailRef" />
    <StockAdjustModal @success="handleStockAdjustSuccess" />
    <StockMoveModal @success="handleStockMoveSuccess" />
    <div class="flex h-full w-full">
      <!-- 左侧物料分类树 -->
@@ -192,6 +208,19 @@
            </Button>
            <span v-else>-</span>
          </template>
          <template #actions="{ row }">
            <TableAction
              :actions="[
                {
                  label: '移库',
                  type: 'link',
                  auth: ['mes:wm-material-stock:move'],
                  ifShow: !row.frozen,
                  onClick: handleOpenStockMove.bind(null, row),
                },
              ]"
            />
          </template>
        </Grid>
      </div>
    </div>