瀏覽代碼

销售出库单

cz 1 年之前
父節點
當前提交
c9b4e53ddc

+ 129 - 0
src/components/PDF/returnGoodPDF.vue

@@ -0,0 +1,129 @@
+<template>
+  <div>
+    <div id="pdfDom" ref="pdfDom" style="padding: 20px 20px 0; font-size:12px;color:#333333" v-loading="loading">
+      <div class="title">
+        退货单
+      </div>
+      <el-row style="margin:40px 0 10px 0">
+        <el-col :span="12">退货单号:{{pdfData.code}}</el-col>
+        <el-col :span="12" style="text-align:right">退货日期:<span v-if="pdfData.createTime">{{pdfData.createTime.slice(0,10)}}</span></el-col>
+      </el-row>
+      <div>
+        收货单位:{{pdfData.supplierName}}
+      </div>
+      <table border="1" style="width: 100%;margin-top:15px" class="table">
+        <tr>
+          <td style="width:5%;text-align:center">序号</td>
+          <td style="width:30%">产品名称</td>
+          <td style="width:30%">产品编号</td>
+          <td style="width:15%">尺寸(cm)</td>
+          <td style="width:10%">单位</td>
+          <td style="width:10%">退货数量</td>
+        </tr>
+        <template v-if="pdfData.purchaseBackDetailsList && pdfData.purchaseBackDetailsList.length > 0">
+          <tr v-for="(item, index) in pdfData.purchaseBackDetailsList" :key="item.id">
+            <td style="width:5%;text-align:center">{{index+1}}</td>
+            <td>{{item.productName}}</td>
+            <td>{{item.productCode}}</td>
+            <td>{{item.productLength}}*{{item.productWidth}}*{{item.productHeight}}</td>
+            <td>{{item.productUnit}}</td>
+            <td>{{item.quantity}}</td>
+          </tr>
+        </template>
+      </table>
+      <el-row style="margin:20px 0 20px 0">
+        <el-col :span="12">收货单位及经手人:</el-col>
+        <el-col :span="12">送货单位及经手人:</el-col>
+      </el-row>
+    </div>
+    <div style="text-align: center;margin-top:20px">
+      <el-button type="primary" v-print="printObj" size="default" v-debounce>打印</el-button>
+      <el-button type="primary" @click="clickDownload()" size="default" v-debounce>下载PDF</el-button>
+      <el-button type="primary" @click="exportExcel()" size="default" v-debounce>导出Excel</el-button>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import $ from "jquery";
+const { proxy } = getCurrentInstance();
+const pdfData = ref({});
+const props = defineProps({
+  rowData: Object,
+});
+
+const loading = ref(false);
+const getPdfData = (query) => {
+  loading.value = true;
+  proxy.post("/purchaseBack/detail", query).then((res) => {
+    pdfData.value = res;
+    loading.value = false;
+  });
+};
+
+watch(
+  () => props.rowData,
+  (val) => {
+    if (props.rowData.id) {
+      getPdfData({ id: props.rowData.id });
+    }
+  },
+  {
+    immediate: true,
+    deep: true,
+  }
+);
+
+const printObj = ref({
+  id: "pdfDom",
+  popTitle: "",
+  extraCss:
+    "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
+  extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
+});
+
+const clickDownload = () => {
+  proxy.getPdf("退货单PDF文件");
+};
+
+const pdfDom = ref(null);
+const exportExcel = () => {
+  // pdfDom.value.exportExcel();
+  // isShowImg.value = false;
+  loading.value = true;
+  setTimeout(() => {
+    $("#pdfDom").table2excel({
+      exclude: ".noExl",
+      sheetName: `${pdfData.value.code} 退货单`,
+      filename: `${pdfData.value.code} 退货单`,
+      exclude_img: false,
+      exclude_links: false,
+      exclude_inputs: true,
+    });
+    // isShowImg.value = true;
+    loading.value = false;
+  }, 500);
+};
+</script>
+
+<style lang="scss" scoped>
+.title {
+  font-size: 28px;
+  // font-weight: 700;
+  text-align: center;
+}
+.table {
+  border-collapse: collapse;
+  border-spacing: 0;
+  width: 100%;
+  td {
+    text-align: left;
+    padding: 4px;
+    font-size: 12px;
+    // padding: 5px 10px;
+  }
+  .align-right {
+    text-align: right;
+  }
+}
+</style>

