Просмотр исходного кода

Merge branch 'master' of http://36.137.93.232:3000/hf/byte-sailing-new

cz 2 лет назад
Родитель
Сommit
48a4940a61

+ 6 - 4
src/components/byTable/index.vue

@@ -28,7 +28,7 @@
           style="margin-right: 10px"
         >
           <div class="by-dropdown-title">
-            {{ i.label
+            {{ i.label || i.labelCopy
             }}<i
               style="margin-left: 5px"
               class="iconfont icon-iconm_xialan1"
@@ -38,6 +38,7 @@
             <li
               @click="searchItemSelct('all', i,index)"
               v-if="i.isShowAll === false ? i.isShowAll : true"
+              style="display: flex; align-items: center; justify-content: center;"
             >
               全部
             </li>
@@ -45,6 +46,7 @@
               v-for="j in i.data"
               :key="j.value"
               @click="searchItemSelct(j, i)"
+              style="display: flex; align-items: center; justify-content: center;"
             >
               {{ j.label }}
             </li>
@@ -268,7 +270,7 @@ export default defineComponent({
     const keywrod = ref("");
     const selectConfigCopy = computed(() => {
       return props.selectConfig.map((item) => {
-        item.labelCopy = item.label;
+        if(!item.labelCopy) item.labelCopy = {...item}.label;
         return item;
       });
     });
@@ -385,7 +387,7 @@ export default defineComponent({
 
     const searchItemSelct = (item, i,index) => {
       if (item == "all") {
-        i.label = props.selectConfig[index].labelCopy
+        i.label = {...props.selectConfig[index]}.labelCopy
         proxy.$emit(
           "getList",
           Object.assign(props.filterParams, { [i.prop]: "" })
@@ -548,7 +550,7 @@ export default defineComponent({
     }
   }
 }
-::v-deep(.by-dropdown-lists){
+.by-dropdown-lists {
   max-height: 50vh;
   overflow-y: auto;
   line-height: 1

+ 288 - 0
src/views/purchaseManage/purchaseManage/handoverSlip/index.vue

@@ -0,0 +1,288 @@
+<template>
+  <div class="tenant">
+    <byTable
+      :source="sourceList.data"
+      :pagination="sourceList.pagination"
+      :config="config"
+      :loading="loading"
+      highlight-current-row
+      :table-events="{
+        select: selectRow,
+        'select-all': selectRow,
+      }"
+      :action-list="[
+        {
+          text: '转生产',
+          disabled: selectData.length === 0,
+          action: () => transferToProduction(),
+        },
+        {
+          text: '采购',
+          disabled: selectData.length === 0,
+          action: () => start(),
+        },
+      ]"
+      @get-list="getList">
+    </byTable>
+
+    <el-dialog title="转生产" v-if="dialogVisible" v-model="dialogVisible" width="1200" v-loading="loadingDialog">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
+        <template #details>
+          <div style="width: 100%">
+            <el-table :data="formData.data.list" style="width: 100%; margin-top: 16px">
+              <el-table-column prop="productCode" label="物品编码" width="140" />
+              <el-table-column prop="productName" label="物品名称" min-width="220" />
+              <el-table-column prop="productUnit" label="单位" width="100" />
+              <el-table-column prop="productUnit" label="待处理数量" width="120" />
+              <el-table-column label="转生产数量" width="160">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'list.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
+                      <el-input-number v-model="row.quantity" placeholder="请输入数量" style="width: 100%" :precision="0" :controls="false" :min="0" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="完工期限" width="160">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'list.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
+                      <el-date-picker v-model="row.quantity" type="date" placeholder="请选择完工期限" value-format="YYYY-MM-DD" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column align="center" label="操作" width="80" fixed="right">
+                <template #default="{ row, $index }">
+                  <el-button type="primary" link @click="handleDelete($index)">删除</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import { computed, ref } from "vue";
+import { ElMessage } from "element-plus";
+
+const { proxy } = getCurrentInstance();
+const loading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+    status: "15",
+  },
+});
+const config = computed(() => {
+  return [
+    {
+      type: "selection",
+    },
+    {
+      attrs: {
+        label: "外销合同编号",
+        prop: "subscribeCode",
+      },
+    },
+    {
+      attrs: {
+        label: "合同到账时间",
+        prop: "subscribeCode",
+      },
+    },
+    {
+      attrs: {
+        label: "业务员",
+        prop: "subscribeCode",
+      },
+    },
+    {
+      attrs: {
+        label: "版本号",
+        prop: "subscribeCode",
+      },
+    },
+    {
+      attrs: {
+        label: "产品编码",
+        prop: "productCode",
+      },
+    },
+    {
+      attrs: {
+        label: "产品名称",
+        prop: "productName",
+      },
+    },
+    {
+      attrs: {
+        label: "单位",
+        prop: "productUnit",
+      },
+    },
+    {
+      attrs: {
+        label: "待处理数量",
+        prop: "count",
+      },
+    },
+    {
+      attrs: {
+        label: "详情",
+        prop: "count",
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "140",
+        align: "center",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "采购",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              selectData.value = [row];
+              start();
+            },
+          },
+          {
+            attrs: {
+              label: "转生产",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              transferToProduction(row);
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/subscribeDetail/page", sourceList.value.pagination).then((message) => {
+    console.log(message);
+    sourceList.value.data = message.rows;
+    sourceList.value.pagination.total = message.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getList();
+const selectData = ref([]);
+const selectRow = (data) => {
+  selectData.value = data;
+};
+const start = () => {
+  if (selectData.value.length > 0) {
+    let ids = selectData.value.map((x) => x.id).join();
+    proxy.$router.replace({
+      path: "/platform_manage/process/processApproval",
+      query: {
+        flowKey: "purchase_flow",
+        ids,
+      },
+    });
+  } else {
+    return ElMessage({
+      message: "请勾选数据!",
+      type: "info",
+    });
+  }
+};
+const dialogVisible = ref(false);
+const loadingDialog = ref(false);
+const submit = ref(null);
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const formData = reactive({
+  data: {},
+});
+const formConfig = computed(() => {
+  return [
+    {
+      label: "基本信息",
+    },
+    {
+      type: "select",
+      prop: "warehouseId",
+      label: "工单类型",
+      data: [],
+    },
+    {
+      type: "input",
+      prop: "remark",
+      label: "备注",
+      itemType: "textarea",
+    },
+    {
+      type: "slot",
+      slotName: "details",
+      label: "产品明细",
+    },
+  ];
+});
+const rules = ref({
+  warehouseId: [{ required: true, message: "请选择仓库", trigger: "change" }],
+});
+const transferToProduction = (row) => {
+  console.log(selectData.value, row);
+};
+const submitForm = () => {
+  submit.value.handleSubmit(() => {
+    loadingDialog.value = true;
+    proxy.post("/stock/stockTransfer", formData.data).then(
+      () => {
+        ElMessage({
+          message: "提交成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        loadingDialog.value = false;
+      }
+    );
+  });
+};
+const handleDelete = (index) => {
+  formData.data.list.splice(index, 1);
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  margin: 20px;
+}
+</style>

+ 65 - 3
src/views/purchaseSales/outAndInWarehouse/record/index.vue

@@ -26,6 +26,28 @@ import byTable from "@/components/byTable/index";
 
 const { proxy } = getCurrentInstance();
 const route = useRoute();
+const opTypeList = ref([
+  {
+    label: "入库",
+    value: "1",
+  },
+  {
+    label: "出库",
+    value: "2",
+  },
+  {
+    label: "调仓",
+    value: "3",
+  },
+  {
+    label: "入库",
+    value: "4",
+  },
+  {
+    label: "出库",
+    value: "5",
+  },
+]);
 const typeList = ref([
   {
     label: "手动入库",
@@ -36,7 +58,7 @@ const typeList = ref([
     value: "2",
   },
   {
-    label: "调仓",
+    label: "调仓入库",
     value: "3",
   },
   {
@@ -47,6 +69,46 @@ const typeList = ref([
     label: "待出库出库",
     value: "5",
   },
+  {
+    label: "组合入库",
+    value: "6",
+  },
+  {
+    label: "组合出库",
+    value: "7",
+  },
+  {
+    label: "组合拆分入库",
+    value: "8",
+  },
+  {
+    label: "组合拆分出库",
+    value: "9",
+  },
+  {
+    label: "京东销售出库",
+    value: "10",
+  },
+  {
+    label: "调仓出库",
+    value: "11",
+  },
+  {
+    label: "销售订单出库",
+    value: "12",
+  },
+  {
+    label: "退货出库",
+    value: "13",
+  },
+  {
+    label: "到货入库",
+    value: "14",
+  },
+  {
+    label: "京东退货入库",
+    value: "15",
+  },
 ]);
 const warehouseList = ref([]);
 const sourceList = ref({
@@ -75,11 +137,11 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作类型",
-        prop: "type",
+        prop: "opType",
         width: 140,
       },
       render(type) {
-        return proxy.dictValueLabel(type, typeList.value);
+        return proxy.dictValueLabel(type, opTypeList.value);
       },
     },
     {

+ 306 - 0
src/views/salesMange/shipmentMange/document/index.vue

@@ -0,0 +1,306 @@
+<template>
+  <div class="tenant">
+    <div class="content">
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :action-list="[
+          {
+            text: '新增调仓',
+            action: () => openModal(),
+          },
+        ]"
+        @get-list="getList">
+      </byTable>
+    </div>
+
+    <el-dialog title="新增调仓" v-if="dialogVisible" v-model="dialogVisible" width="1000" v-loading="loadingDialog">
+      <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
+        <template #details>
+          <div style="width: 100%">
+            <el-table :data="formData.data.documentsProductList" style="width: 100%; margin-top: 16px">
+              <el-table-column label="货物描述" min-width="240">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'documentsProductList.' + $index + '.describe'" :rules="rules.describe" :inline-message="true">
+                      <el-input v-model="row.describe" placeholder="请输入货物描述" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="副描述" min-width="200">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'documentsProductList.' + $index + '.subDescribe'" :rules="rules.subDescribe" :inline-message="true">
+                      <el-input v-model="row.subDescribe" placeholder="请输入副描述" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="海关编码" width="160">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'documentsProductList.' + $index + '.customsCode'" :rules="rules.customsCode" :inline-message="true">
+                      <el-input v-model="row.customsCode" placeholder="请输入海关编码" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="数量" width="160">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'documentsProductList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true">
+                      <el-input-number v-model="row.quantity" placeholder="请输入数量" style="width: 100%" :precision="0" :controls="false" :min="0" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+              <el-table-column label="单价" width="160">
+                <template #default="{ row, $index }">
+                  <div style="width: 100%">
+                    <el-form-item :prop="'documentsProductList.' + $index + '.price'" :rules="rules.price" :inline-message="true">
+                      <el-input-number v-model="row.price" placeholder="请输入单价" style="width: 100%" :precision="2" :controls="false" :min="0" />
+                    </el-form-item>
+                  </div>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+        </template>
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup>
+import { computed, ref } from "vue";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import { ElMessage, ElMessageBox } from "element-plus";
+
+const { proxy } = getCurrentInstance();
+const shipmentList = ref([]);
+const countryData = ref([]);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 0,
+    pageNum: 1,
+    pageSize: 10,
+    keyword: "",
+    warehouseId: "",
+    toWarehouseId: "",
+    type: "3",
+  },
+});
+const loading = ref(false);
+const config = computed(() => {
+  return [
+    {
+      attrs: {
+        label: "归属公司",
+        prop: "sellCorporationName",
+        "min-width": 260,
+      },
+    },
+    {
+      attrs: {
+        label: "客户名称",
+        prop: "buyCorporationName",
+        "min-width": 200,
+      },
+    },
+    {
+      attrs: {
+        label: "主合同编号",
+        prop: "code",
+        "min-width": 200,
+      },
+    },
+    {
+      attrs: {
+        label: "货运详情",
+        prop: "acceptCode",
+        "min-width": 200,
+      },
+    },
+    {
+      attrs: {
+        label: "查看单证",
+        prop: "createTime",
+        "min-width": 200,
+      },
+    },
+    {
+      attrs: {
+        label: "创建时间",
+        prop: "createTime",
+        width: 160,
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "80",
+        align: "center",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "删除",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              ElMessageBox.confirm("此操作将永久删除该数据, 是否继续?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+              }).then(() => {
+                proxy
+                  .post("/documents/delete", {
+                    id: row.id,
+                  })
+                  .then(() => {
+                    ElMessage({
+                      message: "删除成功",
+                      type: "success",
+                    });
+                    getList();
+                  });
+              });
+            },
+          },
+        ];
+      },
+    },
+  ];
+});
+const getDict = () => {
+  proxy.post("/packDetail/page", { pageNum: 1, pageSize: 999, shipmentStatus: 1 }).then((res) => {
+    if (res.rows && res.rows.length > 0) {
+      shipmentList.value = res.rows.map((item) => {
+        return {
+          label: item.contract,
+          value: item.id,
+        };
+      });
+    }
+  });
+  proxy.post("/areaInfo/list", { parentId: "0" }).then((res) => {
+    countryData.value = res;
+  });
+};
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post("/documents/page", sourceList.value.pagination).then((res) => {
+    sourceList.value.data = res.rows;
+    sourceList.value.pagination.total = res.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+getDict();
+getList();
+const dialogVisible = ref(false);
+const loadingDialog = ref(false);
+const submit = ref(null);
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+const formData = reactive({
+  data: {
+    documentsProductList: [],
+  },
+});
+const formConfig = computed(() => {
+  return [
+    {
+      type: "select",
+      prop: "contractId",
+      label: "出货主合同",
+      required: true,
+      data: shipmentList.value,
+    },
+    {
+      type: "slot",
+      slotName: "details",
+      label: "产品信息",
+    },
+    {
+      label: "唛头信息",
+    },
+    {
+      type: "select",
+      prop: "countryId",
+      label: "目的国",
+      required: true,
+      data: countryData.value,
+    },
+    {
+      type: "input",
+      prop: "remark",
+      label: "唛头明细",
+      itemType: "textarea",
+    },
+  ];
+});
+const rules = ref({
+  contractId: [{ required: true, message: "请选择出货主合同", trigger: "change" }],
+  countryId: [{ required: true, message: "请选择目的国", trigger: "change" }],
+  describe: [{ required: true, message: "请输入货物描述", trigger: "blur" }],
+  subDescribe: [{ required: true, message: "请输入副描述", trigger: "blur" }],
+  customsCode: [{ required: true, message: "请输入海关编码", trigger: "blur" }],
+  quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
+  price: [{ required: true, message: "请输入单价", trigger: "blur" }],
+});
+const openModal = () => {
+  formData.data = {
+    documentsProductList: [],
+  };
+  loadingDialog.value = false;
+  dialogVisible.value = true;
+};
+const submitForm = () => {
+  submit.value.handleSubmit(() => {
+    loadingDialog.value = true;
+    proxy.post("/documents/add", formData.data).then(
+      () => {
+        ElMessage({
+          message: "提交成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        getList();
+      },
+      (err) => {
+        console.log(err);
+        loadingDialog.value = false;
+      }
+    );
+  });
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+::v-deep(.el-input-number .el-input__inner) {
+  text-align: left;
+}
+</style>