|
|
@@ -153,490 +153,275 @@
|
|
|
:model="{ productList: productList }"
|
|
|
:show-message="false"
|
|
|
>
|
|
|
- <el-button
|
|
|
- v-if="productList.length != 0"
|
|
|
- type="success"
|
|
|
- plain
|
|
|
- style="margin-bottom: 20px; float: right; margin-right: 20px"
|
|
|
- size="mini"
|
|
|
- @click="batchSave"
|
|
|
- >批量保存</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- v-if="productList.length != 0"
|
|
|
- type="success"
|
|
|
- plain
|
|
|
- style="margin-bottom: 20px; float: right; margin-right: 20px"
|
|
|
- size="mini"
|
|
|
- @click="handleWareHouse(productList, '', 'batch')"
|
|
|
- >批量选择仓库</el-button
|
|
|
+ <ele-pro-table
|
|
|
+ ref="table"
|
|
|
+ :columns="columns"
|
|
|
+ :datasource="productList"
|
|
|
+ :needPage="false"
|
|
|
+ @columns-change="handleColumnChange"
|
|
|
+ :cache-key="cacheKeyUrl"
|
|
|
>
|
|
|
- <el-table
|
|
|
- :header-cell-style="rowClass"
|
|
|
- :max-height="300"
|
|
|
- border
|
|
|
- ref="productListTable"
|
|
|
- :data="productList"
|
|
|
- tooltip-effect="dark"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- label="序号"
|
|
|
- type="index"
|
|
|
- width="50"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="编码"
|
|
|
- prop="categoryCode"
|
|
|
- align="center"
|
|
|
- width="130"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="名称"
|
|
|
- align="center"
|
|
|
- width="200"
|
|
|
- prop="categoryName"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="型号"
|
|
|
- align="center"
|
|
|
- width="100"
|
|
|
- prop="categoryModel"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="规格"
|
|
|
- align="center"
|
|
|
- width="100"
|
|
|
- prop="specification"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="牌号"
|
|
|
- align="center"
|
|
|
- width="100"
|
|
|
- prop="brandNum"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- v-for="(item, index) in newColumns"
|
|
|
- :label="item.label"
|
|
|
- :align="item.align"
|
|
|
- :prop="item.prop"
|
|
|
- :show-overflow-tooltip="item.showOverflowTooltip"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="批次号"
|
|
|
- align="center"
|
|
|
- width="200"
|
|
|
- prop="batchNo"
|
|
|
- >
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- <template v-if="row.isSave">
|
|
|
- {{ row.batchNo }}
|
|
|
- </template>
|
|
|
- <el-form-item
|
|
|
- v-else
|
|
|
- :prop="`productList.${$index}.batchNo`"
|
|
|
- required
|
|
|
- >
|
|
|
- <el-input
|
|
|
- :ref="'batchNo' + $index"
|
|
|
- @keyup.native="
|
|
|
- moveFocus($event, $index, 'batchNo', '产品', row)
|
|
|
- "
|
|
|
- v-model.number="row.batchNo"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- <el-table-column label="物料代号" prop="materielCode">
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- {{ row.extInfo.materielCode }}
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- label="数量"
|
|
|
- align="center"
|
|
|
- width="180"
|
|
|
- prop="packingQuantity"
|
|
|
- >
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- <template v-if="row.isSave">
|
|
|
- {{ row.packingQuantity }}
|
|
|
- </template>
|
|
|
- <el-form-item
|
|
|
- v-else
|
|
|
- :prop="`productList.${$index}.packingQuantity`"
|
|
|
- required
|
|
|
- >
|
|
|
- <el-input
|
|
|
- :ref="'packingQuantity' + $index"
|
|
|
- type="number"
|
|
|
- placeholder="请输入"
|
|
|
- @keyup.native="
|
|
|
- moveFocus(
|
|
|
- $event,
|
|
|
- $index,
|
|
|
- 'packingQuantity',
|
|
|
- '产品',
|
|
|
- row
|
|
|
- )
|
|
|
- "
|
|
|
- v-model="row.packingQuantity"
|
|
|
- @input="computeNum(row, $index, true)"
|
|
|
- :disabled="row.isSave"
|
|
|
- >
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="单位"
|
|
|
- align="center"
|
|
|
- prop="packingUnit"
|
|
|
- width="100"
|
|
|
- >
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- <template v-if="row.isSave">
|
|
|
- {{ row.packingUnit }}
|
|
|
- </template>
|
|
|
- <el-form-item
|
|
|
- v-else
|
|
|
- :prop="`productList.${$index}.packingUnit`"
|
|
|
- required
|
|
|
- >
|
|
|
- <el-select
|
|
|
- :disabled="row.isSave"
|
|
|
- v-model="row.packingUnitId"
|
|
|
- placeholder="请选择"
|
|
|
- @change="computeNum(row, $index)"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in row.packingSpecificationOption"
|
|
|
- :label="`${item.conversionUnit}`"
|
|
|
- :value="item.id"
|
|
|
- :key="item.id"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="包装规格"
|
|
|
- align="center"
|
|
|
- prop="packingSpecificationLabel"
|
|
|
- width="300"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- >
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- <el-tag v-for="item in row.packingSpecificationLabel">{{
|
|
|
- item
|
|
|
- }}</el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="允许拆包" prop="isUnpack">
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- {{ row.isUnpack ? '是' : '否' }}
|
|
|
+ <template v-slot:toolbar>
|
|
|
+ <el-button
|
|
|
+ v-if="productList.length != 0"
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ style=" float: right; margin-right: 20px"
|
|
|
+ size="mini"
|
|
|
+ @click="batchSave"
|
|
|
+ >批量保存</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-if="productList.length != 0"
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ style=" float: right; margin-right: 20px"
|
|
|
+ size="mini"
|
|
|
+ @click="handleWareHouse(productList, '', 'batch')"
|
|
|
+ >批量选择仓库</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ <template v-slot:batchNo="{ row, $index }">
|
|
|
+ <template v-if="row.isSave">
|
|
|
+ {{ row.batchNo }}
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="计量数量"
|
|
|
- align="center"
|
|
|
- prop="measureQuantity"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="计量单位"
|
|
|
- align="center"
|
|
|
- prop="measureUnit"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="单重"
|
|
|
- align="center"
|
|
|
- prop="singleWeight"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- width="180"
|
|
|
- >
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
+ <el-form-item
|
|
|
+ v-else
|
|
|
+ :prop="`productList.${$index}.batchNo`"
|
|
|
+ required
|
|
|
+ >
|
|
|
<el-input
|
|
|
- :disabled="row.isSave"
|
|
|
- v-model="row.singleWeight"
|
|
|
- placeholder="请输入"
|
|
|
- :min="0"
|
|
|
- style="width: 100%"
|
|
|
- @input="inputSingleWeight(row, $index)"
|
|
|
+ :ref="'batchNo' + $index"
|
|
|
+ @keyup.native="
|
|
|
+ moveFocus($event, $index, 'batchNo', '产品', row)
|
|
|
+ "
|
|
|
+ v-model.number="row.batchNo"
|
|
|
>
|
|
|
- <template slot="append">
|
|
|
- {{ row.weightUnit + '/' + row.measureUnit }}
|
|
|
- </template>
|
|
|
</el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ <template v-slot:packingQuantity="{ row, $index }">
|
|
|
+ <template v-if="row.isSave">
|
|
|
+ {{ row.packingQuantity }}
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="总重"
|
|
|
- align="center"
|
|
|
- prop="weight"
|
|
|
- width="150"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- >
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
+ <el-form-item
|
|
|
+ v-else
|
|
|
+ :prop="`productList.${$index}.packingQuantity`"
|
|
|
+ required
|
|
|
+ >
|
|
|
<el-input
|
|
|
- :disabled="row.isSave"
|
|
|
- v-model="row.weight"
|
|
|
+ :ref="'packingQuantity' + $index"
|
|
|
+ type="number"
|
|
|
placeholder="请输入"
|
|
|
- @input="inputAllweight(row, $index)"
|
|
|
+ @keyup.native="
|
|
|
+ moveFocus($event, $index, 'packingQuantity', '产品', row)
|
|
|
+ "
|
|
|
+ v-model="row.packingQuantity"
|
|
|
+ @input="computeNum(row, $index, true)"
|
|
|
+ :disabled="row.isSave"
|
|
|
>
|
|
|
</el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ <template v-slot:packingUnit="{ row, $index }">
|
|
|
+ <template v-if="row.isSave">
|
|
|
+ {{ row.packingUnit }}
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="重量单位"
|
|
|
- align="center"
|
|
|
- prop="weightUnit"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- >
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- {{ row.weightUnit }}
|
|
|
- <template slot="append"> </template>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="单价"
|
|
|
- prop="unitPrice"
|
|
|
- width="200"
|
|
|
- align="center"
|
|
|
- v-if="isPrice == 1"
|
|
|
- >
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- <template v-if="row.isSave">
|
|
|
- {{ row.unitPrice ? row.unitPrice + '/元' : '' }}
|
|
|
- </template>
|
|
|
- <el-form-item v-else>
|
|
|
- <el-input
|
|
|
- type="number"
|
|
|
- :ref="'unitPrice' + $index"
|
|
|
- @keyup.native="
|
|
|
- moveFocus($event, $index, 'unitPrice', '产品', row)
|
|
|
- "
|
|
|
- v-model.number="row.unitPrice"
|
|
|
- placeholder="非必填"
|
|
|
- @input="
|
|
|
- (value) =>
|
|
|
- (row.unitPrice = value.replace(/[^0-9.]+/g, ''))
|
|
|
- "
|
|
|
- >
|
|
|
- <template slot="append">
|
|
|
- 元/{{ row.measureUnit }}
|
|
|
- </template>
|
|
|
- </el-input>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="金额"
|
|
|
- align="center"
|
|
|
- prop="totalMoney"
|
|
|
- v-if="isPrice == 1"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- >
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- {{
|
|
|
- changeCount(
|
|
|
- calcSumTotal(row.measureQuantity, row.unitPrice, row)
|
|
|
- )
|
|
|
- }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="供应商"
|
|
|
- align="center"
|
|
|
- prop="supplierId"
|
|
|
- width="200"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- >
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- <template v-if="row.isSave">
|
|
|
- {{ row.supplierName }}
|
|
|
- </template>
|
|
|
+ <el-form-item
|
|
|
+ v-else
|
|
|
+ :prop="`productList.${$index}.packingUnit`"
|
|
|
+ required
|
|
|
+ >
|
|
|
<el-select
|
|
|
- v-else
|
|
|
- @change="selectSupplier($event, row)"
|
|
|
- v-model="row.supplierId"
|
|
|
+ :disabled="row.isSave"
|
|
|
+ v-model="row.packingUnitId"
|
|
|
placeholder="请选择"
|
|
|
+ @change="computeNum(row, $index)"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in row.supplierListOptions"
|
|
|
- :label="item.name"
|
|
|
+ v-for="item in row.packingSpecificationOption"
|
|
|
+ :label="`${item.conversionUnit}`"
|
|
|
:value="item.id"
|
|
|
:key="item.id"
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="供应商代号"
|
|
|
- align="center"
|
|
|
- prop="supplierCode"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- width="100"
|
|
|
- >
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- {{ row.supplierCode }}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="仓库"
|
|
|
- align="center"
|
|
|
- prop="warehouseName"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- width="300"
|
|
|
- >
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- <el-form-item
|
|
|
- :prop="`productList.${$index}.warehouseId`"
|
|
|
- required
|
|
|
- >
|
|
|
- <div
|
|
|
- :class="
|
|
|
- row.warehouseName
|
|
|
- ? 'wareHouse_style'
|
|
|
- : 'wareHouse_style red_color'
|
|
|
- "
|
|
|
- @click="handleWareHouse(row, $index)"
|
|
|
- >
|
|
|
- <span>
|
|
|
- {{
|
|
|
- row.warehouseName ? row.warehouseName : '请选择仓库'
|
|
|
- }}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="采购原因"
|
|
|
- align="center"
|
|
|
- width="200"
|
|
|
- prop="purpose"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- >
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- <template v-if="row.isSave">
|
|
|
- {{ row.purpose }}
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ <template v-slot:packingSpecificationLabel="{ row, $index }">
|
|
|
+ <el-tag v-for="item in row.packingSpecificationLabel">{{
|
|
|
+ item
|
|
|
+ }}</el-tag>
|
|
|
+ </template>
|
|
|
+ <template v-slot:singleWeight="{ row, $index }">
|
|
|
+ <el-input
|
|
|
+ :disabled="row.isSave"
|
|
|
+ v-model="row.singleWeight"
|
|
|
+ placeholder="请输入"
|
|
|
+ :min="0"
|
|
|
+ style="width: 100%"
|
|
|
+ @input="inputSingleWeight(row, $index)"
|
|
|
+ >
|
|
|
+ <template slot="append">
|
|
|
+ {{ row.weightUnit + '/' + row.measureUnit }}
|
|
|
</template>
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ <template v-slot:weight="{ row, $index }">
|
|
|
+ <el-input
|
|
|
+ :disabled="row.isSave"
|
|
|
+ v-model="row.weight"
|
|
|
+ placeholder="请输入"
|
|
|
+ @input="inputAllweight(row, $index)"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ <template v-slot:unitPrice="{ row, $index }">
|
|
|
+ <template v-if="row.isSave">
|
|
|
+ {{ row.unitPrice ? row.unitPrice + '/元' : '' }}
|
|
|
+ </template>
|
|
|
+ <el-form-item v-else>
|
|
|
<el-input
|
|
|
- v-else
|
|
|
- :ref="'purpose' + $index"
|
|
|
+ type="number"
|
|
|
+ :ref="'unitPrice' + $index"
|
|
|
@keyup.native="
|
|
|
- moveFocus($event, $index, 'purpose', '产品', row)
|
|
|
+ moveFocus($event, $index, 'unitPrice', '产品', row)
|
|
|
+ "
|
|
|
+ v-model.number="row.unitPrice"
|
|
|
+ placeholder="非必填"
|
|
|
+ @input="
|
|
|
+ (value) =>
|
|
|
+ (row.unitPrice = value.replace(/[^0-9.]+/g, ''))
|
|
|
"
|
|
|
- v-model="row.purpose"
|
|
|
>
|
|
|
+ <template slot="append">
|
|
|
+ 元/{{ row.measureUnit }}
|
|
|
+ </template>
|
|
|
</el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ <template v-slot:totalMoney="{ row, $index }">
|
|
|
+ {{
|
|
|
+ changeCount(
|
|
|
+ calcSumTotal(row.measureQuantity, row.unitPrice, row)
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ </template>
|
|
|
+ <template v-slot:supplierId="{ row, $index }">
|
|
|
+ <template v-if="row.isSave">
|
|
|
+ {{ row.supplierName }}
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- label="生产日期"
|
|
|
- prop="detailProductionDate"
|
|
|
- width="220"
|
|
|
- >
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- <template v-if="row.isSave">
|
|
|
- {{ row.detailProductionDate }}
|
|
|
- </template>
|
|
|
- <el-date-picker
|
|
|
- v-else
|
|
|
- :disabled="row.isPack"
|
|
|
- size="small"
|
|
|
- v-model="row.detailProductionDate"
|
|
|
- type="datetime"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- placeholder="选择日期"
|
|
|
- >
|
|
|
- </el-date-picker
|
|
|
- ></template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- label="采购日期"
|
|
|
- prop="detailPurchaseDate"
|
|
|
- width="220"
|
|
|
- >
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- <template v-if="row.isSave">
|
|
|
- {{ row.detailPurchaseDate }}
|
|
|
- </template>
|
|
|
- <el-date-picker
|
|
|
- v-else
|
|
|
- :disabled="row.isPack"
|
|
|
- size="small"
|
|
|
- v-model="row.detailPurchaseDate"
|
|
|
- type="datetime"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- placeholder="选择日期"
|
|
|
- >
|
|
|
- </el-date-picker
|
|
|
- ></template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- label="失效日期"
|
|
|
- prop="detailExpireDate"
|
|
|
- width="220"
|
|
|
- >
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- <template v-if="row.isSave">
|
|
|
- {{ row.detailExpireDate }}
|
|
|
- </template>
|
|
|
- <el-date-picker
|
|
|
- v-else
|
|
|
- :disabled="row.isPack"
|
|
|
- size="small"
|
|
|
- v-model="row.detailExpireDate"
|
|
|
- type="datetime"
|
|
|
- value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
- placeholder="选择日期"
|
|
|
- >
|
|
|
- </el-date-picker
|
|
|
- ></template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="操作"
|
|
|
- width="200"
|
|
|
- fixed="right"
|
|
|
- align="center"
|
|
|
- >
|
|
|
- <template slot="header" slot-scope="scope"> 操作 </template>
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- v-show="!row.isSave"
|
|
|
- @click="listSave(row, $index)"
|
|
|
- >保存</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- v-show="row.isSave"
|
|
|
- @click="listEdit(row, $index)"
|
|
|
- >编辑</el-button
|
|
|
+ <el-select
|
|
|
+ v-else
|
|
|
+ @change="selectSupplier($event, row)"
|
|
|
+ v-model="row.supplierId"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in row.supplierListOptions"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ :key="item.id"
|
|
|
>
|
|
|
- <el-button type="text" @click="listDel(row, $index)"
|
|
|
- >删除</el-button
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ <template v-slot:warehouseName="{ row, $index }">
|
|
|
+ <el-form-item
|
|
|
+ :prop="`productList.${$index}.warehouseId`"
|
|
|
+ required
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ :class="
|
|
|
+ row.warehouseName
|
|
|
+ ? 'wareHouse_style'
|
|
|
+ : 'wareHouse_style red_color'
|
|
|
+ "
|
|
|
+ @click="handleWareHouse(row, $index)"
|
|
|
>
|
|
|
+ <span>
|
|
|
+ {{ row.warehouseName ? row.warehouseName : '请选择仓库' }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </template>
|
|
|
+ <template v-slot:purpose="{ row, $index }">
|
|
|
+ <template v-if="row.isSave">
|
|
|
+ {{ row.purpose }}
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <el-input
|
|
|
+ v-else
|
|
|
+ :ref="'purpose' + $index"
|
|
|
+ @keyup.native="
|
|
|
+ moveFocus($event, $index, 'purpose', '产品', row)
|
|
|
+ "
|
|
|
+ v-model="row.purpose"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ <template v-slot:detailProductionDate="{ row, $index }">
|
|
|
+ <template v-if="row.isSave">
|
|
|
+ {{ row.detailProductionDate }}
|
|
|
+ </template>
|
|
|
+ <el-date-picker
|
|
|
+ v-else
|
|
|
+ :disabled="row.isPack"
|
|
|
+ size="small"
|
|
|
+ v-model="row.detailProductionDate"
|
|
|
+ type="datetime"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ placeholder="选择日期"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </template>
|
|
|
+ <template v-slot:detailPurchaseDate="{ row, $index }">
|
|
|
+ <template v-if="row.isSave">
|
|
|
+ {{ row.detailPurchaseDate }}
|
|
|
+ </template>
|
|
|
+ <el-date-picker
|
|
|
+ v-else
|
|
|
+ :disabled="row.isPack"
|
|
|
+ size="small"
|
|
|
+ v-model="row.detailPurchaseDate"
|
|
|
+ type="datetime"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ placeholder="选择日期"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </template>
|
|
|
+ <template v-slot:detailExpireDate="{ row, $index }">
|
|
|
+ <template v-if="row.isSave">
|
|
|
+ {{ row.detailExpireDate }}
|
|
|
+ </template>
|
|
|
+ <el-date-picker
|
|
|
+ v-else
|
|
|
+ :disabled="row.isPack"
|
|
|
+ size="small"
|
|
|
+ v-model="row.detailExpireDate"
|
|
|
+ type="datetime"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ placeholder="选择日期"
|
|
|
+ >
|
|
|
+ </el-date-picker>
|
|
|
+ </template>
|
|
|
+ <template v-slot:action="{ row, $index }">
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ v-show="!row.isSave"
|
|
|
+ @click="listSave(row, $index)"
|
|
|
+ >保存</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ v-show="row.isSave"
|
|
|
+ @click="listEdit(row, $index)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
+ <el-button type="text" @click="listDel(row, $index)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -1138,8 +923,10 @@
|
|
|
import BigNumber from 'bignumber.js';
|
|
|
import { isBoolean } from 'mathjs';
|
|
|
import { parameterGetByCode } from '@/api/sys/index.js';
|
|
|
+ import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
|
|
|
export default {
|
|
|
+ mixins: [tabMixins],
|
|
|
name: 'stockManagementAdd',
|
|
|
components: {
|
|
|
selectType,
|
|
|
@@ -1161,6 +948,7 @@
|
|
|
visibleDialog: false,
|
|
|
title: '选择产品',
|
|
|
goodsLists: [],
|
|
|
+ cacheKeyUrl: 'wms-stockManagement-add-goods',
|
|
|
formData: {
|
|
|
bizType: '',
|
|
|
storageTime: '',
|
|
|
@@ -1204,6 +992,230 @@
|
|
|
...mapGetters(['dict', 'getDict']),
|
|
|
clientEnvironmentId() {
|
|
|
return this.$store.state.user.info.clientEnvironmentId;
|
|
|
+ },
|
|
|
+ columns() {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ label: '序号',
|
|
|
+ type: 'index',
|
|
|
+ width: 50,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '产品编码',
|
|
|
+ prop: 'categoryCode',
|
|
|
+ width: 130,
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ label: '产品名称',
|
|
|
+ prop: 'categoryName',
|
|
|
+ width: 200,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ label: '型号',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ prop: 'categoryModel',
|
|
|
+ width: 100,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '规格',
|
|
|
+ prop: 'specification',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 100,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '牌号',
|
|
|
+ prop: 'brandNum',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 100,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ ...this.newColumns.map((item) => {
|
|
|
+ return {
|
|
|
+ label: item.label,
|
|
|
+ prop: item.prop,
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 100,
|
|
|
+ align: 'center'
|
|
|
+ };
|
|
|
+ }),
|
|
|
+ {
|
|
|
+ label: '批次号',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ prop: 'batchNo',
|
|
|
+ width: 200,
|
|
|
+ slot: 'batchNo',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '数量',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ prop: 'packingQuantity',
|
|
|
+ slot: 'packingQuantity',
|
|
|
+ width: 180,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '单位',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ prop: 'packingUnit',
|
|
|
+ slot: 'packingUnit',
|
|
|
+ width: 100,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '包装规格',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ prop: 'packingSpecificationLabel',
|
|
|
+ slot: 'packingSpecificationLabel',
|
|
|
+ width: 300,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '允许拆包',
|
|
|
+ prop: 'isUnpack',
|
|
|
+ width: 80,
|
|
|
+ formatter: (_row, _column, cellValue) => {
|
|
|
+ return cellValue ? '是' : '否';
|
|
|
+ },
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '计量数量',
|
|
|
+ prop: 'measureQuantity',
|
|
|
+ width: 100,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '计量单位',
|
|
|
+ prop: 'measureUnit',
|
|
|
+ width: 100,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '单重',
|
|
|
+ prop: 'singleWeight',
|
|
|
+ slot: 'singleWeight',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 180,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '总重',
|
|
|
+ prop: 'weight',
|
|
|
+ slot: 'weight',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 150,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '重量单位',
|
|
|
+ prop: 'weightUnit',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 100,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ this.isPrice == 1
|
|
|
+ ? {
|
|
|
+ label: '单价',
|
|
|
+ slot: 'price',
|
|
|
+ prop: 'price',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 150,
|
|
|
+ align: 'center'
|
|
|
+ }
|
|
|
+ : {
|
|
|
+ label: '单价',
|
|
|
+ prop: 'price',
|
|
|
+ width: 1
|
|
|
+ },
|
|
|
+ this.isPrice == 1
|
|
|
+ ? {
|
|
|
+ label: '金额',
|
|
|
+ slot: 'totalMoney',
|
|
|
+ prop: 'totalMoney',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 100,
|
|
|
+ align: 'center'
|
|
|
+ }
|
|
|
+ : {
|
|
|
+ label: '金额',
|
|
|
+ prop: 'totalMoney',
|
|
|
+ width: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '供应商',
|
|
|
+ slot: 'supplierId',
|
|
|
+ prop: 'supplierId',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 200,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '供应商代号',
|
|
|
+ slot: 'supplierCode',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 100,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '仓库',
|
|
|
+ prop: 'warehouseName',
|
|
|
+ slot: 'warehouseName',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 300,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '采购原因',
|
|
|
+ prop: 'purpose',
|
|
|
+ slot: 'purpose',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 200,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '生产日期',
|
|
|
+ prop: 'detailProductionDate',
|
|
|
+ slot: 'detailProductionDate',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 220,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '采购日期',
|
|
|
+ prop: 'detailPurchaseDate',
|
|
|
+ slot: 'detailPurchaseDate',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 220,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '失效日期',
|
|
|
+ prop: 'detailExpireDate',
|
|
|
+ slot: 'detailExpireDate',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ width: 220,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 250,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ slot: 'action',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'right'
|
|
|
+ }
|
|
|
+ ];
|
|
|
}
|
|
|
},
|
|
|
watch: {
|