浏览代码

租户 系统管理页面bug

lxf 2 年之前
父节点
当前提交
ede54116cf

+ 137 - 0
src/views/salesMange/saleContract/contract/index.vue

@@ -34,6 +34,109 @@
         </template>
       </byTable>
     </div>
+
+    <el-dialog title="打印" v-if="openPrint" v-model="openPrint" width="860" v-loading="loadingPrint">
+      <div id="pdfDom" style="width: 800px; padding: 16px; font-size: 12px !important">
+        <div style="font-size: 18px; text-align: center">{{ printDetails.sellCorporationNameEn }}</div>
+        <div style="text-align: center">
+          {{ printDetails.sellCountryName }},{{ printDetails.sellProvinceName }},{{ printDetails.sellCityName }},{{ printDetails.sellDetailedAddress }}
+        </div>
+        <div style="font-size: 14px; color: #409eff; text-align: center; padding-top: 16px">PROFORMA INVOICE</div>
+        <div style="padding-top: 8px">
+          <div>PI NO. : {{ printDetails.contractCode }}</div>
+          <div>PI DATE: {{ printDetails.createTimeEn }}</div>
+        </div>
+        <div style="border: 1px solid #999; display: flex">
+          <div style="width: 50%; border-right: 1px solid #999">
+            <div style="color: #409eff">VENDOR:</div>
+            <div>{{ printDetails.sellCorporationNameEn }}</div>
+            <div style="padding: 16px 0">
+              {{ printDetails.sellCountryName }},{{ printDetails.sellProvinceName }},{{ printDetails.sellCityName }},{{ printDetails.sellDetailedAddress }}
+            </div>
+            <div>{{ printDetails.sellContactName }},{{ printDetails.sellContactNumber }}</div>
+          </div>
+          <div style="width: 50%">
+            <div style="color: #409eff">BUYER:</div>
+            <div>{{ printDetails.buyCorporationName }}</div>
+            <div style="padding: 16px 0">
+              {{ printDetails.buyCountryName }},{{ printDetails.buyProvinceName }},{{ printDetails.buyCityName }},{{ printDetails.buyDetailedAddress }}
+            </div>
+            <div>{{ printDetails.buyContactName }},{{ printDetails.buyContactNumber }}</div>
+          </div>
+        </div>
+        <div style="height: 16px"></div>
+        <div style="border: 1px solid #999">
+          <div style="display: flex; width: 100%">
+            <div style="width: 33%; border-bottom: 1px solid #999; border-right: 1px solid #999">
+              <div style="color: #409eff">COUNTRY OF ORIGIN:</div>
+            </div>
+            <div style="width: 34%; border-bottom: 1px solid #999; border-right: 1px solid #999">
+              <div style="color: #409eff">COUNTRY OF DESTINATION:</div>
+            </div>
+            <div style="width: 33%; border-bottom: 1px solid #999">
+              <div style="color: #409eff">PLACE OF DISCHARGE:</div>
+            </div>
+          </div>
+          <div style="display: flex; width: 100%">
+            <div style="width: 33%; border-bottom: 1px solid #999; border-right: 1px solid #999">
+              <div style="color: #409eff">TERMS OF DELIVERY:</div>
+            </div>
+            <div style="width: 34%; border-bottom: 1px solid #999; border-right: 1px solid #999">
+              <div style="color: #409eff">CURRENCY:</div>
+            </div>
+            <div style="width: 33%; border-bottom: 1px solid #999">
+              <div style="color: #409eff">EXPORT BY/VIA:</div>
+            </div>
+          </div>
+          <div style="display: flex; width: 100%">
+            <div style="width: 33%; border-right: 1px solid #999">
+              <div style="color: #409eff">DELIVERY TIME:</div>
+            </div>
+            <div style="width: 67%">
+              <div style="color: #409eff">TERMS OF PAYMENT:</div>
+            </div>
+          </div>
+        </div>
+        <div style="height: 16px"></div>
+        <div class="baseRow" style="display: flex; color: #409eff">
+          <div class="contentRow" style="width: 50px; text-align: center">NO.</div>
+          <div class="contentRow" style="width: calc(100% - 450px); text-align: center">COMMODITY, SPECIFICATION</div>
+          <div class="contentRow" style="width: 100px; text-align: center">UNIT</div>
+          <div class="contentRow" style="width: 100px; text-align: center">QUANTITY</div>
+          <div class="contentRow" style="width: 100px; text-align: center">UNIT PRICE</div>
+          <div class="contentRow" style="width: 100px; text-align: center">TOTAL PRICE</div>
+        </div>
+        <div v-if="printDetails.productInfoList && printDetails.productInfoList.length > 0">
+          <div class="baseRow" style="display: flex" v-for="(item, index) in printDetails.productInfoList" :key="item.productId">
+            <div class="contentRow" style="width: 50px; text-align: center">{{ index + 1 }}</div>
+            <div class="contentRow" style="width: calc(100% - 450px); text-align: center">{{ item.productName }}</div>
+            <div class="contentRow" style="width: 100px; text-align: center">{{ item.productUnit }}</div>
+            <div class="contentRow" style="width: 100px; text-align: center">{{ item.productQuantity }}</div>
+            <div class="contentRow" style="width: 100px; text-align: center">{{ item.productPrice }}</div>
+            <div class="contentRow" style="width: 100px; text-align: center">{{ item.amount }}</div>
+          </div>
+        </div>
+        <div class="baseRow" style="display: flex; color: #409eff">
+          <div class="contentRow" style="width: calc(100% - 400px); text-align: center">SUBTOTAL: </div>
+          <div class="contentRow" style="width: 100px; text-align: center"></div>
+          <div class="contentRow" style="width: 100px; text-align: center">168</div>
+          <div class="contentRow" style="width: 100px; text-align: center"></div>
+          <div class="contentRow" style="width: 100px; text-align: center">1200</div>
+        </div>
+        <div class="baseRow" style="display: flex; color: #409eff">
+          <div class="contentRow" style="width: calc(100% - 100px); text-align: right;">FREIGHT COST: </div>
+          <div class="contentRow" style="width: 100px; text-align: center">1200</div>
+        </div>
+        <div class="baseRow" style="display: flex; color: #409eff">
+          <div class="contentRow" style="width: calc(100% - 100px); text-align: right;">TOTAL PRICE: </div>
+          <div class="contentRow" style="width: 100px; text-align: center">1200</div>
+        </div>
+      </div>
+      <template #footer>
+        <el-button @click="openPrint = false" size="large">取消</el-button>
+        <el-button type="primary" @click="clickDownload()" size="large">下载PDF</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -237,6 +340,17 @@ const config = computed(() => {
         return [
           {
             attrs: {
+              label: "打印",
+              type: "primary",
+              text: true,
+            },
+            el: "button",
+            click() {
+              clickPrint(row);
+            },
+          },
+          {
+            attrs: {
               label: "作废",
               type: "primary",
               text: true,
@@ -327,6 +441,19 @@ const newContract = () => {
     },
   });
 };
+const openPrint = ref(true);
+const loadingPrint = ref(false);
+const printDetails = ref({});
+const clickPrint = (row) => {
+  loadingPrint.value = true;
+  openPrint.value = true;
+  proxy.post("/contract/getContractPdfInfo", { id: row.id }).then((res) => {
+    printDetails.value = res;
+  });
+};
+const clickDownload = () => {
+  proxy.getPdf("外销合同PDF文件");
+};
 </script>
 
 <style lang="scss" scoped>
@@ -336,4 +463,14 @@ const newContract = () => {
 ::v-deep(.el-input-number .el-input__inner) {
   text-align: left;
 }
+.baseRow {
+  min-height: 24px;
+  border-top: 1px solid #999;
+  border-left: 1px solid #999;
+}
+.contentRow {
+  border-right: 1px solid #999;
+  line-height: 24px;
+  padding-left: 4px;
+}
 </style>

+ 4 - 4
src/views/systemTenant/tenant/deptTenant/index.vue

@@ -96,19 +96,19 @@ const userList = ref([]);
 const typeList = ref([
   {
     label: "公司",
-    value: "0",
+    value: 0,
   },
   {
     label: "业务中心",
-    value: "1",
+    value: 1,
   },
   {
     label: "部门",
-    value: "2",
+    value: 2,
   },
   {
     label: "组",
-    value: "3",
+    value: 3,
   },
 ]);
 const sourceList = ref({

+ 12 - 4
src/views/systemTenant/tenant/dictTenant/index.vue

@@ -209,7 +209,7 @@ const config = computed(() => {
     },
   ];
 });
-let formData = reactive({
+const formData = reactive({
   data: {},
 });
 const formOption = reactive({
@@ -226,11 +226,14 @@ const formConfig = computed(() => {
       prop: "code",
       label: "字典编码",
       required: true,
+      disabled: formData.data.id,
+      maxlength:"50"
     },
     {
       type: "input",
       prop: "name",
       label: "字典名称",
+      maxlength:"50"
     },
     {
       label: "启用状态",
@@ -239,11 +242,11 @@ const formConfig = computed(() => {
       data: [
         {
           label: "禁用",
-          value: "0",
+          value: 0,
         },
         {
           label: "启用",
-          value: "1",
+          value: 1,
         },
       ],
     },
@@ -300,9 +303,14 @@ const getDept = () => {
   });
 };
 const getDtl = (row) => {
-  formData.data = { ...row };
   modalType.value = "edit";
   dialogVisible.value = true;
+  setTimeout(() => {
+    formData.data = row;
+    if (!formData.data.status) {
+      formData.data.status = 0;
+    }
+  }, 200);
 };
 getDept();
 getList();

+ 15 - 2
src/views/systemTenant/tenant/userTenant/index.vue

@@ -134,6 +134,7 @@ const config = computed(() => {
             el: "button",
             click() {
               userId.value = row.userId;
+              password.value = ''
               roomDialogVisible.value = true;
             },
           },
@@ -316,7 +317,10 @@ const openModal = () => {
 const submitForm = () => {
   submit.value.handleSubmit(() => {
     const method = modalType.value == "add" ? "POST" : "PUT";
-    proxy.post("/tenantUser", formData.data, method).then((res) => {
+    proxy.post("/tenantUser", formData.data, method).then(() => {
+      if (formData.data.password && formData.data.userId) {
+        proxy.post("/tenantUser/resetPwd", { password: formData.data.password, userId: formData.data.userId }, "PUT").then();
+      }
       ElMessage({
         message: modalType.value == "add" ? "添加成功" : "编辑成功",
         type: "success",
@@ -334,7 +338,16 @@ const getDtl = (row) => {
 const newPassword = () => {
   formData.data.password = generatePassword();
 };
-const userId = ref('')
+const generatePassword = () => {
+  var length = 12,
+    charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
+    password = "";
+  for (var i = 0, n = charset.length; i < length; ++i) {
+    password += charset.charAt(Math.floor(Math.random() * n));
+  }
+  return password;
+};
+const userId = ref("");
 const password = ref("");
 const roomDialogVisible = ref(false);
 const submitPassword = (password1) => {