|
@@ -10,6 +10,26 @@
|
|
|
highlight-current-row
|
|
|
@get-list="getList"
|
|
|
>
|
|
|
+ <template #productType="{ item }">
|
|
|
+ <div>
|
|
|
+ <div v-if="item.productDefinition == 1">
|
|
|
+ {{ dictValueLabel(item.productType, productType) }}
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ {{ dictValueLabel(item.productType, materialType) }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #unit="{ item }">
|
|
|
+ <div>
|
|
|
+ <div v-if="item.productDefinition == 1">
|
|
|
+ {{ dictValueLabel(item.productUnit, productUnit) }}
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ {{ dictValueLabel(item.productUnit, materialUnit) }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</byTable>
|
|
|
</div>
|
|
|
|
|
@@ -43,11 +63,15 @@ import { computed, ref } from "vue";
|
|
|
import byTable from "@/components/byTable/index";
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
+import useUserStore from "@/store/modules/user";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const warehouseList = ref([]);
|
|
|
const productType = ref([]);
|
|
|
const productUnit = ref([]);
|
|
|
+const materialType = ref([]);
|
|
|
+const materialUnit = ref([]);
|
|
|
+
|
|
|
const status = ref([
|
|
|
{
|
|
|
label: "待出库",
|
|
@@ -143,12 +167,12 @@ const config = computed(() => {
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "物品类型",
|
|
|
- prop: "productType",
|
|
|
+ slot: "productType",
|
|
|
width: 120,
|
|
|
},
|
|
|
- render(type) {
|
|
|
- return proxy.dictValueLabel(type, productType.value);
|
|
|
- },
|
|
|
+ // render(type) {
|
|
|
+ // return proxy.dictValueLabel(type, productType.value);
|
|
|
+ // },
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
@@ -174,11 +198,8 @@ const config = computed(() => {
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "单位",
|
|
|
- prop: "productUnit",
|
|
|
- width: 120,
|
|
|
- },
|
|
|
- render(unit) {
|
|
|
- return proxy.dictValueLabel(unit, productUnit.value);
|
|
|
+ width: 100,
|
|
|
+ slot: "unit",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -235,16 +256,27 @@ const getDict = () => {
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- proxy.getDictOne(["product_type", "unit"]).then((res) => {
|
|
|
- productType.value = res["product_type"].map((x) => ({
|
|
|
- label: x.dictValue,
|
|
|
- value: x.dictKey,
|
|
|
- }));
|
|
|
- productUnit.value = res["unit"].map((x) => ({
|
|
|
- label: x.dictValue,
|
|
|
- value: x.dictKey,
|
|
|
- }));
|
|
|
- });
|
|
|
+ proxy
|
|
|
+ .getDictOne(["product_type", "unit", "material_type", "material_unit"])
|
|
|
+ .then((res) => {
|
|
|
+ productType.value = res["product_type"].map((x) => ({
|
|
|
+ label: x.dictValue,
|
|
|
+ value: x.dictKey,
|
|
|
+ }));
|
|
|
+ productUnit.value = res["unit"].map((x) => ({
|
|
|
+ label: x.dictValue,
|
|
|
+ value: x.dictKey,
|
|
|
+ }));
|
|
|
+
|
|
|
+ materialType.value = res["material_type"].map((x) => ({
|
|
|
+ label: x.dictValue,
|
|
|
+ value: x.dictKey,
|
|
|
+ }));
|
|
|
+ materialUnit.value = res["material_unit"].map((x) => ({
|
|
|
+ label: x.dictValue,
|
|
|
+ value: x.dictKey,
|
|
|
+ }));
|
|
|
+ });
|
|
|
};
|
|
|
const getList = async (req) => {
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
@@ -327,6 +359,18 @@ const formConfig = computed(() => {
|
|
|
min: 1,
|
|
|
controls: false,
|
|
|
},
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "exWarehousePerson",
|
|
|
+ label: "出库人",
|
|
|
+ itemWidth: 50,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "receivingPerson",
|
|
|
+ label: "接收人",
|
|
|
+ itemWidth: 50,
|
|
|
+ },
|
|
|
];
|
|
|
});
|
|
|
const rules = ref({
|
|
@@ -334,6 +378,12 @@ const rules = ref({
|
|
|
warehousingQuantity: [
|
|
|
{ required: true, message: "请输入出库数量", trigger: "blur" },
|
|
|
],
|
|
|
+ exWarehousePerson: [
|
|
|
+ { required: true, message: "请输入出库人", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ receivingPerson: [
|
|
|
+ { required: true, message: "请输入接收人", trigger: "blur" },
|
|
|
+ ],
|
|
|
});
|
|
|
const submitForm = () => {
|
|
|
submit.value.handleSubmit(() => {
|
|
@@ -349,6 +399,8 @@ const submitForm = () => {
|
|
|
id: formData.data.id,
|
|
|
warehouseId: formData.data.warehouseId,
|
|
|
quantity: formData.data.warehousingQuantity,
|
|
|
+ exWarehousePerson: formData.data.exWarehousePerson,
|
|
|
+ receivingPerson: formData.data.receivingPerson,
|
|
|
})
|
|
|
.then(
|
|
|
() => {
|
|
@@ -368,6 +420,7 @@ const submitForm = () => {
|
|
|
};
|
|
|
const clickOperation = (row) => {
|
|
|
formData.data = row;
|
|
|
+ formData.data.exWarehousePerson = useUserStore().user.nickName;
|
|
|
loadingDialog.value = false;
|
|
|
dialogVisible.value = true;
|
|
|
};
|