Bläddra i källkod

Merge branch 'dev0.3' of http://36.137.93.232:3000/hf/byte-sailing-new into dev0.3

lxf 1 år sedan
förälder
incheckning
9e7419df02

+ 4 - 5
src/components/process/SendPurchase.vue

@@ -750,12 +750,11 @@ onMounted(() => {
     ids.value = props.queryData.ids.split(",") || [];
     getDetails();
   }
-  // if (props.queryData.type === "handoverSlip") {
-  //   formData.data.dataResource = "1"; //外销合同采购
-  //   formData.data.dataResourceId = "";
-  // }
-
   if (props.queryData.type === "handoverSlip" && props.queryData.arr) {
+    formData.data.dataResourceId = JSON.parse(
+      props.queryData.arr
+    )[0].contractId;
+    formData.data.dataResource = "1"; //外销合同采购
     contractData.value = JSON.parse(props.queryData.arr);
     auxiliaryData.value.unshift({
       label: "关联销售合同",

+ 9 - 2
src/views/process/processApproval/index.vue

@@ -39,8 +39,8 @@
             <el-input type="textarea" placeholder="请输入" v-model="flowForm.remark"> </el-input>
           </el-form-item>
           <el-form-item>
-            <el-button type="primary" v-if="approvalRecordData.buttonInfoList.length == 0" @click="handleSubmit">提交</el-button>
-            <el-button type="primary" v-else v-for="i in approvalRecordData.buttonInfoList" :key="i.type" @click="handleSubmit(i.type)">{{ i.name }}</el-button>
+            <el-button type="primary" v-if="approvalRecordData.buttonInfoList.length == 0" @click="handleSubmit" :loading="btnLoading">提交</el-button>
+            <el-button type="primary" v-else v-for="i in approvalRecordData.buttonInfoList" :key="i.type" :loading="btnLoading" @click="handleSubmit(i.type)">{{ i.name }}</el-button>
           </el-form-item>
         </el-form>
       </div>
@@ -160,6 +160,8 @@ let auxiliaryData = ref([]);
 const getAuxiliaryData = (data)=>{
   auxiliaryData.value=data
 }
+
+const btnLoading = ref(false)
 // 意见表单
 const flowForm = reactive({
   flowKey: "",
@@ -201,6 +203,7 @@ const handleSubmit = async (_type) => {
     const flag = await makeDom.value.handleSubmit();
     if (flag) {
       flowFormDom.value.validate((valid) => {
+        btnLoading.value  = true
         if (valid) {
           const data = makeDom.value.getFormData();
           if (flowForm.flowKey == "subscribe_flow") {
@@ -357,6 +360,8 @@ const handleSubmit = async (_type) => {
                     .then();
                 }
                 handleResult(res);
+              },err=>{
+                 btnLoading.value  = false
               });
             return;
           } else {
@@ -367,6 +372,8 @@ const handleSubmit = async (_type) => {
               })
               .then((res) => {
                 handleResult(res);
+              },err=>{
+                 btnLoading.value  = false
               });
           }
         }

+ 205 - 0
src/views/purchaseManage/purchaseManage/alreadyPurchase/index.vue

@@ -126,6 +126,151 @@
         </el-button>
       </template>
     </el-dialog>
+
+    <el-dialog title="打印" v-if="openPdf" v-model="openPdf" width="840px">
+      <div id="pdfDom" ref="pdfDom" style="width: 776px">
+        <div style="border: 1px solid #000; border-collapse: collapse">
+          <div style="text-align: right; padding: 2px 4px 0 0">合同号:aa</div>
+          <div class="title">购销合同</div>
+          <div style="display: flex">
+            <div style="display: flex; width: 50%; padding-right: 20px">
+              <div style="width: 60px">买方:</div>
+              <div style="width: calc(100% - 60px)">
+                <div>福建宏星电子科技有限公司</div>
+                <div>福建省福州市鼓楼区软件大道89号福州软件园A区28号楼五层</div>
+              </div>
+            </div>
+            <div style="display: flex; width: 50%; padding-left: 20px">
+              <div style="width: 60px">卖方:</div>
+              <div style="width: calc(100% - 60px)">供应商</div>
+            </div>
+          </div>
+          <div style="display: flex">
+            <div style="display: flex; width: 50%; padding-right: 20px">
+              <div style="width: 60px">经手人:</div>
+              <div style="width: calc(100% - 60px)">翁本娟</div>
+            </div>
+            <div style="display: flex; width: 50%; padding-left: 20px">
+              <div style="width: 60px">经手人:</div>
+              <div style="width: calc(100% - 60px)">供应商联系人</div>
+            </div>
+          </div>
+          <div>买卖双方经协商,一致同意签订以下合同</div>
+          <div>货物名称、规格型号、单位、数量、单价及金额:</div>
+          <table border="1" style="width: 100%" class="table">
+            <tr>
+              <td style="width: 70px">序号</td>
+              <td>品名</td>
+              <td>规格型号</td>
+              <td style="width: 60px">数量</td>
+              <td style="width: 60px">单位</td>
+              <td style="width: 100px">单价</td>
+              <td style="width: 100px">金额</td>
+            </tr>
+            <tr v-for="(row, index) in 5" :key="row">
+              <td style="width: 70px">{{ index + 1 }}</td>
+              <td>品名</td>
+              <td>规格型号</td>
+              <td style="width: 60px">数量</td>
+              <td style="width: 60px">单位</td>
+              <td style="width: 100px">单价</td>
+              <td style="width: 100px">金额</td>
+            </tr>
+            <tr>
+              <td colspan="3" style="text-align: right">合计:</td>
+              <td>300</td>
+              <td></td>
+              <td></td>
+              <td>$300</td>
+            </tr>
+            <tr>
+              <td colspan="7" style="text-align: left">
+                合计人民币金额(大写):
+              </td>
+            </tr>
+            <tr>
+              <td>交货地点:</td>
+              <td colspan="6" style="text-align: left">
+                福建省福州市鼓楼区软件大道89号福州软件园A区28号楼五层
+              </td>
+            </tr>
+            <tr>
+              <td>交货时间:</td>
+              <td colspan="6" style="text-align: left"></td>
+            </tr>
+            <tr>
+              <td>保修期:</td>
+              <td colspan="6" style="text-align: left">一年</td>
+            </tr>
+            <tr>
+              <td colspan="7" style="text-align: left; padding: 0px">
+                <div style="padding: 2px 0px">
+                  一、交货地点:福州软件园A区28座5层。
+                </div>
+                <div style="padding: 2px 0px">
+                  二、运输方式及运费:买方承担。
+                </div>
+                <div style="padding: 2px 0px">
+                  三、质量要求:样品品质、型号、规格、数量如同买方确认上表规格所示,不符合则由卖方承担责任。
+                </div>
+                <div style="padding: 2px 0px">
+                  四、交货时间:2023年4月13日。
+                </div>
+                <div style="padding: 2px 0px">五、付款方式:银行转账。</div>
+                <div style="padding: 2px 0px">六、保修期:一年。</div>
+                <div style="padding: 2px 0px">
+                  七、本合同经买卖双方签字盖章后生效,传真件有效。
+                </div>
+                <div style="padding: 2px 0px">
+                  八、解决合同纠纷:原双方另有约定外,均按《中华人民共和国合同法》有关规定处理。
+                </div>
+                <div style="padding: 2px 0px">九、其他约定事项:友好解决。</div>
+              </td>
+            </tr>
+          </table>
+          <div style="display: flex">
+            <div style="width: 50%; padding-right: 20px">
+              <div>买方:</div>
+              <div>单位名称:福建宏星电子科技有限公司</div>
+              <div>
+                地址:福建省福州市鼓楼区软件大道89号福州软件园A区28号楼五层
+              </div>
+              <div>电话:18750510253</div>
+              <div>传真:18750510253</div>
+              <div style="margin-top: auto">代表人签字:</div>
+            </div>
+            <div style="width: 50%; padding-left: 20px">
+              <div>卖方:</div>
+              <div>单位名称:供应商</div>
+              <div>统一社会信用代码:供应商</div>
+              <div>开户银行:工商银行常州市武进支行</div>
+              <div>帐号:1105021009000038765</div>
+              <div>地址:1105021009000038765</div>
+              <div>电话:1105021009000038765</div>
+              <div>代表人签字:</div>
+            </div>
+          </div>
+          <div
+            style="
+              padding: 30px 0px 20px 0;
+              text-align: right;
+              border-top: 1px solid #000;
+            "
+          >
+            签订日期:2023-04-13
+          </div>
+        </div>
+      </div>
+      <template #footer ref="printBtn">
+        <el-button @click="openPdf = false" size="large">关闭</el-button>
+        <el-button type="primary" v-print="printObj" size="large"
+          >打印</el-button
+        >
+        <el-button type="primary" @click="clickDownload()" size="large"
+          >下载PDF</el-button
+        >
+      </template>
+    </el-dialog>
   </div>
 </template>
   
@@ -291,6 +436,17 @@ const config = computed(() => {
       },
       renderHTML(row) {
         return [
+          {
+            attrs: {
+              label: "打印",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              handlePrintPdf(row);
+            },
+          },
           row.purchaseStatus == 30
             ? {
                 attrs: {
@@ -525,10 +681,59 @@ const handleClickCode = (row) => {
     },
   });
 };
+const openPdf = ref(false);
+let rowData = ref({});
+const handlePrintPdf = (row) => {
+  rowData.value = row;
+  openPdf.value = true;
+};
+const clickDownload = () => {
+  proxy.getPdf("请款PDF文件");
+};
+const pdfDom = ref(null);
+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"/>',
+});
 </script>
   
 <style lang="scss" scoped>
 .tenant {
   padding: 20px;
 }
+#pdfDom {
+  font-size: 12px;
+  color: #000000;
+  padding: 60px 30px;
+  .title {
+    font-size: 16px;
+    font-weight: 700;
+    margin-top: 10px;
+    margin-bottom: 20px;
+    text-align: center;
+  }
+  .table {
+    // width: calc(100% + 2px) !important;
+    border-collapse: collapse;
+    border-spacing: 0;
+    // margin-left: -1px;
+    // margin-right: -1px;
+
+    td {
+      text-align: center;
+      padding: 8px 0px;
+    }
+    // tr td:last-child {
+    //   border-right: 0 !important;
+    // }
+  }
+  .flex-top-bottom {
+    display: flex;
+    justify-content: space-between;
+    margin: 5px 0px;
+  }
+}
 </style>

+ 115 - 10
src/views/purchaseSales/outAndInWarehouse/record/index.vue

@@ -25,11 +25,54 @@
         </template>
       </byTable>
     </div>
+
+    <el-dialog title="打印" v-if="openPdf" v-model="openPdf" width="840px">
+      <div id="pdfDom" ref="pdfDom" style="width: 776px">
+        <div class="title">{{ dictValueLabel(rowData.type, typeList) }}单</div>
+        <div class="flex-top-bottom">
+          <div>福建宏星电子科技有限公司 (SO2301-001)</div>
+          <div>2023-01-01</div>
+        </div>
+        <table border="1" style="width: 100%" class="table">
+          <tr>
+            <td style="width: 100px">物品编码</td>
+            <td>物品名称</td>
+            <td>规格型号</td>
+            <td style="width: 80px">单位</td>
+            <td style="width: 80px">数量</td>
+            <td style="width: 80px">单价</td>
+            <td style="width: 80px">金额</td>
+          </tr>
+          <tr v-for="row in 5" :key="row">
+            <td>物品编码</td>
+            <td>物品名称</td>
+            <td>规格型号</td>
+            <td>单位</td>
+            <td>数量</td>
+            <td>单价</td>
+            <td>金额</td>
+          </tr>
+        </table>
+        <div class="flex-top-bottom">
+          <div>仓库名称:一楼面料仓库</div>
+          <div>合计金额: USD 3,000.00</div>
+        </div>
+      </div>
+      <template #footer ref="printBtn">
+        <el-button @click="openPdf = false" size="large">关闭</el-button>
+        <el-button type="primary" v-print="printObj" size="large"
+          >打印</el-button
+        >
+        <el-button type="primary" @click="clickDownload()" size="large"
+          >下载PDF</el-button
+        >
+      </template>
+    </el-dialog>
   </div>
 </template>
 
 <script setup>
-import { computed, ref } from "vue";
+import { computed, nextTick, ref, toRef } from "vue";
 import byTable from "@/components/byTable/index";
 
 const { proxy } = getCurrentInstance();
@@ -124,6 +167,8 @@ const sourceList = ref({
   },
 });
 const loading = ref(false);
+const openPdf = ref(false);
+let rowData = ref({});
 const selectConfig = computed(() => {
   return [
     {
@@ -144,7 +189,7 @@ const config = computed(() => {
       attrs: {
         label: "操作类型",
         prop: "opType",
-        width: 140,
+        width: 80,
       },
       render(type) {
         return proxy.dictValueLabel(type, opTypeList.value);
@@ -154,7 +199,7 @@ const config = computed(() => {
       attrs: {
         label: "出入库类型",
         prop: "type",
-        width: 140,
+        width: 130,
       },
       render(type) {
         return proxy.dictValueLabel(type, typeList.value);
@@ -164,35 +209,32 @@ const config = computed(() => {
       attrs: {
         label: "仓库名称",
         slot: "warehouseName",
-        width: 200,
       },
     },
     {
       attrs: {
         label: "物品编码",
         prop: "productCode",
-        width: 160,
+        width: 110,
       },
     },
     {
       attrs: {
         label: "物品名称",
         prop: "productName",
-        "min-width": 220,
       },
     },
     {
       attrs: {
         label: "规格型号",
         prop: "productSpec",
-        width: 160,
       },
     },
     {
       attrs: {
         label: "单位",
         prop: "productUnit",
-        width: 120,
+        width: 80,
       },
       render(unit) {
         return proxy.dictValueLabel(unit, productUnit.value);
@@ -209,14 +251,36 @@ const config = computed(() => {
       attrs: {
         label: "操作人",
         prop: "opUserName",
-        width: 120,
+        width: 130,
       },
     },
     {
       attrs: {
         label: "操作时间",
         prop: "createTime",
-        width: 160,
+        width: 155,
+      },
+    },
+    {
+      attrs: {
+        label: "操作",
+        width: "80",
+        align: "center",
+      },
+      renderHTML(row) {
+        return [
+          {
+            attrs: {
+              label: "打印",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              handlePrintPdf(row);
+            },
+          },
+        ];
       },
     },
   ];
@@ -260,9 +324,26 @@ onMounted(() => {
   }
   getList();
 });
+
 const deriveExcel = () => {
   console.log("deriveExcel");
 };
+
+const handlePrintPdf = (row) => {
+  rowData.value = row;
+  openPdf.value = true;
+};
+const clickDownload = () => {
+  proxy.getPdf("请款PDF文件");
+};
+const pdfDom = ref(null);
+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"/>',
+});
 </script>
 
 <style lang="scss" scoped>
@@ -272,4 +353,28 @@ const deriveExcel = () => {
 ::v-deep(.el-input-number .el-input__inner) {
   text-align: left;
 }
+#pdfDom {
+  font-size: 12px;
+  color: #000000;
+  padding: 60px 30px;
+  .title {
+    font-size: 16px;
+    // font-weight: 700;
+    margin-bottom: 20px;
+    text-align: center;
+  }
+  .table {
+    border-collapse: collapse;
+    border-spacing: 0;
+    td {
+      text-align: center;
+      padding: 8px 0px;
+    }
+  }
+  .flex-top-bottom {
+    display: flex;
+    justify-content: space-between;
+    margin: 5px 0px;
+  }
+}
 </style>