From b52925db344afb86bbb9413d19e59c971f6eef73 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 08 二月 2023 13:47:37 +0800
Subject: [PATCH] 1.采购订单静态部分实现

---
 src/views/cggl/cgdd.vue |  551 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/api/ErpSyncMes.js   |    8 
 src/api/cggl.js         |   37 +++
 3 files changed, 596 insertions(+), 0 deletions(-)

diff --git a/src/api/ErpSyncMes.js b/src/api/ErpSyncMes.js
index 1baa946..e9d4eb5 100644
--- a/src/api/ErpSyncMes.js
+++ b/src/api/ErpSyncMes.js
@@ -46,3 +46,11 @@
     method: 'post'
   })
 }
+
+// 鐢熶骇绠$悊锛氶噰璐鍗曞悓姝�
+export function SeaveSearchErpPurchaseOrder() {
+  return request({
+    url: 'ErpSyncMes/SeaveSearchErpPurchaseOrder',
+    method: 'post'
+  })
+}
diff --git a/src/api/cggl.js b/src/api/cggl.js
new file mode 100644
index 0000000..d9d0f4b
--- /dev/null
+++ b/src/api/cggl.js
@@ -0,0 +1,37 @@
+import request from '@/utils/request'
+
+// 閲囪喘璁㈠崟鏌ヨ
+export function PurchaseOrderSearch(data) {
+  return request({
+    url: 'PurchaseOrder/PurchaseOrderSearch',
+    method: 'get',
+    params: data
+  })
+}
+
+// 閲囪喘璁㈠崟鍒犻櫎
+export function DeletePurchaseOrder(data) {
+  return request({
+    url: 'PurchaseOrder/DeletePurchaseOrder',
+    method: 'post',
+    params: data
+  })
+}
+
+// 閲囪喘璁㈠崟瀹℃牳
+export function VerifyPurchaseOrder(data) {
+  return request({
+    url: 'PurchaseOrder/VerifyPurchaseOrder',
+    method: 'post',
+    params: data
+  })
+}
+
+// 閲囪喘璁㈠崟鍙嶅鏍�
+export function ReversVerifyPurchaseOrder(data) {
+  return request({
+    url: 'PurchaseOrder/ReversVerifyPurchaseOrder',
+    method: 'post',
+    params: data
+  })
+}
diff --git a/src/views/cggl/cgdd.vue b/src/views/cggl/cgdd.vue
index e69de29..5e68959 100644
--- a/src/views/cggl/cgdd.vue
+++ b/src/views/cggl/cgdd.vue
@@ -0,0 +1,551 @@
+<template>
+  <div>
+    <div class="body" :style="{height:mainHeight+'px'}">
+      <div class="bodyTopButtonGroup" style="justify-content: space-between">
+        <!--        <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>-->
+        <el-button
+          v-waves
+          icon="el-icon-refresh-right"
+          @click="syncERP"
+        >鍚屾ERP
+        </el-button>
+        <!--        <el-button v-waves icon="el-icon-download" @click="upload">瀵煎叆</el-button>-->
+      </div>
+
+      <div class="bodyTopFormGroup">
+        <el-form
+          ref="form"
+          :model="form"
+          label-width="100px"
+          inline
+          style="display: flex;"
+        >
+          <div class="elForm">
+            <el-form-item label="璁㈠崟鐘舵��" style="display: flex;">
+              <el-select
+                v-model="form.mesorderstus"
+                :popper-append-to-body="false"
+                filterable
+                style="width: 200px"
+                placeholder="璇烽�夋嫨"
+              >
+                <el-option
+                  v-for="item in mesorderstusArr"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="璁㈠崟缂栧彿" style="display: flex;">
+              <el-input v-model="form.mesordercode" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+            <el-form-item label="閲囪喘渚涙柟" style=" display:flex;">
+              <el-input v-model="form.OrgName" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+            <el-form-item label="鍗曟嵁鏃ユ湡" style="display: flex;">
+              <!--              <el-select v-model="form.orderdate" style="width: 200px" placeholder="璇烽�夋嫨">-->
+              <!--                <el-date-picker-->
+              <!--                  v-model="form.orderdate"-->
+              <!--                  style="width: 200px"-->
+              <!--                  type="date"-->
+              <!--                  placeholder="閫夋嫨鏃ユ湡"-->
+              <!--                />-->
+              <!--              </el-select>-->
+              <el-date-picker
+                v-model="form.orderdate"
+                style="width: 200px"
+                type="date"
+                placeholder="閫夋嫨鏃ユ湡"
+              />
+            </el-form-item>
+            <el-form-item v-show="isExpandForm" label="婧愬崟鍗曞彿" style="display: flex;">
+              <el-input v-model="form.sourceorder" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+            <el-form-item v-show="isExpandForm" label="閮ㄩ棬淇℃伅" style="display: flex;">
+              <el-cascader
+                ref="cascader"
+                filterable
+                popper-class="elCascader"
+                :options="deptcodeArr"
+                :props="defaultProps"
+                @change="cascaderChange"
+              />
+            </el-form-item>
+            <el-form-item v-show="isExpandForm" label="鍒涘缓浜哄憳" style="display: flex;">
+              <el-input v-model="form.creatuser" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+            <el-form-item v-show="isExpandForm" label="鍒涘缓鏃堕棿" style="display: flex;">
+              <el-date-picker
+                v-model="form.createdate"
+                style="width: 200px"
+                type="date"
+                placeholder="閫夋嫨鏃ユ湡"
+              />
+            </el-form-item>
+          </div>
+          <div class="bodySearchReset" :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}">
+            <el-button v-waves type="primary" icon="el-icon-search" @click="search">鏌ヨ</el-button>
+            <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
+          </div>
+        </el-form>
+        <div
+          class="bodyTopFormExpand"
+        >
+          <svg-icon
+            v-show="mouseHoverType==='mouseout'"
+            style="cursor: pointer"
+            :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"
+            @mouseenter="mouseHoverType=$event.type"
+          />
+          <svg-icon
+            v-show="mouseHoverType==='mouseenter'"
+            style="cursor: pointer"
+            :icon-class="!isExpandForm?'doubleDown':'doubleUp'"
+            @click="isExpandForm=!isExpandForm"
+            @mouseout="mouseHoverType=$event.type"
+          />
+        </div>
+      </div>
+
+      <div class="elTableDiv">
+        <el-table
+          ref="tableDataRef"
+          class="tableFixed"
+          :data="tableData"
+          :height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
+          border
+          :row-class-name="tableRowClassName"
+          :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}"
+          highlight-current-row
+          :header-cell-style="this.$headerCellStyle"
+          :cell-style="this.$cellStyle"
+          @sort-change="sortChange"
+        >
+          <el-table-column
+            prop="RowNum"
+            width="50"
+            fixed
+            label="搴忓彿"
+          />
+          <el-table-column
+            prop="status"
+            label="璁㈠崟鐘舵��"
+            width="110"
+            sortable="custom"
+          />
+          <el-table-column
+            prop="orderdate"
+            label="鍗曟嵁鏃ユ湡"
+            sortable="custom"
+            width="110"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.orderdate">{{ row.orderdate.substring(0, 11) }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="ordercode"
+            label="璁㈠崟缂栧彿"
+            sortable="custom"
+            width="160"
+            show-tooltip-when-overflow
+          />
+          <el-table-column
+            prop="deptname"
+            label="閮ㄩ棬鍚嶇О"
+            width="130"
+            show-tooltip-when-overflow
+            sortable="custom"
+          />
+          <el-table-column
+            prop="customername"
+            label="寰�鏉ュ崟浣�"
+            sortable="custom"
+            min-width="180"
+            show-tooltip-when-overflow
+          />
+          <el-table-column
+            prop="saleorderCode"
+            label="婧愬崟鍗曞彿"
+            sortable="custom"
+            width="160"
+            show-tooltip-when-overflow
+          />
+          <el-table-column
+            prop="acceptdate"
+            label="棰勮鍒拌揣鏃ユ湡"
+            width="130"
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.acceptdate">{{ row.acceptdate.substring(0, 11) }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="lm_user"
+            label="鍒涘缓浜哄憳"
+            sortable="custom"
+            width="110"
+          />
+          <el-table-column
+            prop="lm_date"
+            label="鍒涘缓鏃堕棿"
+            width="110"
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.lm_date">{{ row.lm_date.substring(0, 11) }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="auditoruser"
+            label="瀹℃牳浜�"
+            width="110"
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.auditoruser">{{ row.auditoruser }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="auditordate"
+            label="瀹℃牳鏃堕棿"
+            width="110"
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              <div v-if="row.auditordate">{{ row.auditordate.substring(0, 11) }}</div>
+              <div v-else>/</div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="鎿嶄綔"
+            width="120"
+            fixed="right"
+          >
+            <template slot-scope="{row}">
+              <div class="operationClass">
+                <el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">
+                  <i class="el-icon-edit-outline" @click="edit('edit',row)" />
+                </el-tooltip>
+                <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
+                  <i class="el-icon-delete" @click="del(row)" />
+                </el-tooltip>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <!--鍒嗛〉-->
+      <pagination
+        :total="total"
+        :page.sync="form.page"
+        :limit.sync="form.rows"
+        align="right"
+        layout="total,prev, pager, next,sizes"
+        popper-class="select_bottom"
+        @pagination="getPurchaseOrderSearch"
+      />
+    </div>
+
+  </div>
+</template>
+
+<script>
+import Pagination from '@/components/Pagination'
+import {
+  AddUpdateOrganization,
+  DeleteOrganization,
+  OrganizationSearch,
+  PrentOrganization,
+  UserOrganization
+} from '@/api/jcsz'
+import clearAllChildren, { validateCode } from '@/utils/global'
+import waves from '@/directive/waves'
+import { SeaveSearchErpOrder, SeaveSearchErpPurchaseOrder } from '@/api/ErpSyncMes'
+import { PurchaseOrderSearch } from '@/api/cggl'
+
+export default {
+  name: 'Zzjg',
+  components: {
+    Pagination
+  },
+  directives: { waves },
+  data() {
+    return {
+      mouseHoverType: 'mouseout',
+      isExpandForm: false,
+      mainHeight: 0,
+      tableHeight: 0,
+      form: {
+        mesorderstus: '', // 璁㈠崟鐘舵��
+        mesordercode: '', // 璁㈠崟缂栧彿
+        customercode: '', // 渚涙柟缂栧彿
+        orderdate: '', // 鍗曟嵁鏃ユ湡
+        sourceorder: '', // 婧愬崟鍗曞彿
+        deptcode: '', // 閮ㄩ棬缂栫爜
+        creatuser: '', // 鍒涘缓浜哄憳
+        createdate: '', // 鍒涘缓鏃堕棿
+        prop: 'lm_date', // 鎺掑簭瀛楁
+        order: 'desc', // 鎺掑簭瀛楁
+        page: 1, // 绗嚑椤�
+        rows: 20 // 姣忛〉澶氬皯鏉�
+      },
+      mesorderstusArr: [
+        { label: '鏂拌鍗�', value: 'NEW' },
+        { label: '閮ㄥ垎鍒拌揣', value: 'BINARIVE' },
+        { label: '宸插埌璐�', value: 'INARIVE' },
+        { label: '閮ㄥ垎鍏ュ簱', value: 'BINSTOG' },
+        { label: '宸插叆搴�', value: 'INSTOG' },
+        { label: '宸插叧闂�', value: 'CLOSED' }
+      ],
+      total: 10,
+      tableData: [],
+      defaultProps: {
+        checkStrictly: true,
+        value: 'code',
+        label: 'name',
+        children: 'children'
+      },
+      deptcodeArr: [] // 閮ㄩ棬淇℃伅
+
+    }
+  },
+
+  created() {
+    this.getPurchaseOrderSearch()
+    this.getUserOrganization()
+  },
+  mounted() {
+    window.addEventListener('resize', this.getHeight)
+    this.getHeight()
+  },
+  methods: {
+    async getPurchaseOrderSearch() {
+      const res = await PurchaseOrderSearch(this.form)
+      this.tableData = res.data
+      this.total = res.count
+    },
+    // 鎺掑簭鏀瑰彉鏃�
+    sortChange({ column, prop, order }) {
+      if (order === 'descending') {
+        order = 'desc'
+      } else if (order === 'ascending') {
+        order = 'asc'
+      } else {
+        order = 'desc'
+      }
+      this.form.order = order
+      this.form.prop = prop
+      this.getPurchaseOrderSearch()
+    },
+    // 鏌ヨ
+    search() {
+      this.getPurchaseOrderSearch()
+    },
+    // 閲嶇疆
+    reset() {
+      this.form.mesorderstus = ''
+      this.form.mesordercode = ''
+      this.form.customercode = ''
+      this.form.orderdate = ''
+      this.form.sourceorder = ''
+      this.form.deptcode = ''
+      this.form.creatuser = ''
+      this.form.createdate = ''
+      this.$refs.cascader.checkedValue = ''// 绾ц仈閫夋嫨鍣ㄧ殑娓呯┖
+      this.getPurchaseOrderSearch()
+    },
+    // 鑾峰彇閮ㄩ棬淇℃伅
+    async getUserOrganization() {
+      const { data: res } = await UserOrganization()
+      this.deptcodeArr = clearAllChildren(res)
+
+      console.log(this.deptcodeArr, 888)
+    },
+    // 绾ц仈閫夋嫨鍣ㄦ敼鍙樹簨浠�
+    cascaderChange(val) {
+      this.form.deptcode = val[val.length - 1]
+    },
+    // 鍒犻櫎鎸夐挳
+    async del(row) {
+      this.$confirm('鏄惁纭鍒犻櫎?', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        DeleteOrganization({ orgid: row.code }).then(res => {
+          if (res.code === '200') {
+            this.$message.success('鍒犻櫎鎴愬姛!')
+            if (this.form.page > 1 && this.tableData.length === 1) {
+              this.form.page--
+            }
+            this.getPurchaseOrderSearch()
+          }
+        })
+      }).catch(() => {
+        this.$message.info('宸插彇娑堝垹闄�')
+      })
+    },
+    // 鍚屾ERP
+    syncERP() {
+      const loading = this.$loading({
+        lock: true,
+        text: '姝e湪鍚屾ERP锛岃绋嶇瓑...',
+        spinner: 'el-icon-loading',
+        customClass: 'osloading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
+
+      SeaveSearchErpPurchaseOrder().then(res => {
+        console.log(res, 11)
+        if (res.code === '200') {
+          setTimeout(() => {
+            this.getPurchaseOrderSearch()
+            loading.close()
+            this.$message.success('鍚屾鎴愬姛锛�')
+          }, 2000)
+        }
+        // else if (res.code === '300') {
+        //   setTimeout(() => {
+        //     loading.close()
+        //     this.$message.error('鍚屾澶辫触锛�')
+        //   }, 10000)
+        // }
+      })
+    },
+    // 鑾峰彇椤甸潰楂樺害
+    getHeight() {
+      this.$nextTick(() => {
+        this.mainHeight = window.innerHeight - 85
+        this.tableHeight = this.mainHeight - 255
+        this.$refs.tableDataRef.doLayout()
+      })
+    },
+    tableRowClassName({ row, rowIndex }) {
+      return 'custom-row'
+    }
+  }
+}
+</script>
+
+<!--鍏叡椤甸潰鏍峰紡-->
+<style lang="scss" scoped>
+$main_color: #42b983;
+::v-deep .el-button--text{
+  font-size: 14px ;
+  cursor: pointer ;
+}
+.el-icon-share ,.el-icon-delete,.el-icon-edit-outline{
+  color: $main_color;
+  cursor: pointer;
+}
+.el-icon-edit-outline{
+  margin-right: 15px;
+}
+
+::v-deep .el-button--primary, .el-button--default, .el-button--info {
+  height: 34px;
+  display: flex;
+  align-items: center;
+  padding: 0 15px;
+}
+
+::v-deep .el-button--primary {
+  //background-color: $main_color !important;
+}
+
+::v-deep .el-button--default {
+  background-color: #f8f8fa;
+  border: none;
+}
+
+::v-deep .el-input__inner {
+  height: 34px;
+  line-height: 34px;
+  //color: #a7a7a7;
+}
+
+::v-deep .el-dialog__body {
+  padding: 20px 100px !important;
+}
+
+::v-deep .dialogVisibleRoles .el-dialog__body {
+  padding: 20px 20px !important;
+}
+
+::v-deep .importPickerClass .el-dialog__body {
+  padding: 20px 20px !important;
+}
+
+::v-deep .el-dialog__footer {
+  display: flex;
+  justify-content: flex-end;
+}
+
+::v-deep .el-table .caret-wrapper {
+  transform: scale(0.8);
+}
+
+::v-deep .cell {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+::v-deep .el-table::before {
+  height: 0;
+}
+
+::v-deep .el-table__body-wrapper {
+  background-color: #f8f8fa;
+}
+
+::v-deep .el-table__body .el-table__row.hover-row td{
+  background-color: #eaecef ;
+}
+
+::v-deep .el-form--inline .el-form-item__label {
+  color: #a7a7a7;
+}
+
+.body ::v-deep .el-divider {
+  border: 1px solid #eee;
+  width: 99%;
+  margin: 10px auto;
+}
+
+.body ::v-deep .el-form-item {
+  margin-bottom: 0;
+}
+
+.userDialogVisible ::v-deep .el-form-item {
+  margin-bottom: 0;
+}
+
+::v-deep .el-select__caret{
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.tableFixed{
+  ::v-deep .el-table__fixed-right{
+    height: 100% !important;
+  }
+  ::v-deep .el-table__fixed{
+    height: 100% !important;
+  }
+}
+</style>
+<style>
+
+.el-table .custom-row {
+  background: #f8f8fa;
+}
+</style>

--
Gitblit v1.9.3