Browse Source

新增价格申报单

002390 2 years ago
parent
commit
c587161726

+ 14 - 0
src/api/business/purchase/priceDeclaration.js

@@ -0,0 +1,14 @@
+import request from '@/utils/request'
+
+// 采购需求单列表
+const getPriceApplyList = (data) => {
+  return request({
+    url: `/pu/priceApply/list?pageSize=${data.pageSize}&pageNum=${data.pageNum}`,
+    method: 'post',
+    data: data
+  })
+}
+
+export default {
+  getPriceApplyList,
+}

+ 163 - 0
src/views/purchase/priceDeclaration/add-price-declaration.vue

@@ -0,0 +1,163 @@
+<!-- 价格申报单-新增 -->
+<template>
+  <el-drawer title="我是标题" direction="btt" size="100%" :with-header="false" :visible.sync="visible"
+    :before-close="handleClose">
+    <el-form size="mini" label-position="right" label-width="125px" :model="params">
+      <el-card class="add-pd-content" :body-style="{
+          padding: '20px',
+          display: 'flex',
+          'flex-wrap': 'wrap',
+        }">
+        <el-form-item v-for="(column, index) in columns" :key="index" :prop="column.key" :label="column.title"
+          :required="column.required" style="width: 33%">
+
+          <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
+            style="width: 90%"></el-input>
+
+          <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]" controls-position="right"
+            :placeholder="column.placeholder" style="width: 90%"></el-input-number>
+
+          <el-select v-if="column.type === 'TagSelect'" v-model="params[column.key]" multiple clearable collapse-tags
+            :placeholder="column.placeholder" style="width: 90%">
+            <template #prefix>
+              <el-icon class="el-icon-s-operation" style="cursor: pointer" @click.stop="$message.info(234)"></el-icon>
+            </template>
+            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+            </el-option>
+          </el-select>
+
+          <el-date-picker v-if="column.type === 'DatePicker'" v-model="params[column.key]" :type="column.config.type"
+            :placeholder="column.placeholder" :picker-options="column.pickerOptions" style="width: 90%">
+          </el-date-picker>
+        </el-form-item>
+      </el-card>
+      <el-card class="add-pd-option" :body-style="{
+          'text-align': 'right',
+          padding: '10px 20px',
+        }">
+        <el-button size="mini" @click="setVisible(false)">取消</el-button>
+        <el-button size="mini" type="info" @click="setVisible(false)">保存并新增</el-button>
+        <el-button size="mini" type="danger" @click="setVisible(false)">保存</el-button>
+      </el-card>
+    </el-form>
+  </el-drawer>
+</template>
+
+<script>
+export default {
+  name: 'addPriceDeclaration',
+  data() {
+    const arr2Obj = function (data, keyName, valueName) {
+      return Object.fromEntries(
+        data.map((item) => [item[keyName], item[valueName]])
+      );
+    };
+    const pickerOptions = {
+      disabledDate(time) {
+        return time.getTime() > Date.now();
+      },
+      shortcuts: [
+        {
+          text: "今天",
+          onClick(picker) {
+            picker.$emit("pick", new Date());
+          },
+        },
+        {
+          text: "昨天",
+          onClick(picker) {
+            const date = new Date();
+            date.setTime(date.getTime() - 3600 * 1000 * 24);
+            picker.$emit("pick", date);
+          },
+        },
+        {
+          text: "一周前",
+          onClick(picker) {
+            const date = new Date();
+            date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
+            picker.$emit("pick", date);
+          },
+        },
+      ],
+    };
+
+    const columns = [
+      { key: "id", title: "id", type: "Input", },
+      { key: "status", title: "单据状态" },
+      { key: "priceName", title: "价格名称" },
+      { key: "supplier", title: "供应商" },
+      { key: "supplierName", title: "供应商名称" },
+      { key: "puOrg", title: "采购组织" },
+      { key: "puOrgName", title: "采购组织名称" },
+      { key: "currency", title: "币种" },
+      { key: "currencyName", title: "币种名称" },
+      { key: "explain", title: "价格合理性说明" },
+      { key: "buyer", title: "采购员" },
+      { key: "buyerName", title: "采购员名称" },
+      { key: "puDept", title: "采购部门" },
+      { key: "puDeptName", title: "采购部门名称" },
+      { key: "sourceType", title: "来源单据类型" },
+      { key: "source", title: "来源单据号" },
+      { key: "isEffective", title: "是否已推价格" },
+      { key: "effectiveDate", title: "生效日期" },
+      { key: "file", title: "附件" },
+      { key: "tenantId", title: "租户号" },
+      { key: "revision", title: "乐观锁" },
+      { key: "createByName", title: "创建人名称" },
+      { key: "updateByName", title: "更新人" },
+      { key: "delFlag", title: "删除标记" }
+    ];
+    const initColumns = () => columns;
+    const initParams = () => arr2Obj(initColumns(), "key", "value");
+
+    return {
+      visible: false,
+      columns: initColumns(),
+      params: initParams(),
+      options: [
+        {
+          value: "选项1",
+          label: "黄金糕",
+        },
+        {
+          value: "选项2",
+          label: "双皮奶",
+        },
+        {
+          value: "选项3",
+          label: "蚵仔煎",
+        },
+        {
+          value: "选项4",
+          label: "龙须面",
+        },
+        {
+          value: "选项5",
+          label: "北京烤鸭",
+        },
+      ],
+    }
+  },
+  methods: {
+    setVisible(prop) {
+      this.visible = prop;
+    },
+    handleClose() { },
+  },
+  created() { },
+}
+</script>
+
+.add-pd-content {
+  margin: 10px
+}
+
+.add-pd-option {
+  position: fixed;
+  left: 0;
+  bottom: 0;
+  margin: 10px;
+  width: calc(100% - 20px);
+}}
+</style>

