浏览代码

维多利亚扩展

cz 2 年之前
父节点
当前提交
53ff7406d8

+ 128 - 6
src/components/WDLY/process/SendPurchase.vue

@@ -31,7 +31,7 @@
         </el-col>
       </el-row>
       <el-row :gutter="10">
-        <el-col :span="8">
+        <el-col :span="6">
           <el-form-item label="供应商" prop="supplyId">
             <el-select
               v-model="formData.data.supplyId"
@@ -49,6 +49,35 @@
             </el-select>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="是否合同" prop="isAgreement">
+            <el-select
+              v-model="formData.data.isAgreement"
+              placeholder="请选择"
+              style="width: 100%"
+            >
+              <el-option label="是" value="1"> </el-option>
+              <el-option label="否" value="0"> </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="付款方式" prop="paymentMethod">
+            <el-select
+              v-model="formData.data.paymentMethod"
+              placeholder="请选择"
+              filterable
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in fundsPaymentMethod"
+                :label="item.dictValue"
+                :value="item.dictKey"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
       </el-row>
       <el-form-item label="采购说明" prop="purchaseContent">
         <el-input
@@ -125,7 +154,62 @@
           <el-table-column prop="amount" label="金额" />
           <el-table-column prop="zip" label="操作" width="100">
             <template #default="{ $index }">
-              <el-button type="primary" link @click="handleRemove($index)"
+              <el-button type="primary" link @click="handleRemove($index, 20)"
+                >删除</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
+      <div class="_t">其他费用</div>
+      <el-form-item>
+        <el-button type="primary" style="margin: 10px 0" @click="handleAdd">
+          添加
+        </el-button>
+        <el-table :data="formData.data.otherFeeList">
+          <el-table-column prop="name" label="费用名称" min-width="150">
+            <template #default="{ row, $index }">
+              <el-form-item
+                :prop="'otherFeeList.' + $index + '.name'"
+                :rules="rules.name"
+                :inline-message="true"
+              >
+                <el-input v-model="row.name" placeholder="请输入" />
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column prop="price" label="金额" min-width="150">
+            <template #default="{ row, $index }">
+              <el-form-item
+                :prop="'purchaseDetailList.' + $index + '.price'"
+                :rules="rules.price"
+                :inline-message="true"
+              >
+                <el-input-number
+                  v-model="row.price"
+                  :precision="4"
+                  :controls="false"
+                  :min="0"
+                  @change="handleChangeAmount"
+                />
+              </el-form-item>
+            </template>
+          </el-table-column>
+
+          <el-table-column prop="remark" label="备注" min-width="150">
+            <template #default="{ row, $index }">
+              <el-form-item
+                :prop="'otherFeeList.' + $index + '.remark'"
+                :rules="rules.remark"
+                :inline-message="true"
+              >
+                <el-input v-model="row.remark" placeholder="请输入" />
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column prop="zip" label="操作" width="100">
+            <template #default="{ $index }">
+              <el-button type="primary" link @click="handleRemove($index, 10)"
                 >删除</el-button
               >
             </template>