+ 165 - 0
src/components/PDF/salesOutboundPDF.vue

@@ -0,0 +1,165 @@
+<template>
+  <div>
+    <div id="pdfDom" ref="pdfDom" style="padding: 20px 20px 0; font-size:12px;color:#333333" v-loading="loading">
+      <div class="title">
+        销售出库单
+      </div>
+      <el-row style="margin:40px 0 20px 0">
+        <el-col :span="8">购货单位:{{pdfData.buyCorporationName}}</el-col>
+        <el-col :span="8">出货日期:<span v-if="pdfData.createTime">{{pdfData.createTime.slice(0,10)}}</span></el-col>
+        <el-col :span="8">订单编号:{{pdfData.code}}</el-col>
+      </el-row>
+      <table border="1" style="width: 100%;margin-top:15px" class="table">
+        <tr>
+          <td style="width:20%">产品名称</td>
+          <td style="width:25%">产品编号</td>
+          <td style="width:8%">净重</td>
+          <td style="width:8%">纹路</td>
+          <td style="width:15%">尺寸(cm)</td>
+          <td style="width:8%">单位</td>
+          <td style="width:8%">订购数量</td>
+          <td style="width:8%">发货数量</td>
+        </tr>
+        <template v-if="pdfData.salesList && pdfData.salesList.length > 0">
+          <tr v-for="(item, index) in pdfData.salesList" :key="item.id">
+            <td>{{item.productName}}</td>
+            <td>{{item.productCode}}</td>
+            <td>{{item.productNetWeight}}</td>
+            <td>{{dictKeyValue(item.productFrontalTexture,frontLinesData)}}</td>
+            <td>{{item.productLength}}*{{item.productWidth}}*{{item.productHeight}}</td>
+            <td>{{item.productUnit}}</td>
+            <td>{{item.orderQuantity}}</td>
+            <td>{{item.quantity}}</td>
+          </tr>
+        </template>
+      </table>
+      <el-row style="margin:20px 0 20px 0">
+        <el-col :span="6">收货人:</el-col>
+        <el-col :span="6">发货员:</el-col>
+        <el-col :span="6">车牌号:</el-col>
+        <el-col :span="6">业务员:{{pdfData.salesmanName}}</el-col>
+      </el-row>
+    </div>
+    <div style="text-align: center;margin-top:20px">
+      <el-button type="primary" v-print="printObj" size="default" v-debounce>打印</el-button>
+      <el-button type="primary" @click="clickDownload()" size="default" v-debounce>下载PDF</el-button>
+      <el-button type="primary" @click="exportExcel()" size="default" v-debounce>导出Excel</el-button>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import $ from "jquery";
+const frontLinesData = computed(
+  () => proxy.useUserStore().allDict["front_lines"]
+);
+const { proxy } = getCurrentInstance();
+const pdfData = ref({});
+const props = defineProps({
+  rowData: Object,
+});
+
+const loading = ref(false);
+const getPdfData = (query) => {
+  loading.value = true;
+  // proxy.post("/contract/detail", query).then((res) => {
+  //   pdfData.value = res;
+  //   if (props.rowData && props.rowData.arr && props.rowData.arr.length > 0) {
+  //     pdfData.value.salesList = props.rowData.arr;
+  //     pdfData.value.createTime = pdfData.value.salesList[0].createTime;
+  //     for (let i = 0; i < pdfData.value.salesList.length; i++) {
+  //       const iproduct = pdfData.value.salesList[i];
+  //       for (let j = 0; j < res.contractProductList.length; j++) {
+  //         const jproduct = res.contractProductList[j];
+  //         if (iproduct.contractProductId == jproduct.id) {
+  //           iproduct.orderQuantity = jproduct.quantity;
+  //         }
+  //       }
+  //     }
+  //   }
+  //   loading.value = false;
+  // });
+  if (props.rowData.arr && props.rowData.arr.length > 0) {
+    let res = props.rowData;
+    pdfData.value = res;
+    pdfData.value.salesList = props.rowData.arr;
+    pdfData.value.createTime = pdfData.value.salesList[0].createTime;
+    for (let i = 0; i < pdfData.value.salesList.length; i++) {
+      const iproduct = pdfData.value.salesList[i];
+      for (let j = 0; j < res.contractProductList.length; j++) {
+        const jproduct = res.contractProductList[j];
+        if (iproduct.contractProductId == jproduct.id) {
+          iproduct.orderQuantity = jproduct.quantity;
+        }
+      }
+    }
+    loading.value = false;
+  }
+};
+
+watch(
+  () => props.rowData,
+  (val) => {
+    if (props.rowData.id) {
+      getPdfData({ id: props.rowData.id });
+    }
+  },
+  {
+    immediate: true,
+    deep: true,
+  }
+);
+
+const printObj = ref({
+  id: "pdfDom",
+  popTitle: "",
+  extraCss:
+    "https://cdn.bootcdn.net/ajax/libs/animate.css/4.1.1/animate.compat.css, https://cdn.bootcdn.net/ajax/libs/hover.css/2.3.1/css/hover-min.css",
+  extraHead: '<meta http-equiv="Content-Language"content="zh-cn"/>',
+});
+
+const clickDownload = () => {
+  proxy.getPdf("销售出库单PDF文件");
+};
+
+const pdfDom = ref(null);
+const exportExcel = () => {
+  // pdfDom.value.exportExcel();
+  // isShowImg.value = false;
+  loading.value = true;
+  setTimeout(() => {
+    $("#pdfDom").table2excel({
+      exclude: ".noExl",
+      sheetName: `${pdfData.value.code} 销售出库单`,
+      filename: `${pdfData.value.code} 销售出库单`,
+      exclude_img: false,
+      exclude_links: false,
+      exclude_inputs: true,
+    });
+    // isShowImg.value = true;
+    loading.value = false;
+  }, 500);
+};
+</script>
+
+<style lang="scss" scoped>
+.title {
+  font-size: 28px;
+  // font-weight: 700;
+  text-align: center;
+}
+.table {
+  border-collapse: collapse;
+  border-spacing: 0;
+  width: 100%;
+  td {
+    text-align: left;
+    padding: 4px;
+    font-size: 12px;
+    // padding: 5px 10px;
+  }
+  .align-right {
+    text-align: right;
+  }
+}
+</style>