+ 342 - 0
src/views/purchase/priceDeclaration/index.vue

@@ -0,0 +1,342 @@
+<!-- 价格申报单-列表 -->
+<template>
+  <el-card v-loading="loading" class="priceDeclaration" :body-style="{ padding: 0 }">
+
+    <!-- 检索 -->
+    <el-form size="mini" label-position="right" label-width="85px" :model="searchParams" style="padding: 20px 0 0 0">
+      <el-row :gutter="24">
+        <el-col :span="22">
+          <el-row :gutter="20">
+            <el-col v-for="column in showSearchColumns" :key="column.title" :xl="6" :lg="6" :md="8" :sm="12" :xs="24">
+              <el-form-item :prop="column.key" :label="column.title">
+                <el-input v-model="searchParams[column.key]" :placeholder="column.placeholder"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-col>
+        <el-col :span="2">
+          <el-row :gutter="24">
+            <el-col :span="24">
+              <el-button type="primary" size="mini">搜索</el-button>
+            </el-col>
+            <el-col v-show="!isSimpleSearch" :span="24" style="margin: 10px 0 0">
+              <el-button size="mini">重置</el-button>
+            </el-col>
+          </el-row>
+        </el-col>
+      </el-row>
+    </el-form>
+    <el-divider>
+      <i :class="isSimpleSearch ? 'el-icon-arrow-down' : 'el-icon-arrow-up'" style="cursor: pointer"
+        @click="handleSearchChange"></i>
+    </el-divider>
+
+
+    <!-- 操作 -->
+    <el-row :gutter="24" style="padding: 0 20px">
+      <!-- <el-col :span="6">  </el-col> -->
+      <el-col :span="24" style="text-align: right">
+        <el-button size="mini" type="danger">新增</el-button>
+        <el-button-group>
+          <el-dropdown>
+            <el-button size="mini">
+              导入<i class="el-icon-arrow-down el-icon--right"></i>
+            </el-button>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item>导入</el-dropdown-item>
+              <el-dropdown-item>模板下载</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+          <el-dropdown>
+            <el-button size="mini">
+              导出<i class="el-icon-arrow-down el-icon--right"></i>
+            </el-button>
+            <el-dropdown-menu slot="dropdown">
+              <el-dropdown-item>Excel导出</el-dropdown-item>
+              <el-dropdown-item>导出明细</el-dropdown-item>
+            </el-dropdown-menu>
+          </el-dropdown>
+        </el-button-group>
+
+        <el-button-group>
+          <el-button size="mini">删除</el-button>
+          <el-button size="mini">打印</el-button>
+          <el-button size="mini">下载</el-button>
+        </el-button-group>
+      </el-col>
+    </el-row>
+
+
+    <el-container>
+      <el-main>
+        <!-- 主信息 -->
+        <el-table class="pd_mainTable" :data="tableData" size="mini" @row-dblclick="handleOpenDetails">
+          <el-table-column type="selection" width="35" />
+          <el-table-column v-for="(column, index) in tableColumns" :key="index" :prop="column.key" :label="column.title"
+            :width="column.width || 180" :show-overflow-tooltip="column.showOverflowTooltip || true">
+          </el-table-column>
+          <!-- 操作 -->
+          <el-table-column label="操作" width="100">
+            <template slot-scope="scope">
+              <el-button size="mini" type="text" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
+              <el-button size="mini" type="text" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <!-- 分页 -->
+        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :total="total"
+          :page-sizes="pageSizes" :page-size="page.pageSize" :current-page="page.pageNum" hide-on-single-page
+          layout="total, prev, pager, next, sizes, jumper">
+        </el-pagination>
+
+        <!-- 附表格 -->
+        <el-tabs class="pd_tabs" v-model="activeName" @tab-click="handleTabClick">
+          <el-tab-pane v-for="v in viceTable" :label="v.title" :name="v.name">
+
+            <el-table class="pd_viceTable" :data="viceData" size="mini">
+              <el-table-column type="index" width="35" />
+              <el-table-column v-for="(column, index) in v.columns" :key="index" :prop="column.key" :label="column.title"
+                :width="column.width || 180" :show-overflow-tooltip="column.showOverflowTooltip || true">
+              </el-table-column>
+            </el-table>
+          </el-tab-pane>
+        </el-tabs>
+      </el-main>
+    </el-container>
+
+  </el-card>
+</template>
+
+<script>
+import declaration from '@/api/business/purchase/priceDeclaration'
+
+export default {
+  data() {
+    const arr2Obj = function (data, keyName, valueName) {
+      return Object.fromEntries(
+        data.map((item) => [item[keyName], item[valueName]])
+      );
+    };
+    // 检索列
+    const searchColumns = [
+      // { key: "id", title: "id", type: '' },
+      // { key: "status", title: "单据状态" },
+      // { key: "priceName", title: "价格名称" },
+      // { key: "supplier", title: "供应商" },
+      // { key: "supplierName", title: "供应商名称" },
+      { key: "puOrg", title: "采购组织" },
+      // { key: "puOrgName", title: "采购组织名称" },
+      // { key: "currency", title: "币种" },
+      // { key: "currencyName", title: "币种名称" },
+      // { key: "explain", title: "价格合理性说明" },
+      { key: "buyer", title: "采购员" },
+      // { key: "buyerName", title: "采购员名称" },
+      { key: "puDept", title: "采购部门" },
+      // { key: "puDeptName", title: "采购部门名称" },
+      // { key: "sourceType", title: "来源单据类型" },
+      { key: "source", title: "来源单据号" },
+      // { key: "isEffective", title: "是否已推价格" },
+      // { key: "effectiveDate", title: "生效日期" },
+      // { key: "file", title: "附件" },
+      // { key: "tenantId", title: "租户号" },
+      // { key: "revision", title: "乐观锁" },
+      // { key: "createByName", title: "创建人名称" },
+      // { key: "updateByName", title: "更新人" },
+      // { key: "delFlag", title: "删除标记" }
+    ];
+    // 表头
+    const tableHeader = [
+      { key: "id", title: "id" },
+      { key: "status", title: "单据状态" },
+      { key: "priceName", title: "价格名称" },
+      { key: "supplier", title: "供应商" },
+      { key: "supplierName", title: "供应商名称" },
+      { key: "puOrg", title: "采购组织" },
+      { key: "puOrgName", title: "采购组织名称" },
+      { key: "currency", title: "币种" },
+      { key: "currencyName", title: "币种名称" },
+      { key: "explain", title: "价格合理性说明" },
+      { key: "buyer", title: "采购员" },
+      { key: "buyerName", title: "采购员名称" },
+      { key: "puDept", title: "采购部门" },
+      { key: "puDeptName", title: "采购部门名称" },
+      { key: "sourceType", title: "来源单据类型" },
+      { key: "source", title: "来源单据号" },
+      { key: "isEffective", title: "是否已推价格" },
+      { key: "effectiveDate", title: "生效日期" },
+      { key: "file", title: "附件" },
+      { key: "tenantId", title: "租户号" },
+      { key: "revision", title: "乐观锁" },
+      { key: "createByName", title: "创建人名称" },
+      { key: "updateByName", title: "更新人" },
+      { key: "delFlag", title: "删除标记" }
+    ];
+    // 附表
+    const viceTable = [
+      {
+        name: 'materialBasic',
+        title: '物料信息表',
+        columns: [],
+      },
+      {
+        name: 'enforcementScope',
+        title: '执行范围组织',
+        columns: [],
+      },
+    ]
+
+    // 初始化搜索列
+    const initSearchColumns = () => searchColumns;
+    // 初始化搜索参数
+    const initSearchParams = () => arr2Obj(initSearchColumns(), "key", "value");
+    // 初始化表头
+    const initTableHeader = () => tableHeader;
+    // 附表格
+    const initViceTable = () => viceTable;
+
+    return {
+      loading: false,
+      // 简单检索
+      isSimpleSearch: true,
+      // 标签页激活
+      activeName: 'materialBasic',
+      // 检索参数
+      searchParams: {
+        isAsc: "desc",
+        reasonable: "",
+        orderByColumn: "",
+        ...initSearchParams(),
+      },
+      // 检索列
+      searchColumns: initSearchColumns(),
+      // 列表
+      tableColumns: initTableHeader(),
+      // 附表格
+      viceTable: initViceTable(),
+      viceData: [],
+      // 列表数据
+      tableData: [
+        {
+          buyer: '1',
+          buyerName: '1',
+          createByName: '1',
+          currency: '1',
+          currencyName: '1',
+          delFlag: '1',
+          effectiveDate: '1',
+          explain: '1',
+          file: '1',
+          id: '1',
+          isAsc: '1',
+          isEffective: '1',
+          orderByColumn: '1',
+          priceName: '1',
+          puDept: '1',
+          puDeptName: '1',
+          puOrg: '1',
+          puOrgName: '1',
+          reasonable: '1',
+          revision: '1',
+          source: '1',
+          sourceType: '1',
+          status: '1',
+          supplier: '1',
+          supplierName: '1',
+          tenantId: '1',
+          updateByName: '1'
+        }
+      ],
+      page: { pageNum: 1, pageSize: 25 },
+      total: 1,
+      pageSizes: [25, 50, 100],
+    }
+  },
+  computed: {
+    showSearchColumns() {
+      return this.isSimpleSearch
+        ? this.searchColumns.slice(0, 4)
+        : this.searchColumns;
+    },
+  },
+  methods: {
+    // 改变页数大小
+    handleSizeChange() { },
+    // 改变当前页
+    handleCurrentChange() { },
+    // 查询条件改变
+    handleSearchChange() {
+      this.isSimpleSearch = !this.isSimpleSearch;
+      // this.$notify.info({
+      //   title: this.isSimpleSearch ? "Simple Search" : "All Search",
+      // });
+    },
+    // 标签页切换
+    handleTabClick() {
+      console.log(this.activeName, '标签页切换');
+
+    },
+    // 行双击-进入详情
+    handleOpenDetails(row) {
+      console.log(row, '行双击-进入详情');
+    },
+    // 行编辑
+    handleEdit(index, row) {
+      console.log(index, row, '行编辑');
+    },
+    // 行删除
+    handleDelete(index, row) {
+      console.log(index, row, '行删除');
+    },
+    // 查询列表
+    handlePriceApplyList() {
+      let data = {
+        ...this.page,
+        ...this.searchParams,
+      }
+      declaration.getPriceApplyList(data).then(res => {
+        console.log(res, 'res');
+      }).catch(error => {
+
+      })
+    },
+  },
+  created() {
+    console.log(this.searchParams, 'searchParams');
+    // this.handlePriceApplyList();
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.priceDeclaration {
+  width: calc(100% - 24px);
+  height: 100%;
+  margin: 10px;
+
+  .el-main {
+    padding-top: 0px;
+
+
+
+    .pd_mainTable {
+      width: 100%;
+      margin: 20px 0 0 0;
+
+
+    }
+
+    .pd_tabs {
+      margin-top: 20px;
+
+      .pd_viceTable {}
+    }
+  }
+}
+</style>
+
+<style scoped>
+.pd_mainTable>>>.el-table__body-wrapper {
+  max-height: 400px;
+  overflow: auto;
+}
+</style>

+ 11 - 0
src/views/purchase/priceDeclaration/see-price-declaration.vue

@@ -0,0 +1,11 @@
+<!-- 价格申报单-详情 -->
+<template>
+
+</template>
+
+<script>
+export default {
+  name:'seePriceDeclaration',
+
+}
+</script>

+ 19 - 80
src/views/purchase/purchase-task/index.vue

@@ -394,8 +394,8 @@ export default {
         title: this.isSimpleSearch ? "Simple Search" : "All Search",
       });
     },