@@ -164,6 +248,7 @@ let formData = reactive({
   data: {
     purchaseTime: "",
     purchaseDetailList: [],
+    otherFeeList: [],
   },
 });
 let rules = ref({
@@ -176,14 +261,32 @@ let rules = ref({
   ],
   supplyId: [{ required: true, message: "请选择供应商", trigger: "change" }],
   count: [{ required: true, message: "请输入本次采购数量", trigger: "blur" }],
-  price: [{ required: true, message: "请输入单价", trigger: "blur" }],
+  price: [{ required: true, message: "请输入单价/金额", trigger: "blur" }],
   remark: [{ required: true, message: "请输入备注", trigger: "blur" }],
+  isAgreement: [
+    { required: true, message: "请选择是否合同", trigger: "change" },
+  ],
+  paymentMethod: [
+    { required: true, message: "请选择付款方式", trigger: "change" },
+  ],
 });
 
 let openProduct = ref(false);
+const handleAdd = () => {
+  formData.data.otherFeeList.push({
+    name: "",
+    price: 0,
+    remark: "",
+  });
+};
 // 物品相应逻辑
-const handleRemove = (index) => {
-  formData.data.purchaseDetailList.splice(index, 1);
+const handleRemove = (index, type) => {
+  if (type == 10) {
+    formData.data.otherFeeList.splice(index, 1);
+  } else if (type == 20) {
+    formData.data.purchaseDetailList.splice(index, 1);
+  }
+  handleChangeAmount();
   return ElMessage({
     message: "删除成功!",
     type: "success",
@@ -280,20 +383,35 @@ const getDetails = () => {
     formData.data.purchaseDetailList = res.map((x) => ({
       ...x,
       subscribeCount: x.count,
-      count: 0,
+      count: Number(x.count) - Number(x.purchaseCount),
       price: null,
       amount: null,
     }));
   });
 };
+// 获取用户信息并赋默认值
+const tenantId = "@福建宏星!#¥%……&*()";
+// const tenantId = userInfo.tenantId;
 // 获取供应商数据
 const supplierData = ref([]);
+const fundsPaymentMethod = ref([]);
 const getSupplierList = async (req) => {
   proxy
     .post("/supplierInfo/page", { pageNum: 1, pageSize: 9999 })
     .then((res) => {
       supplierData.value = res.rows;
     });
+
+  proxy
+    .post("/dictTenantData/page", {
+      pageNum: 1,
+      pageSize: 999,
+      tenantId: tenantId,
+      dictCode: "funds_payment_method",
+    })
+    .then((res) => {
+      fundsPaymentMethod.value = res.rows;
+    });
 };
 // 供应商改变逻辑
 const handleChangeSupplier = (val) => {
@@ -307,6 +425,10 @@ const handleChangeAmount = () => {
     e.amount = e.count * e.price;
     sum += e.amount;
   }
+  for (let i = 0; i < formData.data.otherFeeList.length; i++) {
+    const e = formData.data.otherFeeList[i];
+    sum += e.price;
+  }
   formData.data.amount = sum;
 };
 // 向父组件暴露

+ 60 - 35
src/components/WDLY/process/SendSubscribe.vue

@@ -16,15 +16,20 @@
           >
             添加物品
           </el-button>
-          <el-table :data="formData.data.salesReturnDetailList">
-            <el-table-column prop="productCode" label="货品编码" />
-            <el-table-column prop="productName" label="货品名称" />
+          <el-table :data="formData.data.subscribeDetailList">
+            <el-table-column
+              prop="goodType"
+              label="物品类型"
+              :formatter="(row) => (row.goodType == 1 ? '产品' : '物料')"
+            />
+            <el-table-column prop="productCode" label="物品编码" />
+            <el-table-column prop="productName" label="物品名称" />
             <el-table-column prop="productSpec" label="规格型号" />
             <el-table-column prop="productUnit" label="单位" />
-            <el-table-column prop="count" label="退货数量" min-width="150">
+            <el-table-column prop="count" label="申购数量" min-width="150">
               <template #default="{ row, $index }">
                 <el-form-item
-                  :prop="'salesReturnDetailList.' + $index + '.count'"
+                  :prop="'subscribeDetailList.' + $index + '.count'"
                   :rules="rules.count"
                   :inline-message="true"
                 >
@@ -37,10 +42,10 @@
                 </el-form-item>
               </template>
             </el-table-column>
-            <el-table-column prop="remark" label="退货原因" min-width="150">
+            <el-table-column prop="remark" label="备注" min-width="150">
               <template #default="{ row, $index }">
                 <el-form-item
-                  :prop="'salesReturnDetailList.' + $index + '.remark'"
+                  :prop="'subscribeDetailList.' + $index + '.remark'"
                   :rules="rules.remark"
                   :inline-message="true"
                 >
@@ -61,7 +66,7 @@
     </byForm>
     <el-dialog
       v-model="openProduct"
-      title="选择品"
+      title="选择品"
       width="70%"
       append-to-body
     >
@@ -82,15 +87,18 @@ const { proxy } = getCurrentInstance();
 
 let formData = reactive({
   data: {
-    supplyId: "",
-    salesReturnDetailList: [],
-    returnName: "",
+    subscribeDetailList: [],
   },
 });
 let rules = ref({
-  supplyId: [{ required: true, message: "请选择供应商", trigger: "change" }],
-  count: [{ required: true, message: "请输入退货数量", trigger: "blur" }],
-  remark: [{ required: true, message: "请输入退货原因", trigger: "blur" }],
+  receiptWarehouseId: [
+    { required: true, message: "请选择收获仓库", trigger: "change" },
+  ],
+  planArrivalTime: [
+    { required: true, message: "请选择要求到货时间", trigger: "change" },
+  ],
+  count: [{ required: true, message: "请输入申购数量", trigger: "blur" }],
+  remark: [{ required: true, message: "请输入申购备注", trigger: "blur" }],
 });
 const formOption = reactive({
   inline: true,
@@ -101,8 +109,8 @@ const formConfig = computed(() => {
   return [
     {
       type: "input",
-      prop: "returnDept",
-      label: "申部门",
+      prop: "deptName",
+      label: "申部门",
       itemWidth: 25,
       disabled: true,
       style: {
@@ -111,8 +119,8 @@ const formConfig = computed(() => {
     },
     {
       type: "input",
-      prop: "returnName",
-      label: "申人",
+      prop: "subcribeName",
+      label: "申人",
       itemWidth: 25,
       disabled: true,
       style: {
@@ -121,9 +129,9 @@ const formConfig = computed(() => {
     },
     {
       type: "date",
-      prop: "purchaseTime",
-      label: "申时间",
-      itemWidth: 25,
+      prop: "subcribeTime",
+      label: "申时间",
+      itemWidth: 26,
       disabled: true,
       style: {
         "margin-right": "10px",
@@ -131,10 +139,11 @@ const formConfig = computed(() => {
     },
     {
       type: "select",
-      prop: "supplyId",
-      label: "供应商",
+      prop: "receiptWarehouseId",
+      label: "收获仓库",
+      itemWidth: 25,
       isLoad: {
-        url: "/supplierInfo/page",
+        url: "/warehouse/page",
         req: {
           pageNum: 1,
           pageSize: 9999,
@@ -146,9 +155,25 @@ const formConfig = computed(() => {
       },
     },
     {
+      type: "date",
+      prop: "planArrivalTime",
+      label: "要求到货时间",
+      itemWidth: 25,
+      format: "YYYY-MM-DD",
+      style: {
+        "margin-left": "10px",
+      },
+    },
+    {
+      type: "input",
+      itemType: "textarea",
+      prop: "subcribeContent",
+      label: "申购说明",
+    },
+    {
       type: "slot",
       slotName: "details",
-      label: "退货明细",
+      label: "申购明细",
     },
   ];
 });
@@ -156,13 +181,13 @@ const formDom = ref(null);
 const handleSubmit = async () => {
   const vaild = await formDom.value.handleSubmit(() => {}); //拿到内部表单是否验证通过
   if (vaild) {
-    if (formData.data.salesReturnDetailList.length > 0) {
-      const list = formData.data.salesReturnDetailList;
+    if (formData.data.subscribeDetailList.length > 0) {
+      const list = formData.data.subscribeDetailList;
       for (let i = 0; i < list.length; i++) {
         const e = list[i];
         if (e.count == 0) {
           ElMessage({
-            message: "退货数量不能为0!",
+            message: "申购数量不能为0!",
             type: "info",
           });
           return false;
@@ -171,7 +196,7 @@ const handleSubmit = async () => {
       return true;
     }
     ElMessage({
-      message: "请添加退货明细!",
+      message: "请添加申购明细!",
       type: "info",
     });
     return false;
@@ -179,7 +204,7 @@ const handleSubmit = async () => {
 };
 let openProduct = ref(false);
 const handleRemove = (index) => {
-  formData.data.salesReturnDetailList.splice(index, 1);
+  formData.data.subscribeDetailList.splice(index, 1);
   return ElMessage({
     message: "删除成功!",
     type: "success",
@@ -196,8 +221,8 @@ const pushGoods = (goods) => {
     bussinessId: x.id,
     remark: "",
   }));
-  formData.data.salesReturnDetailList =
-    formData.data.salesReturnDetailList.concat(arr);
+  formData.data.subscribeDetailList =
+    formData.data.subscribeDetailList.concat(arr);
   return ElMessage({
     message: "添加成功!",
     type: "success",
@@ -212,9 +237,9 @@ const props = defineProps({
 // 获取用户信息并赋默认值
 const userInfo = useUserStore().user;
 onMounted(() => {
-  formData.data.purchaseTime = proxy.parseTime(new Date());
-  formData.data.returnDept = userInfo.dept.deptName;
-  formData.data.returnName = userInfo.nickName;
+  formData.data.subcribeTime = proxy.parseTime(new Date());
+  formData.data.deptName = userInfo.dept.deptName;
+  formData.data.subcribeName = userInfo.nickName;
 });
 // 向父组件暴露
 defineExpose({

+ 1 - 0
src/components/process/SendPurchase.vue

@@ -184,6 +184,7 @@ let openProduct = ref(false);
 // 物品相应逻辑
 const handleRemove = (index) => {
   formData.data.purchaseDetailList.splice(index, 1);
+  handleChangeAmount();
   return ElMessage({
     message: "删除成功!",
     type: "success",

+ 98 - 26
src/views/WDLY/outInBound/abnormal/index.vue

@@ -22,7 +22,7 @@
       </byTable>
     </div>
     <el-dialog
-      :title="modalType == 'add' ? '添加仓库' : '编辑'"
+      title="异常跟进"
       v-model="dialogVisible"
       width="800"
       v-loading="loading"
@@ -47,6 +47,25 @@
         </el-button>
       </template>
     </el-dialog>
+
+    <el-dialog title="跟进记录" v-model="dialogVisibleOne" width="500">
+      <div>
+        <el-timeline :reverse="false">
+          <el-timeline-item
+            placement="top"
+            v-for="(activity, index) in activities"
+            :key="index"
+            :timestamp="activity.handleTime"
+          >
+            <div>
+              跟进人:{{ activity.handleUserName }}
+              <span>({{ activity.status ? "已完成" : "处理中" }})</span>
+            </div>
+            <div style="margin-top: 5px">跟进记录: {{ activity.explain }}</div>
+          </el-timeline-item>
+        </el-timeline>
+      </div>
+    </el-dialog>
   </div>
 </template>
   
@@ -69,13 +88,22 @@ const sourceList = ref({
   },
 });
 let dialogVisible = ref(false);
+let dialogVisibleOne = ref(false);
+
 let roomDialogVisible = ref(false);
 let modalType = ref("add");
 let rules = ref({
-  type: [
-    { required: true, message: "请选择仓库类型", trigger: ["blur", "change"] },
+  status: [
+    { required: true, message: "请选择跟进结果", trigger: ["blur", "change"] },
+  ],
+  handleUser: [{ required: true, message: "请选择跟进人", trigger: "change" }],
+  handleTime: [
+    { required: true, message: "请选择跟进时间", trigger: "change" },
+  ],
+  processing: [
+    { required: true, message: "请选择处理方式", trigger: "change" },
   ],
-  name: [{ required: true, message: "请输入仓库名称", trigger: "blur" }],
+  explain: [{ required: true, message: "请输入处理说明", trigger: "blur" }],
 });
 const { proxy } = getCurrentInstance();
 const selectConfig = reactive([
@@ -166,7 +194,22 @@ const config = computed(() => {
               text: true,
             },
             el: "button",
-            click() {},
+            click() {
+              proxy
+                .post("/abnormalDetails/page", {
+                  abnormalInfoId: row.id,
+                })
+                .then((res) => {
+                  if (res.rows.length > 0) {
+                    activities.value = res.rows;
+                    dialogVisibleOne.value = true;
+                  } else
+                    return ElMessage({
+                      message: "暂无跟进记录!",
+                      type: "info",
+                    });
+                });
+            },
           },
         ];
       },
@@ -188,21 +231,35 @@ const byform = ref(null);
 const treeData = ref([]);
 const formConfig = reactive([
   {
-    type: "select",
-    prop: "type",
-    label: "仓库类型",
+    type: "radio",
+    prop: "status",
+    label: "跟进结果",
     required: true,
-    data: [],
+    border: true,
+    data: [
+      { label: "完成", value: "1" },
+      { label: "跟进中", value: "0" },
+    ],
   },
+
   {
-    type: "input",
-    prop: "name",
-    label: "仓库名称",
+    type: "select",
+    prop: "handleUser",
+    label: "跟进人",
+    isLoad: {
+      url: `/tenantUser/list?pageNum=1&pageSize=9999&tenantId=${
+        useUserStore().user.tenantId
+      }`,
+      labelKey: "nickName",
+      labelVal: "userId",
+      method: "get",
+      resUrl: "rows",
+    },
   },
   {
     type: "select",
-    prop: "keeperId",
-    label: "仓管员",
+    prop: "nextHandleUser",
+    label: "下一跟进人",
     isLoad: {
       url: `/tenantUser/list?pageNum=1&pageSize=9999&tenantId=${
         useUserStore().user.tenantId
@@ -214,10 +271,21 @@ const formConfig = reactive([
     },
   },
   {
+    type: "date",
+    itemType: "datetime",
+    prop: "handleTime",
+    label: "跟进时间",
+  },
+  {
+    type: "select",
+    prop: "processing",
+    label: "处理方式",
+  },
+  {
     type: "input",
     itemType: "textarea",
-    prop: "remark",
-    label: "备注",
+    prop: "explain",
+    label: "处理说明",
   },
 ]);
 const getList = async (req) => {
@@ -228,6 +296,7 @@ const getList = async (req) => {
     .then((message) => {
       console.log(message);
       sourceList.value.data = message.rows;
+      sourceList.value.data = [{}];
       sourceList.value.pagination.total = message.total;
       setTimeout(() => {
         loading.value = false;
@@ -239,12 +308,12 @@ const openModal = () => {
   modalType.value = "add";
   formData.data = {};
 };
-
+const activities = ref([]);
 const submitForm = () => {
   console.log(byform.value);
   byform.value.handleSubmit((valid) => {
     submitLoading.value = true;
-    proxy.post("/warehouse/" + modalType.value, formData.data).then(
+    proxy.post("/abnormalDetails/" + modalType.value, formData.data).then(
       (res) => {
         ElMessage({
           message: modalType.value == "add" ? "添加成功" : "编辑成功",
@@ -260,13 +329,16 @@ const submitForm = () => {
 };
 
 const getDtl = (row) => {
-  modalType.value = "edit";
-  proxy.post("/warehouse/detail", { id: row.id }).then((res) => {
-    res.type = res.type + "";
-    formData.data = res;
-    console.log(formData);
-    dialogVisible.value = true;
-  });
+  modalType.value = "add";
+  formData.data.status = "0";
+  dialogVisible.value = true;
+
+  // proxy.post("/warehouse/detail", { id: row.id }).then((res) => {
+  //   res.type = res.type + "";
+  //   formData.data = res;
+  //   console.log(formData);
+  //   dialogVisible.value = true;
+  // });
 };
 const warehouseType = ref([]);
 const getDict = () => {
@@ -291,7 +363,7 @@ const getDict = () => {
     });
 };
 getList();
-getDict();
+// getDict();
 </script>
   
 <style lang="scss" scoped>

+ 17 - 16
src/views/WDLY/process/processApproval/index.vue

@@ -12,16 +12,6 @@
           v-else-if="flowForm.flowKey == 'purchase_flow'"
           :queryData="queryData.data"
         ></SendPurchase>
-        <SendFunds
-          ref="makeDom"
-          v-else-if="flowForm.flowKey == '30'"
-          :queryData="queryData.data"
-        ></SendFunds>
-        <ReturnGood
-          ref="makeDom"
-          v-else-if="flowForm.flowKey == '40'"
-          :queryData="queryData.data"
-        ></ReturnGood>
       </div>
       <div class="bottom">
         <div class="commons-title title">处理意见</div>
@@ -100,13 +90,13 @@ import { useRouter, useRoute } from "vue-router";
 const router = useRouter();
 const route = useRoute();
 //申购发起
-import SendSubscribe from "@/components/process/SendSubscribe";
+import SendSubscribe from "@/components/WDLY/process/SendSubscribe";
 //采购发起
-import SendPurchase from "@/components/process/SendPurchase";
+import SendPurchase from "@/components/WDLY/process/SendPurchase";
 //请款发起
-import SendFunds from "@/components/process/SendFunds";
+import SendFunds from "@/components/WDLY/process/SendFunds";
 //退货
-import ReturnGood from "@/components/process/ReturnGood";
+import ReturnGood from "@/components/WDLY/process/ReturnGood";
 // 消息提示
 import { ElMessage, ElMessageBox } from "element-plus";
 // tab切换逻辑
@@ -163,6 +153,11 @@ const handleSubmit = async () => {
               count: x.count,
               remark: x.remark,
             }));
+            const victoriatouristJson = {
+              planArrivalTime: data.planArrivalTime,
+              receiptWarehouseId: data.receiptWarehouseId,
+            };
+            data.victoriatouristJson = JSON.stringify(victoriatouristJson);
           } else if (flowForm.flowKey == "purchase_flow") {
             data.purchaseDetailList = data.purchaseDetailList.map((x) => ({
               bussinessId: x.bussinessId,
@@ -171,6 +166,12 @@ const handleSubmit = async () => {
               price: x.price,
               amount: x.amount,
             }));
+            const victoriatouristJson = {
+              isAgreement: data.isAgreement,
+              paymentMethod: data.paymentMethod,
+              otherFeeList: data.otherFeeList,
+            };
+            data.victoriatouristJson = JSON.stringify(victoriatouristJson);
           } else if (flowForm.flowKey == "30") {
           } else if (flowForm.flowKey == "40") {
           }
@@ -197,11 +198,11 @@ const skipPage = () => {
   });
   if (flowForm.flowKey == "subscribe_flow") {
     router.replace({
-      path: "/purchaseManage/purchaseManage/subscribe",
+      path: "/WDLY/purchaseManage/subscribe_wdly",
     });
   } else if (flowForm.flowKey == "purchase_flow") {
     router.replace({
-      path: "/purchaseManage/purchaseManage/purchase",
+      path: "/WDLY/purchaseManage/purchase_wdly",
     });
   } else if (flowForm.flowKey == "30") {
     router.replace({

+ 19 - 9
src/views/WDLY/purchaseManage/alreadyPurchase/index.vue

@@ -12,12 +12,7 @@
         :table-events="{
           //element talbe事件都能传
         }"
-        :action-list="[
-          {
-            text: '新增采购',
-            action: () => start(),
-          },
-        ]"
+        :action-list="[]"
         @get-list="getList"
       >
         <template #fileSlot="{ item }">
@@ -216,7 +211,12 @@ const config = computed(() => {
         prop: "supplyName",
       },
     },
-
+    {
+      attrs: {
+        label: "收获仓库",
+        prop: "supplyName",
+      },
+    },
     {
       attrs: {
         label: "采购金额",
@@ -253,17 +253,27 @@ const config = computed(() => {
         prop: "payStatus",
       },
     },
-
     {
       attrs: {
         label: "操作",
-        width: "200",
+        width: "240",
         align: "right",
       },
       renderHTML(row) {
         return [
           {
             attrs: {
+              label: "发货通知",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              handleArrival(row);
+            },
+          },
+          {
+            attrs: {
               label: "到货通知",
               type: "primary",
               text: true,

+ 42 - 4
src/views/WDLY/purchaseManage/purchase/index.vue

@@ -181,6 +181,20 @@ const selectConfig = reactive([
       },
     ],
   },
+  // {
+  //   label: "收获仓库",
+  //   prop: "status",
+  //   data: [
+  //     {
+  //       label: "待采购",
+  //       value: "15",
+  //     },
+  //     {
+  //       label: "部分采购",
+  //       value: "30",
+  //     },
+  //   ],
+  // },
 ]);
 const config = computed(() => {
   return [
@@ -235,9 +249,30 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "申购状态",
+        label: "已采购数量",
+        prop: "purchaseCount",
+      },
+    },
+    {
+      attrs: {
+        label: "收获仓库",
+        prop: "receiptWarehouseName",
+      },
+    },
+    {
+      attrs: {
+        label: "要求到货时间",
+        prop: "planArrivalTime",
+      },
+    },
+    {
+      attrs: {
+        label: "采购状态",
         prop: "status",
       },
+      render(status) {
+        return status == 15 ? "待采购" : "部分采购";
+      },
     },
     {
       attrs: {
@@ -338,10 +373,13 @@ const getList = async (req) => {
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy
-    .post("/subscribeDetail/page", sourceList.value.pagination)
+    .post("/subscribeDetail/pageByWdly", sourceList.value.pagination)
     .then((message) => {
       console.log(message);
-      sourceList.value.data = message.rows;
+      sourceList.value.data = message.rows.map((x) => ({
+        ...x,
+        ...JSON.parse(x.victoriatouristJson),
+      }));
       sourceList.value.pagination.total = message.total;
       setTimeout(() => {
         loading.value = false;
@@ -443,7 +481,7 @@ const start = () => {
   if (selectData.value.length > 0) {
     let ids = selectData.value.map((x) => x.id).join();
     proxy.$router.replace({
-      path: "/platform_manage/process/processApproval",
+      path: "/WDLY/process/processApproval_wdly",
       query: {
         flowKey: "purchase_flow",
         ids,

+ 37 - 28
src/views/WDLY/purchaseManage/subscribe/index.vue

@@ -182,28 +182,7 @@ const selectConfig = reactive([
   {
     label: "状态",
     prop: "status",
-    data: [
-      {
-        label: "审批中",
-        value: "10",
-      },
-      {
-        label: "待采购",
-        value: "15",
-      },
-      {
-        label: "部分采购",
-        value: "30",
-      },
-      {
-        label: "已采购",
-        value: "20",
-      },
-      {
-        label: "已作废",
-        value: "99",
-      },
-    ],
+    data: [],
   },
 ]);
 const config = computed(() => {
@@ -277,6 +256,9 @@ const config = computed(() => {
         label: "状态",
         prop: "status",
       },
+      render(status) {
+        return statusData.value.find((x) => x.value == status).label;
+      },
     },
     {
       attrs: {
@@ -314,7 +296,7 @@ const config = computed(() => {
             click() {
               // 弹窗提示是否删除
               ElMessageBox.confirm(
-                "此操作将永久删除该数据, 是否继续?",
+                "此操作将永久作废该数据, 是否继续?",
                 "提示",
                 {
                   confirmButtonText: "确定",
@@ -324,12 +306,13 @@ const config = computed(() => {
               ).then(() => {
                 // 删除
                 proxy
-                  .post("/productionProcesses/delete", {
-                    id: row.id,
+                  .post("/subscribeDetail/edit", {
+                    ...row,
+                    status: 99,
                   })
                   .then((res) => {
                     ElMessage({
-                      message: "删除成功",
+                      message: "作废成功",
                       type: "success",
                     });
                     getList();
@@ -406,7 +389,10 @@ const getList = async (req) => {
     .post("/subscribeDetail/page", sourceList.value.pagination)
     .then((message) => {
       console.log(message);
-      sourceList.value.data = message.rows;
+      sourceList.value.data = message.rows.map((x) => ({
+        ...x,
+        ...JSON.parse(x.victoriatouristJson),
+      }));
       sourceList.value.pagination.total = message.total;
       setTimeout(() => {
         loading.value = false;
@@ -416,7 +402,7 @@ const getList = async (req) => {
 
 const openModal = () => {
   proxy.$router.replace({
-    path: "/platform_manage/process/processApproval",
+    path: "/WDLY/process/processApproval_wdly",
     query: {
       flowKey: "subscribe_flow",
     },
@@ -502,6 +488,29 @@ const handleRemove = (file) => {
 const handleClose = (index) => {
   fileList.value.splice(index, 1);
 };
+const statusData = ref([
+  {
+    label: "审批中",
+    value: "10",
+  },
+  {
+    label: "待采购",
+    value: "15",
+  },
+  {
+    label: "部分采购",
+    value: "30",
+  },
+  {
+    label: "已采购",
+    value: "20",
+  },
+  {
+    label: "已作废",
+    value: "99",
+  },
+]);
+selectConfig[1].data = statusData.value;
 getList();
 </script>
   

+ 288 - 0
src/views/WDLY/stockManage/query/index.vue

@@ -0,0 +1,288 @@
+<template>
+  <div class="tenant">
+    <!-- <Banner /> -->
+
+    <div style="background: #fff">
+      <el-tabs
+        v-model="activeName"
+        type="card"
+        class="demo-tabs"
+        @tab-change="handleChange"
+      >
+        <el-tab-pane label="按仓库" name="first"></el-tab-pane>
+        <el-tab-pane label="按产品" name="second"></el-tab-pane>
+      </el-tabs>
+      <byTable
+        :source="sourceList.data"
+        :pagination="sourceList.pagination"
+        :config="config"
+        :loading="loading"
+        highlight-current-row
+        :selectConfig="selectConfig"
+        :table-events="{
+          //element talbe事件都能传
+          select: select,
+        }"
+        :action-list="[]"
+        @get-list="getList"
+      >
+      </byTable>
+    </div>
+    <el-dialog
+      :title="modalType == 'add' ? '良品转次品' : '次品转良品'"
+      v-model="dialogVisible"
+      width="800"
+      v-loading="loading"
+    >
+      <byForm
+        :formConfig="formConfig"
+        :formOption="formOption"
+        v-model="formData.data"
+        :rules="rules"
+        ref="byform"
+      >
+      </byForm>
+      <template #footer>
+        <el-button @click="dialogVisible = false" size="large">取 消</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm('byform')"
+          size="large"
+          :loading="submitLoading"
+        >
+          确 定
+        </el-button>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+  
+<script setup>
+/* eslint-disable vue/no-unused-components */
+import { ElMessage, ElMessageBox } from "element-plus";
+import byTable from "@/components/byTable/index";
+import byForm from "@/components/byForm/index";
+import { computed, defineComponent, ref } from "vue";
+import useUserStore from "@/store/modules/user";
+import SelectProduct from "@/components/product/SelectProduct";
+
+const loading = ref(false);
+let activeName = ref("first");
+const submitLoading = ref(false);
+const sourceList = ref({
+  data: [],
+  pagination: {
+    total: 3,
+    pageNum: 1,
+    pageSize: 10,
+  },
+});
+let dialogVisible = ref(false);
+let openProduct = ref(false);
+
+let roomDialogVisible = ref(false);
+let modalType = ref("add");
+let rules = ref({
+  qualified: [{ required: true, message: "请输入数量", trigger: "blur" }],
+});
+const { proxy } = getCurrentInstance();
+const selectConfig = reactive([
+  // {
+  //   label: "spu类型",
+  //   prop: "type",
+  //   data: [],
+  // },
+]);
+
+const config = reactive([
+  {
+    attrs: {
+      label: "仓库名称",
+      prop: "warehouseName",
+    },
+  },
+  {
+    attrs: {
+      label: "产品编码",
+      prop: "code",
+    },
+  },
+  {
+    attrs: {
+      label: "产品名称",
+      prop: "productName",
+    },
+  },
+  {
+    attrs: {
+      label: "规格",
+      prop: "spec",
+    },
+  },
+  {
+    attrs: {
+      label: "单位",
+      prop: "unit",
+    },
+  },
+  {
+    attrs: {
+      label: "可用库存",
+      prop: "quantity",
+    },
+  },
+  {
+    attrs: {
+      label: "冻结库存",
+      prop: "frozenQuantity",
+    },
+  },
+  {
+    attrs: {
+      label: "次品",
+      prop: "defectiveQuantity",
+    },
+  },
+  {
+    attrs: {
+      label: "操作",
+      width: "200",
+      align: "right",
+    },
+    // 渲染 el-button,一般用在最后一列。
+    renderHTML(row) {
+      return [
+        {
+          attrs: {
+            label: "良转次",
+            type: "primary",
+            text: true,
+          },
+          el: "button",
+          click() {
+            getDtl(row, "add");
+          },
+        },
+        {
+          attrs: {
+            label: "次转良",
+            type: "primary",
+            text: true,
+          },
+          el: "button",
+          click() {
+            getDtl(row, "edit");
+          },
+        },
+      ];
+    },
+  },
+]);
+
+let formData = reactive({
+  data: {},
+  treeData: [],
+});
+const formOption = reactive({
+  inline: true,
+  labelWidth: 100,
+  itemWidth: 100,
+  rules: [],
+});
+
+const formConfig = reactive([
+  {
+    type: "input",
+    prop: "canSum",
+    label: "可转数量",
+    disabled: true,
+  },
+  {
+    type: "input",
+    prop: "qualified",
+    label: "数量",
+  },
+]);
+const byform = ref(null);
+
+let requestUrl = "/stock/pageByWarehouse";
+const getList = async (req) => {
+  sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
+  loading.value = true;
+  proxy.post(requestUrl, sourceList.value.pagination).then((message) => {
+    console.log(message);
+    sourceList.value.data = message.rows.map((x) => ({
+      ...x,
+      ...JSON.parse(x.victoriatouristJson),
+    }));
+    sourceList.value.pagination.total = message.total;
+    setTimeout(() => {
+      loading.value = false;
+    }, 200);
+  });
+};
+
+const submitForm = () => {
+  let submitAddress =
+    modalType.value === "add"
+      ? "/stock/defectiveToQualified"
+      : "/stock/qualifiedToDefective";
+  byform.value.handleSubmit((valid) => {
+    if (Number(formData.data.qualified) > Number(formData.data.canSum)) {
+      return ElMessage({
+        message: "不可大于可转数量!",
+        type: "info",
+      });
+    }
+    submitLoading.value = true;
+    proxy.post(submitAddress, formData.data).then(
+      (res) => {
+        ElMessage({
+          message: "操作成功",
+          type: "success",
+        });
+        dialogVisible.value = false;
+        submitLoading.value = false;
+        getList();
+      },
+      (err) => (submitLoading.value = false)
+    );
+  });
+};
+
+const getDtl = (row, type) => {
+  modalType.value = type;
+  let canSum = type === "add" ? row.quantity : row.defectiveQuantity;
+  formData.data = {
+    id: row.id,
+    canSum,
+    qualified: "",
+  };
+  dialogVisible.value = true;
+};
+
+getList();
+
+const handleChange = () => {
+  sourceList.value.pagination.pageNum = 1;
+  if (activeName.value === "first") {
+    requestUrl = "/stock/pageByWarehouse";
+    config.unshift({
+      attrs: {
+        label: "仓库名称",
+        prop: "warehouseName",
+      },
+    });
+  } else {
+    requestUrl = "/stock/pageByProduct";
+    config.shift();
+  }
+  getList();
+};
+</script>
+  
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

+ 10 - 1
src/views/purchaseManage/purchaseManage/purchase/index.vue

@@ -235,9 +235,18 @@ const config = computed(() => {
     },
     {
       attrs: {
-        label: "申购状态",
+        label: "已采购数量",
+        prop: "purchaseCount",
+      },
+    },
+    {
+      attrs: {
+        label: "采购状态",
         prop: "status",
       },
+      render(status) {
+        return status == 15 ? "待采购" : "部分采购";
+      },
     },
     {
       attrs: {

+ 32 - 26
src/views/purchaseManage/purchaseManage/subscribe/index.vue

@@ -182,28 +182,7 @@ const selectConfig = reactive([
   {
     label: "状态",
     prop: "status",
-    data: [
-      {
-        label: "审批中",
-        value: "10",
-      },
-      {
-        label: "待采购",
-        value: "15",
-      },
-      {
-        label: "部分采购",
-        value: "30",
-      },
-      {
-        label: "已采购",
-        value: "20",
-      },
-      {
-        label: "已作废",
-        value: "99",
-      },
-    ],
+    data: [],
   },
 ]);
 const config = computed(() => {
@@ -258,6 +237,9 @@ const config = computed(() => {
         label: "状态",
         prop: "status",
       },
+      render(status) {
+        return statusData.value.find((x) => x.value == status).label;
+      },
     },
     {
       attrs: {
@@ -295,7 +277,7 @@ const config = computed(() => {
             click() {
               // 弹窗提示是否删除
               ElMessageBox.confirm(
-                "此操作将永久删除该数据, 是否继续?",
+                "此操作将永久作废该数据, 是否继续?",
                 "提示",
                 {
                   confirmButtonText: "确定",
@@ -305,12 +287,13 @@ const config = computed(() => {
               ).then(() => {
                 // 删除
                 proxy
-                  .post("/productionProcesses/delete", {
-                    id: row.id,
+                  .post("/subscribeDetail/edit", {
+                    ...row,
+                    status: 99,
                   })
                   .then((res) => {
                     ElMessage({
-                      message: "删除成功",
+                      message: "作废成功",
                       type: "success",
                     });
                     getList();
@@ -483,6 +466,29 @@ const handleRemove = (file) => {
 const handleClose = (index) => {
   fileList.value.splice(index, 1);
 };
+const statusData = ref([
+  {
+    label: "审批中",
+    value: "10",
+  },
+  {
+    label: "待采购",
+    value: "15",
+  },
+  {
+    label: "部分采购",
+    value: "30",
+  },
+  {
+    label: "已采购",
+    value: "20",
+  },
+  {
+    label: "已作废",
+    value: "99",
+  },
+]);
+selectConfig[1].data = statusData.value;
 getList();
 </script>