+ 14 - 8
src/components/process/SF/UseSeal.vue

@@ -109,9 +109,15 @@ const formConfig = computed(() => {
       prop: "sealIds",
       label: "印章名称",
       filterable: true,
-      multiple: true,
+      multiple: false,
       data: selectData.value,
       itemWidth: 50,
+      fn: (val) => {
+        let current = selectData.value.find((x) => x.value == val);
+        if (current) {
+          formData.data.sealCustodyUserId = current.custodyUserId;
+        }
+      },
     },
     {
       type: "select",
@@ -312,12 +318,12 @@ const handleSelectContrct = async (row) => {
 
 const handleSubmit = async (isStag = false) => {
   if (isStag) {
-    formData.data.sealIds = formData.data.sealIds.join(",");
+    // formData.data.sealIds = formData.data.sealIds.join(",");
     return true;
   }
   let flag = await formDom.value.handleSubmit(() => {});
   if (flag) {
-    formData.data.sealIds = formData.data.sealIds.join(",");
+    // formData.data.sealIds = formData.data.sealIds.join(",");
     return true;
   } else {
     setTimeout(() => {
@@ -340,11 +346,11 @@ defineExpose({
 const getAllData = (businessId) => {
   if (businessId) {
     proxy.post("/sealUse/detail", { id: businessId }).then((res) => {
-      if (res.sealIds) {
-        res.sealIds = res.sealIds.split(",");
-      } else {
-        res.sealIds = [];
-      }
+      // if (res.sealIds) {
+      //   res.sealIds = res.sealIds.split(",");
+      // } else {
+      //   res.sealIds = [];
+      // }
       formData.data = res;
 
       proxy

+ 38 - 11
src/views/EHSD/procurement/returnGood/index.vue

@@ -71,6 +71,10 @@
       </template> -->
     </el-dialog>
 
+    <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="840">
+      <ReturnGoodPDF :rowData="rowData"></ReturnGoodPDF>
+    </el-dialog>
+
   </div>
 </template>
   
@@ -79,6 +83,8 @@ import byTable from "@/components/byTable/index";
 import byForm from "@/components/byForm/index";
 import SelectPurchased from "@/views/EHSD/procurement/purchasedEHSD/selectPurchased.vue";
 import $bus from "@/bus/index.js";
+import ReturnGoodPDF from "@/components/PDF/returnGoodPDF.vue";
+
 const { proxy } = getCurrentInstance();
 const loading = ref(false);
 const submitLoading = ref(false);
@@ -216,17 +222,31 @@ const config = computed(() => {
       },
     },
 
-    // {
-    //   attrs: {
-    //     label: "操作",
-    //     width: "200",
-    //     align: "center",
-    //     fixed: "right",
-    //   },
-    //   renderHTML(row) {
-    //     return [];
-    //   },
-    // },
+    {
+      attrs: {
+        label: "操作",
+        width: "100",
+        align: "center",
+        fixed: "right",
+      },
+      renderHTML(row) {
+        return [
+          row.status == 30
+            ? {
+                attrs: {
+                  label: "打印",
+                  type: "primary",
+                  text: true,
+                },
+                el: "button",
+                click() {
+                  handlePrint(row);
+                },
+              }
+            : {},
+        ];
+      },
+    },
   ];
 });
 const formData = reactive({
@@ -388,6 +408,13 @@ onBeforeUnmount(() => {
   // 取消订阅特定事件
   $bus.off("refreshTableData");
 });
+
+const openPrint = ref(false);
+const rowData = ref({});
+const handlePrint = (row) => {
+  rowData.value = row;
+  openPrint.value = true;
+};
 </script>
   
 <style lang="scss" scoped>

+ 31 - 3
src/views/EHSD/saleContract/contractEHSD/index.vue

@@ -435,8 +435,13 @@
                                :formatter="(row) => dictKeyValue(row.productFrontalTexture, frontLinesData)" />
               <el-table-column prop="productNetWeight" label="净重" width="100" />
               <el-table-column prop="productUnit" label="单位" width="100" />
-              <el-table-column label="发货数量" width="100" prop="quantity" fixed="right" />
               <el-table-column label="备注" min-width="200" prop="remark" />
+              <el-table-column label="发货数量" width="100" prop="quantity" fixed="right" />
+              <el-table-column label="操作" width="60" align="center" fixed="right">
+                <template #default="{ row,$index }">
+                  <el-button type="primary" link @click="handlePrint(row)">打印</el-button>
+                </template>
+              </el-table-column>
             </el-table>
           </div>
         </template>
@@ -447,6 +452,10 @@
       </template>
     </el-dialog>
 
+    <el-dialog title="打印" v-if="openPrintOutbound" v-model="openPrintOutbound" width="840">
+      <SalesOutboundPDF :rowData="outboundRowData"></SalesOutboundPDF>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -461,7 +470,8 @@ import ContractPDFOne from "@/components/PDF/contractPDFOne.vue";
 import ContractPDFOneNew from "@/components/PDF/contractPDFOneNew.vue";
 import $bus from "@/bus/index.js";
 import moment from "moment";
-import { reactiveComputed } from "@vueuse/core";
+import SalesOutboundPDF from "@/components/PDF/salesOutboundPDF.vue";
+
 const route = useRoute();
 const { proxy } = getCurrentInstance();
 const frontLinesData = computed(
@@ -2194,6 +2204,10 @@ const handleSalesOutBound = (row) => {
         quantity: null,
         amount: "",
       })),
+      contractProductList: res.contractProductList,
+      buyCorporationName: res.buyCorporationName,
+      code: res.code,
+      salesmanName: res.salesmanName,
       amount: "",
     };
     let productIds;
@@ -2382,7 +2396,7 @@ const flitterData = (arr) => {
 };
 
 const objectSpanMethod = ({ rowIndex, columnIndex }) => {
-  if (columnIndex === 0) {
+  if (columnIndex === 0 || columnIndex === 11) {
     const _row = flitterData(salesOutBoundFormData.data.recordList).one[
       rowIndex
     ];
@@ -2402,6 +2416,20 @@ const exportExcel = () => {
       proxy.downloadFile(res, "销售订单.xlsx");
     });
 };
+
+const openPrintOutbound = ref(false);
+const outboundRowData = ref({});
+const handlePrint = (row) => {
+  let arr = salesOutBoundFormData.data.recordList.filter(
+    (x) => x.recordId == row.recordId
+  );
+  outboundRowData.value = {
+    id: row.contractId,
+    ...salesOutBoundFormData.data,
+    arr,
+  };
+  openPrintOutbound.value = true;
+};
 </script>
 
 <style lang="scss" scoped>

+ 27 - 12
src/views/process/processConfig/vueFlow.vue

@@ -269,8 +269,8 @@ const formConfig = computed(() => {
     {
       type: "select",
       prop: "handleObjectType",
-      label: "办理类型",
-      placeholder: "请选择办理类型",
+      label: "办理对象",
+      placeholder: "请选择办理对象",
       required: true,
       itemWidth: 50,
       fn: (e) => {
@@ -303,7 +303,11 @@ const formConfig = computed(() => {
           value: 8,
         },
         {
-          label: "用户主群(需定制开发)",
+          label: "表达式(单处理人)",
+          value: 9,
+        },
+        {
+          label: "用户组群(多人并行办理机制,需定制开发)",
           value: 6,
         },
       ],
@@ -324,7 +328,7 @@ const formConfig = computed(() => {
       data: selectHanleData.value,
       isShow:
         formData.data.handleObjectType &&
-        ![5, 6, 8].includes(formData.data.handleObjectType),
+        ![5, 6, 8, 9].includes(formData.data.handleObjectType),
     },
     {
       type: "select",
@@ -349,6 +353,15 @@ const formConfig = computed(() => {
       isShow: formData.data.handleObjectType === 8,
     },
     {
+      type: "input",
+      prop: "jumpCondition",
+      label: "条件表达式",
+      required: true,
+      itemType: "text",
+      itemWidth: 50,
+      isShow: formData.data.handleObjectType === 9,
+    },
+    {
       type: "select",
       label: "节点类型",
       itemWidth: 100,
@@ -362,13 +375,7 @@ const formConfig = computed(() => {
     //   required: true,
     //   itemType: "text",
     // },
-    // {
-    //   type: "input",
-    //   prop: "jumpCondition",
-    //   label: "条件表达式",
-    //   required: true,
-    //   itemType: "text",
-    // },
+
     {
       type: "checkbox",
       prop: "nodeButtonSet",
@@ -531,7 +538,15 @@ const submitAll = () => {
     if (element.shape == "edge") {
       lineNodeList.value.push(element);
       // 线数据对象
-      if (!flowDefinitionLineObj.value[element.id]) {
+      if (flowDefinitionLineObj.value[element.id]) {
+        flowDefinitionLineObj.value[element.id] = {
+          lineUuid: element.id,
+          id: element.id,
+          jumpCondition: flowDefinitionLineObj.value[element.id].jumpCondition,
+          sourceId: element.source.cell,
+          targetId: element.target.cell,
+        };
+      } else {
         flowDefinitionLineObj.value[element.id] = {
           lineUuid: element.id,
           id: element.id,