-    handleSizeChange() {},
-    handleCurrentChange() {},
+    handleSizeChange() { },
+    handleCurrentChange() { },
     handleOpenAddDrawer() {
       const { setVisible } = this.$refs.addDrawerFef;
       setVisible(true);
@@ -415,37 +415,16 @@ export default {
 </script>
 
 <template>
-  <el-card
-    v-loading="loading"
-    style="width: calc(100% - 24px); height: 100%; margin: 10px"
-    :body-style="{ padding: 0 }"
-  >
+  <el-card v-loading="loading" style="width: calc(100% - 24px); height: 100%; margin: 10px" :body-style="{ padding: 0 }">
     <AddPurchaseTaskDrawer ref="addDrawerFef"></AddPurchaseTaskDrawer>
     <SeePurchaseTaskDrawer ref="seeDrawerFef"></SeePurchaseTaskDrawer>
-    <el-form
-      size="mini"
-      label-position="right"
-      label-width="85px"
-      :model="searchParams"
-      style="padding: 20px 0 0 0"
-    >
+    <el-form size="mini" label-position="right" label-width="85px" :model="searchParams" style="padding: 20px 0 0 0">
       <el-row :gutter="24">
         <el-col :span="22">
           <el-row :gutter="20">
-            <el-col
-              v-for="column in showSearchColumns"
-              :key="column.title"
-              :xl="6"
-              :lg="6"
-              :md="8"
-              :sm="12"
-              :xs="24"
-            >
+            <el-col v-for="column in showSearchColumns" :key="column.title" :xl="6" :lg="6" :md="8" :sm="12" :xs="24">
               <el-form-item :prop="column.key" :label="column.title">
-                <el-input
-                  v-model="searchParams[column.key]"
-                  :placeholder="column.placeholder"
-                ></el-input>
+                <el-input v-model="searchParams[column.key]" :placeholder="column.placeholder"></el-input>
               </el-form-item>
             </el-col>
           </el-row>
@@ -455,11 +434,7 @@ export default {
             <el-col :span="24">
               <el-button type="primary" size="mini">搜索</el-button>
             </el-col>
-            <el-col
-              v-show="!isSimpleSearch"
-              :span="24"
-              style="margin: 10px 0 0"
-            >
+            <el-col v-show="!isSimpleSearch" :span="24" style="margin: 10px 0 0">
               <el-button size="mini">重置</el-button>
             </el-col>
           </el-row>
@@ -467,21 +442,13 @@ export default {
       </el-row>
     </el-form>
     <el-divider>
-      <i
-        :class="isSimpleSearch ? 'el-icon-arrow-down' : 'el-icon-arrow-up'"
-        style="cursor: pointer"
-        @click="handleSearchChange"
-      ></i>
+      <i :class="isSimpleSearch ? 'el-icon-arrow-down' : 'el-icon-arrow-up'" style="cursor: pointer"
+        @click="handleSearchChange"></i>
     </el-divider>
     <el-row :gutter="24" style="padding: 0 20px">
       <el-col :span="6">123</el-col>
       <el-col :span="18" style="text-align: right">
-        <el-button
-          size="mini"
-          type="danger"
-          style="margin: 0 10px 0 0"
-          @click="handleOpenAddDrawer"
-        >
+        <el-button size="mini" type="danger" style="margin: 0 10px 0 0" @click="handleOpenAddDrawer">
           新增
         </el-button>
         <el-dropdown placement="bottom-start">
@@ -497,10 +464,7 @@ export default {
         </el-dropdown>
 
         <el-dropdown placement="bottom-start">
-          <el-button
-            size="mini"
-            style="border-right: 0; border-radius: 3px 0 0 3px"
-          >
+          <el-button size="mini" style="border-right: 0; border-radius: 3px 0 0 3px">
             首次协议直采
             <i class="el-icon-arrow-down el-icon--right"></i>
           </el-button>
@@ -521,10 +485,7 @@ export default {
         <el-button size="mini" style="border-right: 0; border-radius: 0">
           Excel导出
         </el-button>
-        <el-button
-          size="mini"
-          style="margin: 0; border-right: 0; border-radius: 0"
-        >
+        <el-button size="mini" style="margin: 0; border-right: 0; border-radius: 0">
           退回请购
         </el-button>
         <el-dropdown placement="bottom-start">
@@ -536,11 +497,7 @@ export default {
             <el-dropdown-item>商超匹配下单</el-dropdown-item>
           </el-dropdown-menu>
         </el-dropdown>
-        <el-button
-          size="mini"
-          disabled
-          style="margin: 0 10px 0 0; border-radius: 0 3px 3px 0"
-        >
+        <el-button size="mini" disabled style="margin: 0 10px 0 0; border-radius: 0 3px 3px 0">
           一键合同下单
         </el-button>
         <el-button size="mini" style="margin: 0 10px 0 0">删除</el-button>
@@ -559,32 +516,14 @@ export default {
         </el-dropdown>
       </el-col>
     </el-row>
-    <el-table
-      @row-dblclick="handleOpenSeeDrawer"
-      :data="tableData"
-      size="mini"
-      style="width: 100%; margin: 20px 0 0 0"
-    >
-      <el-table-column
-        v-for="(column, index) in tableColumns"
-        :key="index"
-        :prop="column.key"
-        :label="column.title"
-        :width="column.width || 180"
-        :show-overflow-tooltip="column.showOverflowTooltip || true"
-      >
+    <el-table @row-dblclick="handleOpenSeeDrawer" :data="tableData" size="mini" style="width: 100%; margin: 20px 0 0 0">
+      <el-table-column v-for="(column, index) in tableColumns" :key="index" :prop="column.key" :label="column.title"
+        :width="column.width || 180" :show-overflow-tooltip="column.showOverflowTooltip || true">
       </el-table-column>
     </el-table>
-    <el-pagination
-      @size-change="handleSizeChange"
-      @current-change="handleCurrentChange"
-      :total="total"
-      :page-sizes="pageSizes"
-      :page-size="page.pageSize"
-      :current-page="page.pageNum"
-      hide-on-single-page
-      layout="total, prev, pager, next, sizes, jumper"
-    >
+    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :total="total"
+      :page-sizes="pageSizes" :page-size="page.pageSize" :current-page="page.pageNum" hide-on-single-page
+      layout="total, prev, pager, next, sizes, jumper">
     </el-pagination>
     <DirectSourcingTable></DirectSourcingTable>
   </el-card>