Forráskód Böngészése

采购-预留:预留基础表开发

001295 1 éve
szülő
commit
091adcfdd0

+ 53 - 0
src/api/purchase/ownershipClose.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 列表
+export function list(query) {
+  return request({
+    url: '/pu/ownershipClose/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 详细
+export function detail(id) {
+  return request({
+    url: '/pu/ownershipClose/' + id,
+    method: 'get'
+  })
+}
+
+// 新增
+export function insert(data) {
+  return request({
+    url: '/pu/ownershipClose',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改
+export function update(data) {
+  return request({
+    url: '/pu/ownershipClose',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除
+export function del(id) {
+  return request({
+    url: '/pu/ownershipClose/' + id,
+    method: 'delete'
+  })
+}
+
+// 物料一级分类列表
+export function oneClassList() {
+  return request({
+    url: '/pu/ownershipClose/oneClassList',
+    method: 'get',
+  })
+}
+

+ 45 - 0
src/api/purchase/ownershipCp.js

@@ -0,0 +1,45 @@
+import request from '@/utils/request'
+
+// 列表
+export function list(query) {
+  return request({
+    url: '/pu/ownershipCp/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 详细
+export function detail(id) {
+  return request({
+    url: '/pu/ownershipCp/' + id,
+    method: 'get'
+  })
+}
+
+// 新增
+export function insert(data) {
+  return request({
+    url: '/pu/ownershipCp',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改
+export function update(data) {
+  return request({
+    url: '/pu/ownershipCp',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除
+export function del(id) {
+  return request({
+    url: '/pu/ownershipCp/' + id,
+    method: 'delete'
+  })
+}
+

+ 45 - 0
src/api/purchase/ownershipLot.js

@@ -0,0 +1,45 @@
+import request from '@/utils/request'
+
+// 列表
+export function list(query) {
+  return request({
+    url: '/pu/ownershipLot/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 详细
+export function detail(id) {
+  return request({
+    url: '/pu/ownershipLot/' + id,
+    method: 'get'
+  })
+}
+
+// 新增
+export function insert(data) {
+  return request({
+    url: '/pu/ownershipLot',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改
+export function update(data) {
+  return request({
+    url: '/pu/ownershipLot',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除
+export function del(id) {
+  return request({
+    url: '/pu/ownershipLot/' + id,
+    method: 'delete'
+  })
+}
+

+ 1 - 0
src/views/business/ehr/pm/adjustMark/index.vue

@@ -197,6 +197,7 @@ export default {
           this.adjustlogForm.performanceId = this.form.id;
           addAdjustlog(this.adjustlogForm).then(response => {
             this.$modal.msgSuccess("保存成功");
+            this.adjustlogForm = {};
             this.formOpen = false;
             this.getList();
           });

+ 263 - 0
src/views/purchase/ownershipClose/index.vue

@@ -0,0 +1,263 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" label-width="68px">
+      <el-row >
+        <el-col :span="18">
+          <el-form-item label="一级分类">
+            <el-select
+              size="mini"
+              v-model="queryParams.oneClass"
+              placeholder=""
+              clearable
+            >
+              <el-option
+                v-for="dict in oneClass"
+                :key="dict.id"
+                :label="dict.materialType"
+                :value="dict.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item  style="float:right">
+            <el-button type="primary" icon="el-icon-search" size="mini" @click="btnQuery">搜索</el-button>
+            <el-button icon="el-icon-refresh" size="mini" @click="btnResetQuery">重置</el-button>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <div style="float:right">
+        <el-button type="primary" size="mini" @click="btnAdd">新增</el-button>
+      </div>
+    <el-table
+      size="mini"
+      v-loading="loading"
+      :data="list"
+      height="500px"
+    >
+      <el-table-column show-overflow-tooltip width="200" label="序号" align="center" prop="id" />
+      <el-table-column show-overflow-tooltip width="200" label="一级分类名称" align="center" prop="oneClassName" />
+      <el-table-column show-overflow-tooltip width="200" label="一级分类编码" align="center" prop="oneClassCode" />
+      <el-table-column show-overflow-tooltip width="200" label="释放天数" align="center" prop="day" />
+      <el-table-column
+        width="250"
+        label="操作"
+        fixed="right"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="scope">
+          <el-button size="mini" type="text" @click="btnUpdate(scope.row)">修改</el-button>
+          <el-button size="mini" type="text" @click="btnDelete(scope.row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div class="paginationClass">
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+    </div>
+
+    <!-- 添加或修改任务对话框 -->
+    <el-dialog
+      :title="title"
+      :visible.sync="open"
+      width="500px"
+      append-to-body
+      :close-on-click-modal="false"
+      :show-close="false"
+    >
+      <el-form
+        size="mini"
+        ref="form"
+        :model="form"
+        label-width="80px"
+      >
+        <el-form-item label="一级分类">
+          <el-select
+          size="mini"
+          v-model="form.oneClass"
+          placeholder=""
+          clearable
+          @change="change"
+        >
+          <el-option
+            v-for="dict in oneClass"
+            :key="dict.id"
+            :label="dict.materialType"
+            :value="dict.id"
+          ></el-option>
+        </el-select>
+        </el-form-item>
+        <el-form-item label="天数">
+          <el-col :span="8">
+            <el-input type="number" oninput="value=value.replace(/[^0-9.]/g,'')" v-model="form.day"></el-input>
+          </el-col>
+        </el-form-item>
+      </el-form>
+      <div slot="footer">
+        <el-button
+          size="mini"
+          type="primary"
+          @click="submitForm"
+          >确 定</el-button
+        >
+        <el-button size="mini" @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+
+<script>
+import {list,detail,insert,update,del,oneClassList} from '@/api/purchase/ownershipClose.js'
+
+export default {
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 总条数
+      total: 0,
+      // 列表数据
+      list: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        oneClass: null,
+      },
+      // 表单参数
+      form: {
+      },
+      //一级分类列表
+      oneClass:[],
+    };
+  },
+  async created() {
+    await this.getList();
+    let res = await oneClassList();
+    this.oneClass = res.rows;
+  },
+  methods: {
+    /** 查询任务列表 */
+    getList() {
+      this.loading = true;
+      list(this.queryParams).then(response => {
+        this.list = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.form = {};
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        oneClass: null,
+        oneClassCode: null,
+        oneClassName: null,
+        day: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    btnQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    btnResetQuery() {
+      // this.resetForm("queryForm");
+      this.queryParams = {
+        pageNum: 1,
+        pageSize: 10,
+        oneClass: null
+      };
+      this.btnQuery();
+    },
+    /** 修改按钮操作 */
+    btnUpdate(row) {
+      this.reset();
+      const id = row.id;
+      detail(id).then(response => {
+        this.form = {...this.form,...response.data};
+        this.open = true;
+        this.title = "修改";
+      });
+    },
+    /** 提交表单 */
+    submitForm() {
+      if(this.form.id){
+        update(this.form).then(response => {
+          this.$modal.msgSuccess("修改成功");
+          this.open = false;
+          this.form = {};
+          this.getList();
+        });
+      }else{
+        insert(this.form).then(response => {
+          this.$modal.msgSuccess("新增成功");
+          this.open = false;
+          this.form = {};
+          this.getList();
+        });
+      }
+    },
+    btnAdd(){
+      this.open = true;
+      this.title = "新增";
+    },
+    change(val){
+      let arr = this.oneClass.filter(o => o.id == val);
+      console.log('arr',arr);
+      this.form.oneClassCode = arr[0].code;
+      this.form.oneClassName = arr[0].materialType;
+    },
+    btnDelete(row){
+      this.$modal.confirm('是否确认删除"' + row.oneClassName + '"数据?').then(function() {
+        return del(row.id);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+.paginationClass {
+  z-index: 500;
+  position: fixed;
+  bottom: 10px;
+  right: 10px;
+  width: 100%;
+  line-height: var(--footer-height);
+  color: #fff;
+}
+</style>

+ 256 - 0
src/views/purchase/ownershipCp/index.vue

@@ -0,0 +1,256 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" label-width="68px">
+      <el-row >
+        <el-col :span="18">
+          <el-form-item label="编码">
+            <el-input v-model="queryParams.code"></el-input>
+          </el-form-item>
+          <el-form-item label="物料">
+            <el-input v-model="queryParams.params.materialNameOrCode"></el-input>
+          </el-form-item>
+          <el-form-item label="客户">
+            <el-input v-model="queryParams.params.customerNameOrCode"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item  style="float:right">
+            <el-button type="primary" icon="el-icon-search" size="mini" @click="btnQuery">搜索</el-button>
+            <el-button icon="el-icon-refresh" size="mini" @click="btnResetQuery">重置</el-button>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <div style="float:right">
+        <el-button type="primary" size="mini" @click="btnAdd">新增</el-button>
+      </div>
+    <el-table
+      size="mini"
+      v-loading="loading"
+      :data="list"
+      height="500px"
+    >
+      <el-table-column show-overflow-tooltip width="200" label="序号" align="center" prop="id" />
+      <el-table-column show-overflow-tooltip width="200" label="编码" align="center" prop="code" />
+      <el-table-column show-overflow-tooltip width="200" label="物料" align="center" prop="materialName" />
+      <el-table-column show-overflow-tooltip width="200" label="物料编码" align="center" prop="materialCode" />
+      <el-table-column show-overflow-tooltip width="200" label="客户" align="center" prop="customerName" />
+      <el-table-column show-overflow-tooltip width="200" label="客户编码" align="center" prop="customerCode" />
+      <el-table-column
+        width="250"
+        label="操作"
+        fixed="right"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="scope">
+          <el-button size="mini" type="text" @click="btnUpdate(scope.row)">修改</el-button>
+          <el-button size="mini" type="text" @click="btnDelete(scope.row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div class="paginationClass">
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+    </div>
+
+    <!-- 添加或修改任务对话框 -->
+    <el-dialog
+      :title="title"
+      :visible.sync="open"
+      width="500px"
+      append-to-body
+      :close-on-click-modal="false"
+      :show-close="false"
+    >
+      <el-form
+        size="mini"
+        ref="form"
+        :model="form"
+        label-width="80px"
+      >
+        <el-form-item label="编码">
+          <el-col :span="8">
+            <el-input v-model="form.code"></el-input>
+          </el-col>
+        </el-form-item>
+        <el-form-item label="物料">
+          <DrPopoverSelectV2
+            size="mini"
+            v-model="form.materialName"
+            valueKey= "name"
+            referName="MATERIAL_PARAM"
+            :dataMapping="{
+              material: 'id',
+              materialCode: 'code',
+            }"
+            :source.sync="form"
+          >
+          </DrPopoverSelectV2>
+        </el-form-item>
+        <el-form-item label="客户">
+          <DrPopoverSelectV2
+            size="mini"
+            v-model="form.customerName"
+            valueKey= "name"
+            referName="CUSTOMER_PARAM"
+            :dataMapping="{
+              customer: 'id',
+              customerCode: 'code',
+            }"
+            :source.sync="form"
+          >
+          </DrPopoverSelectV2>
+        </el-form-item>
+      </el-form>
+      <div slot="footer">
+        <el-button
+          size="mini"
+          type="primary"
+          @click="submitForm"
+          >确 定</el-button
+        >
+        <el-button size="mini" @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+
+<script>
+import {list,detail,insert,update,del} from '@/api/purchase/ownershipCp.js'
+
+export default {
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 总条数
+      total: 0,
+      // 列表数据
+      list: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        code: null,
+        params:{
+          materialNameOrCode: null,
+          customerNameOrCode: null,
+        },
+      },
+      // 表单参数
+      form: {
+      },
+    };
+  },
+  async created() {
+    await this.getList();
+  },
+  methods: {
+    /** 查询任务列表 */
+    getList() {
+      this.loading = true;
+      list(this.queryParams).then(response => {
+        this.list = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.form = {};
+      this.open = false;
+    },
+    /** 搜索按钮操作 */
+    btnQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    btnResetQuery() {
+      this.queryParams = {
+        pageNum: 1,
+        pageSize: 10,
+        code: null,
+        params:{
+          materialNameOrCode: null,
+          customerNameOrCode: null,
+        },
+      };
+      this.btnQuery();
+    },
+    /** 修改按钮操作 */
+    btnUpdate(row) {
+      const id = row.id;
+      detail(id).then(response => {
+        this.form = {...this.form,...response.data};
+        this.open = true;
+        this.title = "修改";
+      });
+    },
+    /** 提交表单 */
+    submitForm() {
+      if(this.form.id){
+        update(this.form).then(response => {
+          this.$modal.msgSuccess("修改成功");
+          this.open = false;
+          this.form = {};
+          this.getList();
+        });
+      }else{
+        insert(this.form).then(response => {
+          this.$modal.msgSuccess("新增成功");
+          this.open = false;
+          this.form = {};
+          this.getList();
+        });
+      }
+    },
+    btnAdd(){
+      this.open = true;
+      this.title = "新增";
+    },
+    btnDelete(row){
+      this.$modal.confirm('是否确认删除"' + row.code + "+" + row.materialName + "+" + row.customerName + '"数据?').then(function() {
+        return del(row.id);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+.paginationClass {
+  z-index: 500;
+  position: fixed;
+  bottom: 10px;
+  right: 10px;
+  width: 100%;
+  line-height: var(--footer-height);
+  color: #fff;
+}
+</style>

+ 247 - 0
src/views/purchase/ownershipLot/index.vue

@@ -0,0 +1,247 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="mini" :inline="true" label-width="68px">
+      <el-row >
+        <el-col :span="18">
+          <el-form-item label="物料">
+            <el-input v-model="queryParams.params.materialNameOrCode"></el-input>
+          </el-form-item>
+          <el-form-item label="客户">
+            <el-input v-model="queryParams.params.customerNameOrCode"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item  style="float:right">
+            <el-button type="primary" icon="el-icon-search" size="mini" @click="btnQuery">搜索</el-button>
+            <el-button icon="el-icon-refresh" size="mini" @click="btnResetQuery">重置</el-button>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <div style="float:right">
+        <el-button type="primary" size="mini" @click="btnAdd">新增</el-button>
+      </div>
+    <el-table
+      size="mini"
+      v-loading="loading"
+      :data="list"
+      height="500px"
+    >
+      <el-table-column show-overflow-tooltip width="200" label="序号" align="center" prop="id" />
+      <el-table-column show-overflow-tooltip width="200" label="物料" align="center" prop="materialName" />
+      <el-table-column show-overflow-tooltip width="200" label="物料编码" align="center" prop="materialCode" />
+      <el-table-column show-overflow-tooltip width="200" label="客户" align="center" prop="customerName" />
+      <el-table-column show-overflow-tooltip width="200" label="客户编码" align="center" prop="customerCode" />
+      <el-table-column
+        width="250"
+        label="操作"
+        fixed="right"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
+        <template slot-scope="scope">
+          <el-button size="mini" type="text" @click="btnUpdate(scope.row)">修改</el-button>
+          <el-button size="mini" type="text" @click="btnDelete(scope.row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div class="paginationClass">
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+    </div>
+
+    <!-- 添加或修改任务对话框 -->
+    <el-dialog
+      :title="title"
+      :visible.sync="open"
+      width="500px"
+      append-to-body
+      :close-on-click-modal="false"
+      :show-close="false"
+    >
+      <el-form
+        size="mini"
+        ref="form"
+        :model="form"
+        label-width="80px"
+      >
+        <el-form-item label="物料">
+          <DrPopoverSelectV2
+            size="mini"
+            v-model="form.materialName"
+            valueKey= "name"
+            referName="MATERIAL_PARAM"
+            :dataMapping="{
+              material: 'id',
+              materialCode: 'code',
+            }"
+            :source.sync="form"
+          >
+          </DrPopoverSelectV2>
+        </el-form-item>
+        <el-form-item label="客户">
+          <DrPopoverSelectV2
+            size="mini"
+            v-model="form.customerName"
+            valueKey= "name"
+            referName="CUSTOMER_PARAM"
+            :dataMapping="{
+              customer: 'id',
+              customerCode: 'code',
+            }"
+            :source.sync="form"
+          >
+          </DrPopoverSelectV2>
+        </el-form-item>
+      </el-form>
+      <div slot="footer">
+        <el-button
+          size="mini"
+          type="primary"
+          @click="submitForm"
+          >确 定</el-button
+        >
+        <el-button size="mini" @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+
+<script>
+import {list,detail,insert,update,del} from '@/api/purchase/ownershipLot.js'
+
+export default {
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 总条数
+      total: 0,
+      // 列表数据
+      list: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        code: null,
+        params:{
+          materialNameOrCode: null,
+          customerNameOrCode: null,
+        },
+      },
+      // 表单参数
+      form: {
+      },
+    };
+  },
+  async created() {
+    await this.getList();
+  },
+  methods: {
+    /** 查询任务列表 */
+    getList() {
+      this.loading = true;
+      list(this.queryParams).then(response => {
+        this.list = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.form = {};
+      this.open = false;
+    },
+    /** 搜索按钮操作 */
+    btnQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    btnResetQuery() {
+      this.queryParams = {
+        pageNum: 1,
+        pageSize: 10,
+        code: null,
+        params:{
+          materialNameOrCode: null,
+          customerNameOrCode: null,
+        },
+      };
+      this.btnQuery();
+    },
+    /** 修改按钮操作 */
+    btnUpdate(row) {
+      const id = row.id;
+      detail(id).then(response => {
+        this.form = {...this.form,...response.data};
+        this.open = true;
+        this.title = "修改";
+      });
+    },
+    /** 提交表单 */
+    submitForm() {
+      if(this.form.id){
+        update(this.form).then(response => {
+          this.$modal.msgSuccess("修改成功");
+          this.open = false;
+          this.form = {};
+          this.getList();
+        });
+      }else{
+        insert(this.form).then(response => {
+          this.$modal.msgSuccess("新增成功");
+          this.open = false;
+          this.form = {};
+          this.getList();
+        });
+      }
+    },
+    btnAdd(){
+      this.open = true;
+      this.title = "新增";
+    },
+    btnDelete(row){
+      this.$modal.confirm('是否确认删除"' + row.materialName + "+" + row.customerName + '"数据?').then(function() {
+        return del(row.id);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    }
+  }
+};
+</script>
+
+<style lang="scss" scoped>
+.btn_grooup {
+  margin-bottom: 10px;
+  display: flex;
+  justify-content: flex-end;
+}
+.paginationClass {
+  z-index: 500;
+  position: fixed;
+  bottom: 10px;
+  right: 10px;
+  width: 100%;
+  line-height: var(--footer-height);
+  color: #fff;
+}
+</style>