浏览代码

Merge remote-tracking branch 'origin/dev' into dev

001295 2 年之前
父节点
当前提交
f78f4424d3
共有 29 个文件被更改,包括 1122 次插入581 次删除
  1. 30 1
      src/api/business/purchase/purchase-order.js
  2. 20 2
      src/api/business/purchase/task.js
  3. 34 14
      src/api/marketing/dealer-authorization.js
  4. 1 0
      src/components/Refers/refers.vue
  5. 1 0
      src/components/input-dialog/components/index.vue
  6. 3 0
      src/main.js
  7. 0 11
      src/utils/init/page.js
  8. 54 54
      src/views/marketing/dealer-authorization/authprivAdd.vue
  9. 56 0
      src/views/marketing/dealer-authorization/column.js
  10. 86 105
      src/views/marketing/dealer-authorization/index.vue
  11. 22 0
      src/views/marketing/utils/date.js
  12. 11 0
      src/views/marketing/utils/init.js
  13. 2 0
      src/views/purchase/DemandSummary/index.vue
  14. 73 56
      src/views/purchase/MaterialClassDivision/add.vue
  15. 45 60
      src/views/purchase/MaterialClassDivision/index.vue
  16. 6 1
      src/views/purchase/PurchaseDemandList/add.vue
  17. 59 23
      src/views/purchase/deliveryAddress/add.vue
  18. 0 1
      src/views/purchase/deliveryAddress/index.vue
  19. 14 9
      src/views/purchase/purchase-order/add/column.js
  20. 22 10
      src/views/purchase/purchase-order/add/index.vue
  21. 101 0
      src/views/purchase/purchase-order/column.js
  22. 72 58
      src/views/purchase/purchase-order/edit/index.vue
  23. 120 121
      src/views/purchase/purchase-order/index.vue
  24. 11 7
      src/views/purchase/purchase-order/see/index.vue
  25. 23 10
      src/views/purchase/task/column.js
  26. 169 30
      src/views/purchase/task/first-direct/index.vue
  27. 77 6
      src/views/purchase/task/index.vue
  28. 8 0
      src/views/purchase/transferOrder/add.vue
  29. 2 2
      vue.config.js

+ 30 - 1
src/api/business/purchase/purchase-order.js

@@ -27,10 +27,28 @@ const create = (data) => {
   });
 }
 
+// 采购订单提交
+const submit = (data) => {
+  return request({
+    url: `/pu/order/submit`,
+    method: "post",
+    data,
+  });
+}
+
 // 采购订单编辑
 const edit = (data) => {
   return request({
-    url: `/pu/order/item`,
+    url: `/pu/order`,
+    method: "put",
+    data,
+  });
+}
+
+// 采购订单修订
+const revision = (data) => {
+  return request({
+    url: `/pu/order/revision`,
     method: "put",
     data,
   });
@@ -44,12 +62,23 @@ const remove = (data) => {
   });
 }
 
+// 采购订单-询价
+const getPrice = (data) => {
+  return request({
+    url: `/pu/order/getPrice`,
+    method: "post",
+    data,
+  });
+}
 
 export default {
   list,
   details,
   create,
+  submit,
   edit,
+  revision,
   remove,
+  getPrice,
 
 }

+ 20 - 2
src/api/business/purchase/task.js

@@ -1,7 +1,7 @@
 import request from "@/utils/request";
 
 // 查询任务列表
-export function list(data) {
+export function LIST(data) {
   return request({
     url: "/pu/order/generate/list",
     method: "POST",
@@ -18,10 +18,28 @@ export function item(data) {
 }
 
 // 查询任务列表
-export function FirstDirect(data) {
+export function FIRSTDIRECT(data) {
   return request({
     url: "/pu/order/generate/manualAgreement",
     method: "POST",
     data: data,
   });
 }
+
+// 查询任务列表
+export function ADD(data) {
+  return request({
+    url: "/pu/order/create",
+    method: "POST",
+    data: data,
+  });
+}
+
+// 查询任务列表
+export function SHUTDOWN(data) {
+  return request({
+    url: `/pu/demand/item/summary/shutDown/${data}`,
+    method: "PUT",
+    data: data,
+  });
+}

+ 34 - 14
src/api/marketing/dealer-authorization.js

@@ -4,46 +4,66 @@ import request from '@/utils/request';
 
 
 // 经销商授权信息列表
-const dealerList = (params, page) => {
-
+const list = (params) => {
   return request({
-    url: `dealer/list?pageSize=${page.pageSize}&pageNum=${page.pageNum}`,
+    url: `/dealer/list`,
     method: 'get',
     params,
   })
 }
 
 // 经销商授权信息新增接口
-const dealerInsert = (data) => {
+const insert = (data) => {
   return request({
-    url: `dealer/insert`,
+    url: `/dealer/insert`,
     method: 'post',
     data,
   })
 }
 
 // 经销商授权信息列表
-const dealerDelete = (params) => {
-
+const remove = (params) => {
+// ?id=${params.id}
   return request({
-    url: `dealer/delete?id=${params.id}`,
+    url: `/dealer/delete`,
     method: 'get',
     params,
   })
 }
 
 // 经销商授权信息新增接口
-const dealerUpdate = (data) => {
+const update = (data) => {
+  return request({
+    url: `/dealer/update`,
+    method: 'post',
+    data,
+  })
+}
+
+// 提交OA
+const submitOA = (data) => {
   return request({
-    url: `dealer/update`,
+    url: `/dealer/OA`,
     method: 'post',
     data,
   })
 }
 
+// 下载授权书
+const download = (data) => {
+  return request({
+    url: `/dealer/download`,
+    method: 'post',
+    data,
+  })
+}
+
+
 export default {
-  dealerList,
-  dealerInsert,
-  dealerDelete,
-  dealerUpdate,
+  list,
+  insert,
+  remove,
+  update,
+  submitOA,
+  download,
 }

+ 1 - 0
src/components/Refers/refers.vue

@@ -80,6 +80,7 @@ export default {
       this.visible = true;
       console.log("🚀 ~ file: refers.vue:79 ~ init ~ init(val):", val)
       this.reciveForm = val
+      this.searchForm.search = ''
       this.$nextTick(() => {
         this.dataListAllSelections = JSON.parse(JSON.stringify(this.selectData));
         this.resetSearch();

+ 1 - 0
src/components/input-dialog/components/index.vue

@@ -54,6 +54,7 @@ export default {
             ...prop,
             ...queryParams,
           },
+          
           { pageNum, pageSize }
         );
         if (code === 200) {

+ 3 - 0
src/main.js

@@ -14,6 +14,9 @@ import directive from './directive' // directive
 import plugins from './plugins' // plugins
 import { download } from '@/utils/request'
 
+// 时间格式化方法挂载
+import '@/views/marketing/utils/date';
+
 import './assets/icons' // icon
 import './permission' // permission control
 import { getDicts } from "@/api/system/dict/data";

+ 0 - 11
src/utils/init/page.js

@@ -1,11 +0,0 @@
-const pageSizes = [25, 50, 100];
-
-const layout = "total, prev, pager, next, sizes, jumper";
-
-const page = { pageNum: 1, pageSize: 25, total: 0 };
-
-export const initPageSizes = () => pageSizes;
-
-export const initLayout = () => layout;
-
-export const initPage = () => page;

+ 54 - 54
src/views/marketing/dealer-authorization/authprivAdd.vue

@@ -1,7 +1,7 @@
 <!-- 经销商授权信息 编辑新增-->
 <template>
   <el-dialog :title="isAdd ? '新增' : '编辑'" :visible.sync="visible" :close-on-click-modal="false"
-    :close-on-press-escape="false" :before-close="beforeClose">
+    :close-on-press-escape="false" :before-close="beforeClose" @close="$emit('close')">
     <el-form :model="formData" ref="authprivAdd" label-position="left" label-width="120px" v-loading="loading">
 
       <el-form-item v-for="column in formColumns" :label="column.title" :prop="column.key"
@@ -27,43 +27,30 @@
 </template>
 
 <script>
-import dealerApi from '@/api/marketing/dealer-authorization'
+import dealerApi from '@/api/marketing/dealer-authorization';
+import { FormColumns } from './column';
+import { initParams } from '../utils/init'
+
+const initFormColumns = () =>
+  FormColumns.map((column) => {
+    const clearable = column.clearable || true;
+    return {
+      ...column,
+      clearable,
+    };
+  });
 
 export default {
 
   name: 'authprivAdd',
 
   data() {
-    const arr2Obj = function (data, keyName, valueName) {
-      return Object.fromEntries(
-        data.map((item) => [item[keyName], item[valueName]])
-      );
-    };
-
-    const formColumns = [
-      { title: '经销商名称', key: 'dealerName', type: 'Input' },
-      { title: '授权区/医院', key: 'authorizedAreaName', type: 'Input' },
-      { title: '授权产品', key: 'authorizedProductsName', type: 'Input' },
-      { title: '授权期限', key: 'time', type: 'DateRange' },
-      { title: '授权书开具时间', key: 'issueTime', type: 'Date' },
-    ];
-
-    const initFormColumns = () =>
-      formColumns.map((column) => {
-        const clearable = column.clearable || true;
-        return {
-          ...column,
-          clearable,
-        };
-      });
-
-    const initFormData = () => arr2Obj(initFormColumns(), "key", "value")
 
     return {
       visible: false,
       isAdd: true,
       loading: false,
-      formData: { ...initFormData() },
+      formData: { ...initParams(initFormColumns()) },
       formColumns: initFormColumns(),
 
     }
@@ -71,41 +58,41 @@ export default {
   methods: {
     // 控制弹窗展示
     setVisible(val) {
-
       this.visible = val;
-
     },
     setFormData(data) {
 
-      this.loading = true;
       if (data.id) {
 
+        this.loading = true;
+
+        this.isAdd = false;
+
         let objData = { ...data };
 
         objData['time'] = [objData.startTime, objData.endTime];
 
-        // delete data.startTime
-        // delete data.endTime
         this.formData = objData;
 
+        setTimeout(() => {
+          this.loading = false;
+        }, 250);
+
+        return
       }
 
-      setTimeout(() => {
-        this.loading = false;
-      }, 250);
-      
+      this.isAdd = true;
     },
     // 重置表单数据
     handleResetData() {
-      for (const key in this.formData) {
-        this.formData[key] = '';
+      this.formData = {
+        ...initParams(initFormColumns())
       }
-
       this.$refs['authprivAdd'].clearValidate();
     },
     // 取消
     handleCancel() {
-        this.handleResetData();
+      this.handleResetData();
       this.setVisible(false);
     },
     // 确定
@@ -113,35 +100,48 @@ export default {
 
       console.log(this.formData, 'this.formData');
 
-      this.$refs[formName].validate((valid) => {
+      this.$refs[formName].validate(async (valid) => {
+
         if (valid) {
           // 校验通过
           let isTime = this.formData.time && this.formData.time != '' && this.formData.time.length;
+
+          const { name, id, } = this.$store.state.user;
+
           let params = {
             ...this.formData,
             startTime: isTime ? this.formData.time[0] : '',
             endTime: isTime ? this.formData.time[1] : '',
+            updatePerson: name,
+            updateTime: new Date().Format('yyyy-MM-dd HH:mm:ss'),
+            ...(
+              this.isAdd ? {
+                status: '0',
+                createPerson: name,
+                createTime: new Date().Format('yyyy-MM-dd HH:mm:ss'),
+              } : {}
+            )
+
           }
           delete params['time']
           console.log(params, 'params--------');
 
-          if (this.isAdd) {
-            // 新增
-            dealerApi.dealerInsert(params).then(res => {
-
-            }).catch(error => {
-
-            })
-          } else {
-            // 编辑
-            dealerApi.dealerUpdate(params).then(res => {
+          try {
+            this.loading = true;
+            let { code, msg } = await (this.isAdd ?
+              dealerApi.insert(params) :
+              dealerApi.update(params))
 
-            }).catch(error => {
+            if (code === 200) {
+              this.handleCancel();
+            }
 
-            })
+          } catch (error) {
+            console.log(error, 'error');
+          } finally {
+            this.loading = false;
           }
 
-          // this.setVisible(false);
         } else {
           console.log('error submit!!');
           return false;

+ 56 - 0
src/views/marketing/dealer-authorization/column.js

@@ -0,0 +1,56 @@
+export const TableColumns = [
+  { key: "authorizedProductsCode", title: "授权产品 编码", show: true, width: 160 },
+  { key: "dealerName", title: "经销商名称", show: true, width: 200 },
+  { key: "authorizedAreaCode", title: "授权区域/医院 编码", show: false, },
+  { key: "authorizedAreaName", title: "授权区域/医院 名称", show: true, width: 200 },
+  { key: "authorizedProductsName", title: "授权产品 名称", show: true, width: 200 },
+  { key: "status", title: "状态", show: true },
+  { key: "createPerson", title: "创建人", show: true },
+  { key: "createTime", title: "创建时间", show: true, width: 160 },
+  { key: "updatePerson", title: "最后修改人", show: true },
+  { key: "updateTime", title: "最后修改时间", show: true, width: 160 },
+  { key: "id", title: "主键id----该值不显示", show: false },
+  { key: "startTime", title: "开始时间", show: false },
+  { key: "endTime", title: "结束时间", show: false },
+  { key: "issueTime", title: "授权书开具时间", show: false },
+]
+
+export const SearchColumns = [
+  { key: "dealerName", title: "经销商名称", type: "Input" },
+  { key: "authorizedAreaName", title: "授权区域/医院", type: "Input" },
+  { key: "authorizedProductsName", title: "授权产品", type: "Input" },
+  // 单据状态0=自由态,1=审批中,2=已审核,3=已驳回
+  {
+    key: "status", title: "状态", type: "Select", options: [
+      { value: 0, label: '自由态' },
+      { value: 1, label: '审批中' },
+      { value: 2, label: '已审核' },
+      { value: 3, label: '已驳回' },
+    ]
+  },
+  // { title: "授权时间", key: "time", type: "DateRange" },
+  {
+    title: "授权时间",
+    key: "startTime",
+    type: "Date",
+    config: {
+      placeholder: '开始时间'
+    }
+  },
+  {
+    title: "至",
+    key: "endTime",
+    type: "Date",
+    config: {
+      placeholder: '结束时间'
+    }
+  },
+]
+
+export const FormColumns = [
+  { title: '经销商名称', key: 'dealerName', type: 'Input' },
+  { title: '授权区/医院', key: 'authorizedAreaName', type: 'Input' },
+  { title: '授权产品', key: 'authorizedProductsName', type: 'Input' },
+  { title: '授权期限', key: 'time', type: 'DateRange' },
+  { title: '授权书开具时间', key: 'issueTime', type: 'Date' },
+]

+ 86 - 105
src/views/marketing/dealer-authorization/index.vue

@@ -2,7 +2,7 @@
 <template>
   <el-card class="dealerAuthorization" v-loading="loading" :body-style="{ padding: 0 }">
 
-    <authprivAdd ref="addDialogRef"></authprivAdd>
+    <authprivAdd ref="addDialogRef" @close="handleRefresh"></authprivAdd>
     <authprivSee ref="seeDialogRef"></authprivSee>
 
     <!-- 检索区 -->
@@ -13,14 +13,18 @@
 
         <el-input v-if="column.type == 'Input'" v-model="searchParams[column.key]" clearable></el-input>
 
-        <el-select v-if="column.type == 'Select'" v-model="searchParams[column.key]" clearable>
+        <el-select v-else-if="column.type == 'Select'" v-model="searchParams[column.key]" clearable>
           <el-option v-for="op in column.options" :label="op.label" :value="op.value"></el-option>
         </el-select>
 
-        <el-date-picker v-if="column.type == 'DateRange'" v-model="searchParams[column.key]" clearable type="daterange"
-          format="yyyy-MM-dd " value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期"
+        <el-date-picker v-else-if="column.type == 'DateRange'" v-model="searchParams[column.key]" clearable
+          type="daterange" format="yyyy-MM-dd " value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期"
           end-placeholder="结束日期">
         </el-date-picker>
+
+        <el-date-picker v-else-if="column.type == 'Date'" v-model="searchParams[column.key]" format="yyyy-MM-dd "
+          clearable value-format="yyyy-MM-dd" type="date" :placeholder="column.config.placeholder" style="width: 192px;">
+        </el-date-picker>
       </el-form-item>
 
       <el-form-item>
@@ -36,7 +40,7 @@
       <el-col :span="24" style="text-align: right">
         <el-button size="mini" type="primary" @click="handleOpenAddDialog"
           v-hasPermi="['pu:authorization:add']">新增</el-button>
-        <el-button size="mini" @click="handleSubmit">提交</el-button>
+        <!-- <el-button size="mini" @click="handleSubmit">提交</el-button> -->
         <el-button size="mini" @click="handleDownload">下载授权书</el-button>
       </el-col>
     </el-row>
@@ -44,147 +48,102 @@
     <!-- 数据展示 -->
     <el-table class="da-table" @row-dblclick="handleOpenSeeDialog" @select="handleSelect" :data="tableData"
       highlight-current-row max-height="500">
-      <el-table-column type="selection" width="35"></el-table-column>
+      <el-table-column type="selection" width="45"></el-table-column>
       <el-table-column type="index" width="55" label="序号"></el-table-column>
       <el-table-column v-for="column in tableColumns" :label="column.title" v-if="column.show"
-        :width="column.width || 180">
+        :width="column.width || 120" show-overflow-tooltip>
         <template slot-scope="scope">
           {{ column.key == 'status' ? judgeStatus(scope.row[column.key]) : scope.row[column.key] }}
         </template>
       </el-table-column>
       <el-table-column fixed="right" label="操作" width="120">
         <template slot-scope="scope">
-          <el-button type="text" size="small" @click="handleOpenAddDialog(scope.row)"
+          <el-button type="text" size="mini" @click="handleOpenAddDialog(scope.row)"
             v-hasPermi="['pu:authorization:edit']">编辑</el-button>
-          <el-button type="text" size="small" @click="handleDelDialog(scope.row)"
+          <el-button type="text" size="mini" @click="handleDelDialog(scope.row)"
+            v-if="scope.row.status == '0' || scope.row.status == '3'"
             v-hasPermi="['pu:authorization:remove']">删除</el-button>
-          <el-button @click="handleOpenSeeDialog(scope.row)" type="text" size="small">查看</el-button>
+          <!-- <el-button @click="handleOpenSeeDialog(scope.row)" type="text" size="small">查看</el-button> -->
+          <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'"
+            @click="handleSubmit(scope.row)">提交</el-button>
         </template>
       </el-table-column>
     </el-table>
 
-    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :total="total"
+    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :total="page.total"
       :page-sizes="pageSizes" :page-size="page.pageSize" :current-page="page.pageNum" hide-on-single-page
-      layout="total, prev, pager, next, sizes, jumper">
+      :layout="layout">
     </el-pagination>
 
   </el-card>
 </template>
 
 <script>
-import authprivAdd from './authprivAdd.vue';
-import authprivSee from './authprivSee.vue';
-import dealerApi from '@/api/marketing/dealer-authorization'
+import dealerApi from '@/api/marketing/dealer-authorization';
+import { TableColumns, SearchColumns } from './column';
+import { initParams } from '../utils/init';
 
 export default {
 
   name: 'dealerAuthorization',
   components: {
-    authprivAdd,
-    authprivSee,
+    authprivAdd: () => import('./authprivAdd.vue'),
+    authprivSee: () => import('./authprivSee.vue'),
   },
 
   data() {
-    const arr2Obj = function (data, keyName, valueName) {
-      return Object.fromEntries(
-        data.map((item) => [item[keyName], item[valueName]])
-      );
-    };
-    // 查询条件列
-    const searchColumns = [
-      { key: "dealerName", title: "经销商名称", type: "Input" },
-      { key: "authorizedAreaName", title: "授权区域/医院", type: "Input" },
-      { key: "authorizedProductsName", title: "授权产品", type: "Input" },
-      // 单据状态0=自由态,1=审批中,2=已审核,3=已驳回
-      {
-        key: "status", title: "状态", type: "Select", options: [
-          { value: 0, label: '自由态' },
-          { value: 1, label: '审批中' },
-          { value: 2, label: '已审核' },
-          { value: 3, label: '已驳回' },
-        ]
-      },
-      { title: "授权时间", key: "time", type: "DateRange" },
-    ];
-
-    // 表列
-    const tableColumns = [
-      { key: "authorizedProductsCode", title: "授权产品 编码", show: true },
-      { key: "dealerName", title: "经销商名称", show: true },
-      { key: "authorizedAreaCode", title: "授权区域/医院 编码", show: false },
-      { key: "authorizedAreaName", title: "授权区域/医院 名称", show: true },
-      { key: "authorizedProductsName", title: "授权产品 名称", show: true },
-      { key: "status", title: "状态", show: true },
-      { key: "createPerson", title: "创建人", show: true },
-      { key: "createTime", title: "创建时间", show: true },
-      { key: "updatePerson", title: "最后修改人", show: true },
-      { key: "updateTime", title: "最后修改时间", show: true },
-      { key: "id", title: "主键id----该值不显示", show: false },
-      { key: "startTime", title: "开始时间", show: false },
-      { key: "endTime", title: "结束时间", show: false },
-      { key: "issueTime", title: "授权书开具时间", show: false },
-    ];
-
-    const initTableColumns = () => tableColumns;
-    const initSearchColumns = () => searchColumns;
-    const initSearchParams = () => arr2Obj(initSearchColumns(), "key", "value");
+    const initTableColumns = () => TableColumns;
+    const initSearchColumns = () => SearchColumns;
     return {
       loading: false,
       searchColumns: initSearchColumns(),
       searchParams: {
-        // isAsc: "desc",
-        // reasonable: "",
-        // orderByColumn: "",
-        ...initSearchParams(),
+        ...initParams(initSearchColumns()),
       },
       tableColumns: initTableColumns(),
-      tableData: [
-        {
-          authorizedProductsCode: "授权产品 编码",
-          dealerName: "经销商名称",
-          authorizedAreaCode: "授权区域/医院 编码",
-          authorizedAreaName: "授权区域/医院 名称",
-          authorizedProductsName: "授权产品 名称",
-          status: "0",
-          createPerson: "创建人",
-          createTime: "创建时间",
-          updatePerson: "最后修改人",
-          updateTime: "最后修改时间",
-          id: "主键id----该值不显示",
-          startTime: "2023-01-02",
-          endTime: "2025-01-01",
-          issueTime: "2023-01-02",
-        }
-      ],
+      tableData: [],
       checkedList: [],
-      page: { pageNum: 1, pageSize: 25 },
-      total: 0,
+      page: {
+        pageNum: 1,
+        pageSize: 25,
+        total: 0
+      },
       pageSizes: [10, 20, 50, 100],
+      layout: 'total, prev, pager, next, sizes, jumper',
     }
   },
   methods: {
     // 查询---列表查询
-    handelSearch() {
+    async handelSearch() {
       this.loading = true;
       console.log(this.searchParams, '查询');
-      let isTime = this.searchParams.time && this.searchParams.time != '' && this.searchParams.time.length;
+      // let isTime = this.searchParams.time && this.searchParams.time != '' && this.searchParams.time.length;
+      let { pageNum, pageSize } = this.page;
       let params = {
         ...this.searchParams,
-        startTime: isTime ? this.searchParams.time[0] : '',
-        endTime: isTime ? this.searchParams.time[1] : '',
+        // startTime: isTime ? this.searchParams.time[0] : '',
+        // endTime: isTime ? this.searchParams.time[1] : '',
+        pageNum: pageNum,
+        pageSize: pageSize,
       }
       delete params['time']
       console.log(params, 'params--------');
 
-      dealerApi.dealerList(params, this.page).then(res => {
+      await dealerApi.list(params).then(res => {
         console.log(res, '获取列表');
+        let { code, rows, total } = res;
         this.loading = false;
+        if (code == 200) {
+          this.tableData = rows;
+          this.page.total = total;
+        }
       }).catch(error => {
         this.loading = false;
       })
     },
     // 重置
     handelResetSearch() {
+
       console.log('重置');
 
       for (const key in this.searchParams) {
@@ -217,7 +176,7 @@ export default {
     },
     // 刷新
     handleRefresh() {
-
+      this.handelSearch();
     },
     handleSizeChange(e) {
       this.page.pageSize = e;
@@ -249,38 +208,60 @@ export default {
       setVisible(true);
     },
     // 删除
-    handleDelDialog(rows) {
+    async handleDelDialog(rows) {
       console.log(rows, '删除');
-
-      // dealerApi.dealerDelete().then(res => {
-      //   console.log(res, '删除');
-      // }).catch(error => {
-
-      // })
+      let { id } = rows;
+      try {
+        this.loading = true;
+        let { code, msg } = await dealerApi.remove({ id });
+        if (code == 200) {
+          this.handleRefresh();
+        }
+      } catch (error) {
+        console.log(error);
+      } finally {
+        this.loading = false;
+      }
     },
     // 提交
-    handleSubmit() {
-      console.log('批量提交');
+    handleSubmit(row) {
+
+      console.log(row, '提交');
       let params = {
         id: '',
         status: ''
       }
-      // 编辑
-      // dealerApi.dealerUpdate(params).then(res => {
-      //   console.log(res, '编辑');
+      // try {
+      //   this.loading = true;
+      //   let { code, msg } = await dealerApi.submitOA();
+      //   if (code == 200) {
+      //     this.handleRefresh();
+      //   }
+      // } catch (error) {
+      //   console.log(error);
+      // } finally {
+      //   this.loading = false;
+
+      // }
+
 
-      // }).catch(error => {
 
-      // })
     },
     // 下载
     handleDownload() {
       console.log('下载');
+      // try {
+      //   let { code, msg } = await dealerApi.download();
+      //   if (code == 200) {
+      //   }
+      // } catch (error) {
+      //   console.log(error);
+      // } finally {}
     },
 
   },
   created() {
-
+    this.handelSearch();
   }
 
 }

+ 22 - 0
src/views/marketing/utils/date.js

@@ -0,0 +1,22 @@
+// 对Date的扩展,将 Date 转化为指定格式的String
+// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符, 
+// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字) 
+// 例子: 
+// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423 
+// (new Date()).Format("yyyy-M-d h:m:s.S")      ==> 2006-7-2 8:9:4.18 
+
+Date.prototype.Format = function (fmt) {
+  var o = {
+      "M+": this.getMonth() + 1, //月份 
+      "d+": this.getDate(), //日 
+      "H+": this.getHours(), //小时 
+      "m+": this.getMinutes(), //分 
+      "s+": this.getSeconds(), //秒 
+      "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
+      "S": this.getMilliseconds() //毫秒 
+  };
+  if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+  for (var k in o)
+  if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+  return fmt;
+}

+ 11 - 0
src/views/marketing/utils/init.js

@@ -0,0 +1,11 @@
+export  const arr2Obj = function (data, keyName, valueName) {
+  return Object.fromEntries(
+    data.map((item) => [item[keyName], item[valueName]])
+  );
+};
+
+export const initParams = (params) =>{
+
+  return arr2Obj(params, "key", "value")
+
+}

+ 2 - 0
src/views/purchase/DemandSummary/index.vue

@@ -274,6 +274,8 @@
           <el-table-column label="单位" align="center" prop="unit"/>
           <el-table-column label="生产厂家/代理人" align="center" prop="manufacturer" width="180px"/>
           <el-table-column label="需求单位数" align="center" prop="demandNum" width="120px"/>
+          <el-table-column label="近1月月均需求" align="center" prop="evensalesforyear" width="120px"/>
+          <el-table-column label="近3月月均需求" align="center" prop="evensalesforthrmonth" width="120px"/>
           <el-table-column label="总最终净需求量" align="center" prop="netDemandNum" width="120px"/>
           <el-table-column label="总月销量" align="center" prop="totalMonthlySales"/>
           <el-table-column label="需求可用周期" align="center" prop="demandCycle" width="180px"/>

+ 73 - 56
src/views/purchase/MaterialClassDivision/add.vue

@@ -124,12 +124,12 @@
                     style="width: 200px"
                     :disabled="disable"
                     clearable
-                    @focus="chooseOrganizations"
+                    @focus="chooseRefer('ORG_PARAM', true, '选择所属组织')"
                   >
                     <el-option
                       v-for="item in organizationsOptions"
                       :key="item.id"
-                      :label="item.label"
+                      :label="item.name"
                       :value="item.id"
                     />
                 </el-select>
@@ -145,7 +145,7 @@
                   :disabled="disable"
                   v-model="basicForm.orderPersonal"
                   clearable
-                  @focus="chooseStaff"
+                  @focus="chooseRefer('CONTACTS_PARAM', true, '订单员')"
                 >
                   <el-option
                     v-for="item in staffOptions"
@@ -177,7 +177,7 @@
                   :disabled="disable"
                   v-model="basicForm.buyer"
                   clearable
-                  @focus="chooseStaff2"
+                  @focus="chooseRefer('CONTACTS_PARAM', true, '采购员')"
                 >
                   <el-option
                     v-for="item in staff2Options"
@@ -249,17 +249,7 @@
       :single="true"
     />
 
-    <orgs
-      ref="orgs"
-      @doSubmit="acceptOrgs"
-      :single="true"
-    />
-
-    <staff
-      ref="staff"
-      @doSubmit="acceptStaff"
-      :single="true"
-    />
+    <Refers ref="refer" @doSubmit="selectionsRefer" :single="true"/>
 
     <staff2
       ref="staff2"
@@ -278,8 +268,9 @@ import { getDetail } from '@/api/classify/basic';
 // 物料编码
 import popDialog from '@/components/PopDialog/index.vue'
 // 公用一个树形(组织部门传值不同)
-import orgs from '@/components/PopDialog/organization.vue'
-import staff from '@/components/PopDialog/staff.vue'
+import Refers from '@/components/Refers/refers.vue'
+// 用于回显参照框数据
+import { getRefer } from '@/api/purchase/basic.js'
 import staff2 from '@/components/PopDialog/staff.vue'
 // 所属组织,订单员用于回显
 import { getOrgs, getStaff} from '@/api/requisition/basic'
@@ -288,8 +279,7 @@ export default {
   components: {
     fourClass,
     popDialog,
-    orgs,
-    staff,
+    Refers,
     staff2
   },
   props: ['pageStu','row', 'disable'],
@@ -327,6 +317,11 @@ export default {
       options: [{
         value: 0, label: '仓库1'
       }],
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
       organizationsOptions: [],
       staffOptions: [],
       staff2Options: [],
@@ -362,7 +357,7 @@ export default {
       this.$emit('jugislist', true)
       let queryParams = {
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
       }
       this.$emit('refresh', queryParams)
     },
@@ -371,9 +366,12 @@ export default {
       getDivisions(row.id).then(res => {
         if (res.code === 200) {
           this.basicForm = res.data
-          this.getOrgDetails(res.data.org)
-          this.getStaffDetails(res.data.orderPersonal)
-          this.getStaffDetails2(res.data.buyer)
+          if (this.basicForm.org) { this.reBackRefer('ORG_PARAM', this.basicForm.org) }
+          if (this.basicForm.orderPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.orderPersonal, '订单员') }
+          if (this.basicForm.buyer) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.buyer, '采购员') }
+          // this.getOrgDetails(res.data.org)
+          // this.getStaffDetails(res.data.orderPersonal)
+          // this.getStaffDetails2(res.data.buyer)
         }
       })
     },
@@ -412,45 +410,64 @@ export default {
       this.$refs.contractSelect.init()
     },
     // 选择默认采购组织
-    acceptOrgs (selections) {
-      console.log('接收的采购组织', selections)
-      this.basicForm.org = selections.id
-      this.getOrgDetails(selections.id)
+    chooseRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
     },
-    // 默认采购组织显示列表
-    chooseOrganizations () {
-      this.$refs.organizations.blur()
-      this.$refs.orgs.init('1')
+    selectionsRefer(selection) {
+      if (this.referCondition.title == '选择所属组织') {
+        this.organizationsOptions = selection
+        this.basicForm.org = selection[0].id
+        this.basicForm.orgName = selection[0].name
+      }
+      if (this.referCondition.title == '订单员') {
+        this.staffOptions = selection
+        this.basicForm.orderPersonal = selection[0].code
+        this.basicForm.orderPersonalName = selection[0].name
+      }
+      if (this.referCondition.title == '采购员') {
+        this.staff2Options = selection
+        this.basicForm.buyer = selection[0].code
+        this.basicForm.buyerName = selection[0].name
+      }
     },
-    // 采购组织回显
-    getOrgDetails(id) {
-      getOrgs({deptId: id}).then(res => {
-        if (res.code === 200) {
-          this.organizationsOptions = res.data
+    // 回显参照框
+    reBackRefer(type, id, title) {
+      getRefer({ type: type, id: id }).then(res => {
+        if (type == 'ORG_PARAM') {
+          this.organizationsOptions = res.rows
         }
-      })
-    },
-    // 选择订单员
-    acceptStaff (selections) {
-      this.staffOptions = selections
-      this.basicForm.orderPersonal = selections[0].code
-      this.basicForm.orderPersonalName = selections[0].name
-      this.getStaffDetails(selections[0].id)
-    },
-    // 订单员显示列表
-    chooseStaff () {
-      this.$refs.staffs.blur()
-      this.$refs.staff.init()
-    },
-    // 订单员回显
-    getStaffDetails(id) {
-      getStaff({id:id}).then(res => {
-        console.log('订单员', res)
-        if (res.code === 200 ) {
-          this.staffOptions = res.data.tableBody
+        if (type == 'CONTACTS_PARAM' && title == '订单员') {
+          this.staffOptions = res.rows
+        }
+        if (type == 'CONTACTS_PARAM' && title == '采购员') {
+          this.staff2Options = res.rows
         }
       })
     },
+    // 选择订单员
+    // acceptStaff (selections) {
+    //   this.staffOptions = selections
+    //   this.basicForm.orderPersonal = selections[0].code
+    //   this.basicForm.orderPersonalName = selections[0].name
+    //   this.getStaffDetails(selections[0].id)
+    // },
+    // // 订单员显示列表
+    // chooseStaff () {
+    //   this.$refs.staffs.blur()
+    //   this.$refs.staff.init()
+    // },
+    // // 订单员回显
+    // getStaffDetails(id) {
+    //   getStaff({id:id}).then(res => {
+    //     console.log('订单员', res)
+    //     if (res.code === 200 ) {
+    //       this.staffOptions = res.data.tableBody
+    //     }
+    //   })
+    // },
     // 选择采购员
     acceptStaff2 (selections) {
       this.staff2Options = selections

+ 45 - 60
src/views/purchase/MaterialClassDivision/index.vue

@@ -5,50 +5,42 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="物料一级大类编码">
-              <el-select v-model="queryParams.materialClassifyOne" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyOne"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料一级大类名称">
-              <el-select v-model="queryParams.materialClassifyOneName" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyOneName"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料二级大类编码">
-              <el-select v-model="queryParams.materialClassifyTwo" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyTwo"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料二级大类名称">
-              <el-select v-model="queryParams.materialClassifyTwoName" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyTwoName"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
@@ -64,26 +56,22 @@
         <el-row :gutter="10">
           <el-col :span="1.5">
             <el-form-item label="物料三级大类编码">
-              <el-select v-model="queryParams.materialClassifyThree" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyThree"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料三级大类名称">
-              <el-select v-model="queryParams.materialClassifyThreeName" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyThreeName"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
           <el-col :span="1.5">
@@ -100,14 +88,12 @@
           </el-col>
           <el-col :span="1.5">
             <el-form-item label="物料四级大类名称">
-              <el-select v-model="queryParams.materialClassifyFourName" size="small" style="width: 200px" clearable placeholder="请选择">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
+              <el-input
+                v-model="queryParams.materialClassifyFourName"
+                clearable
+                size="small"
+                style="width: 200px"
+              />
             </el-form-item>
           </el-col>
         </el-row>
@@ -211,14 +197,13 @@
               导出<i class="el-icon-arrow-down el-icon--right"></i>
             </el-button>
             <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item command="Excel导出">Excel导出</el-dropdown-item>
+              <el-dropdown-item command="Excel导出">Excel导出</el-dropdown-item>
               <el-dropdown-item command="导出明细">导出明细</el-dropdown-item>
             </el-dropdown-menu>
           </el-dropdown>
 
           <el-button type="primary" size="small">同步分配</el-button>
           <el-button type="primary" size="small">删除</el-button>
-          <el-button type="primary" size="small">打印</el-button>
         </div>
         <el-table 
           :data="tableList" 
@@ -236,7 +221,7 @@
           <el-table-column label="物料编码" align="center" width="150" prop="material" />
           <el-table-column label="物料名称" align="center" prop="materialName" />
           <el-table-column label="生产厂商" align="center" width="150" prop="manufacturer" />
-          <el-table-column label="所属组织" align="center" width="120" prop="orgName" />
+          <el-table-column label="所属组织" align="center" width="120" prop="orgName"/>
           <el-table-column label="订单员" align="center" width="150" prop="orderPersonalName" />
           <el-table-column label="采购员" align="center" width="150" prop="buyerName" />
           <el-table-column label="订单部门" align="center" width="150" prop="orderDeptName" />
@@ -308,7 +293,7 @@ export default {
         manufacturer: '',
         remark: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 5
       },
       options: [{
         value: 0, label: '仓库1'

+ 6 - 1
src/views/purchase/PurchaseDemandList/add.vue

@@ -604,7 +604,8 @@ export default {
       referCondition: {
         type: 'ORG_PARAM',
         isPage: true,
-        title: '选择组织'
+        title: '选择组织',
+        pkOrg: '',
       },
       referConditionMx: {
         type: 'DEPT_PARAM',
@@ -703,6 +704,7 @@ export default {
         materialCode: null,
         material: null,
         materialName: null,
+        classifyId: null,
         specification: null,
         unit: null,
         unitName: null,
@@ -860,6 +862,8 @@ export default {
       this.referCondition.type = type
       this.referCondition.isPage = isPage
       this.referCondition.title = title
+      // 选择货位时要传入组织id
+      this.referCondition.pkOrg = this.basicForm.org
       this.$refs.refer.init(this.referCondition)
     },
     selectionsToInput(selection) {
@@ -939,6 +943,7 @@ export default {
       this.basicForm.puDemandItemList[this.tableIndex].materialCode = selection[0].code
       this.basicForm.puDemandItemList[this.tableIndex].material = selection[0].id
       this.basicForm.puDemandItemList[this.tableIndex].materialName = selection[0].name
+      this.basicForm.puDemandItemList[this.tableIndex].classifyId = selection[0].classifyId
       this.basicForm.puDemandItemList[this.tableIndex].materialClassifyOneName = selection[0].oneClass
       this.basicForm.puDemandItemList[this.tableIndex].materialClassifyTwoName = selection[0].twoClass
       this.basicForm.puDemandItemList[this.tableIndex].materialClassifyThreeName = selection[0].threeClass

+ 59 - 23
src/views/purchase/deliveryAddress/add.vue

@@ -28,24 +28,16 @@
 
         <el-col :span="1.5">
             <el-form-item label="仓库档案名称">
-              <el-input
-                v-model="basicForm.warehouseCode"
-                size="small"
-                :disabled="disable"
-                clearable
-                style="width: 200px"
-              />
+              <el-select size="small" v-model="basicForm.warehouseCode" :disabled="disable" @focus="chooseRefer('WAREHOUSE_PARAM', true, '仓库档案名称')" style="width: 200px">
+                <el-option v-for="item in houseOptions" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
          </el-col>
 
          <el-col :span="1.5">
-            <el-form-item label="仓库属性">
-              <el-select v-model="basicForm.warehouseProperty" size="small" style="width: 200px" clearable :disabled="disable">
-                <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
+          <el-form-item label="仓库属性">
+              <el-select :disabled="disable" v-model="basicForm.warehouseProperty" size="small" style="width: 200px">
+                <el-option v-for="dict in dict.type.sys_warehouse_attribute" :key="dict.value" :label="dict.label" :value="dict.value">
                 </el-option>
               </el-select>
             </el-form-item>
@@ -65,13 +57,9 @@
 
           <el-col :span="1.5">
             <el-form-item label="联系人">
-              <el-input
-                v-model="basicForm.contactsName"
-                size="small"
-                :disabled="disable"
-                clearable
-                style="width: 200px"
-              />
+              <el-select size="small" v-model="basicForm.contactsName" :disabled="disable" @focus="chooseRefer('CONTACTS_PARAM', true, '联系人')" style="width: 200px">
+                <el-option v-for="item in contactsOptions" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
          </el-col>
 
@@ -89,13 +77,16 @@
 
           <el-col :span="1.5">
             <el-form-item label="物料分类">
-              <el-input
+              <el-select
                 v-model="basicForm.materialClassify"
                 size="small"
                 :disabled="disable"
                 clearable
+                @focus="chooseTreeRefer('MATERIALCLASSIFY_PARAM', false, '物料分类')"
                 style="width: 200px"
-              />
+                >
+                <el-option v-for="item in classOptions" :key="item.id" :label="item.name" :value="item.id" />
+              </el-select>
             </el-form-item>
          </el-col>
 
@@ -151,14 +142,25 @@
         <el-button size="small" plain @click="back">返回</el-button>
       </el-col>
     </div>
+
+    <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
+
+    <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
   </div>
 </template>
 
 <script>
+import Refers from '@/components/Refers/refers.vue'
+import TreeRefers from '@/components/Refers/treeRefer.vue'
 import {addAddress, getAddressDetail, editAddress} from '@/api/purchase/deliveryAddress.js'
 export default {
   name: 'addAddress',
+  dicts: ['sys_warehouse_attribute'],
   props: ['pageStu','row', 'disable'],
+  components: {
+    Refers,
+    TreeRefers
+  },
   model: {
     prop: 'isList',
     event: 'jugislist'
@@ -181,11 +183,19 @@ export default {
         sendStatus: '',
         remark: '',
       },
+      referCondition: {
+        type: '',
+        isPage: true,
+        title: ''
+      },
       options: [{
         value: '1', label: '是',
       }, {
         value: '0', label: '否'
       }],
+      houseOptions: [],
+      contactsOptions: [],
+      classOptions: [],
       basicRules: {}
     }
   },
@@ -232,6 +242,32 @@ export default {
         }
       })
     },
+    chooseRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.refer.init(this.referCondition)
+    },
+    selectionsToInput(selection) {
+      if (this.referCondition.type == 'WAREHOUSE_PARAM') {
+        this.houseOptions = selection
+        this.basicForm.warehouseCode = selection[0].id
+      }
+      if (this.referCondition.type == 'CONTACTS_PARAM') {
+        this.contactsOptions = selection
+        this.basicForm.contactsName = selection[0].id
+      }
+    },
+    chooseTreeRefer(type, isPage, title) {
+      this.referCondition.type = type
+      this.referCondition.isPage = isPage
+      this.referCondition.title = title
+      this.$refs.tree.init(this.referCondition)
+    },
+    selectionsToInput2(selection) {
+      this.classOptions.push(selection)
+      this.basicForm.materialClassify = selection.id
+    },
   }
 }
 </script>

+ 0 - 1
src/views/purchase/deliveryAddress/index.vue

@@ -179,7 +179,6 @@
           <el-button type="primary" size="small">停用</el-button>
           <el-button type="primary" size="small">同步NC</el-button>
           <el-button type="primary" size="small">删除</el-button>
-          <el-button type="primary" size="small">打印</el-button>
         </div>
         <el-table 
           :data="tableList" 

+ 14 - 9
src/views/purchase/purchase-order/add/column.js

@@ -172,13 +172,13 @@ export const Columns = [
         goodsAllocationName: "name",
       },
       queryParams: {
-        puOrg: 'puOrg',
+        pkOrg: 'puOrg',
       }
     },
     width: 200,
   },
   { key: "isSendSrm", title: "是否同步SRM", type: "Checkbox", },
-  { key: "isInvoice", title: "发票标识", type: "Input", },
+  { key: "isInvoice", title: "发票标识", type: "Checkbox", },
   { key: "supplierOrderNo", title: "供应商订单号", type: "Input", },
   { key: "rebateMoney", title: "订单使用返利金额", type: "Input", },
   { key: "deductionMoney", title: "订单抵扣余款金额", type: "Input", },
@@ -210,7 +210,7 @@ export const Columns = [
     },
     width: 200,
   },
-  { key: "isUrgency", title: "紧急程度", type: "Input", },
+  { key: "isUrgency", title: "紧急程度", type: "Checkbox", },
   { key: "isSendWms", title: "已同步WMS", type: "Checkbox", },
   // { key: "agent", title: "代理人", type: "Input", }, // 建议删除
   // { key: "agentName", title: "代理人名称", },
@@ -226,7 +226,7 @@ export const Columns = [
   //   // type: "InputDialog",
   // },
   { key: "supplierPersonalName", title: "供应商业务员名称", type: "Input", },
-  { key: "isDeliver", title: "是否发货", type: "Input", },
+  { key: "isDeliver", title: "是否发货", type: "Checkbox", },
   {
     key: "retReason",
     title: "退换原因",
@@ -240,14 +240,14 @@ export const Columns = [
     },
   },
   {
-    key: "processType",
+    key: "processTypeName",
     title: "处理方式",
     type: "InputDialog",
     config: {
       componentName: "PROCESSTYPE_PARAM",
       dataMapping: {
         processType: "code",
-        // processTypeName: "name",
+        processTypeName: "name",
       },
     },
   },
@@ -279,7 +279,7 @@ export const Columns = [
   { key: "isArrivalReson", title: "到货超期原因", type: "Input", },
   { key: "midOrderNo", title: "中台采购订单号", type: "Input", },
   { key: "marketingCode", title: "销售订单号", type: "Input", },
-  { key: "isArrival", title: "到货超期", type: "Input", },
+  { key: "isArrival", title: "到货超期", type: "Checkbox", },
   { key: "createByName", title: "创建人名称", type: "Input", },
   { key: "updateByName", title: "更新人名称", type: "Input", },
   { key: "flowId", title: "OA流程ID", type: "Input", },
@@ -290,7 +290,12 @@ export const Columns = [
     type: "DatePicker",
     config: { type: "date" },
   },
-  { key: "approveTime", title: "提交时间", },
+  {
+    key: "approveTime",
+    title: "提交时间",
+    type: "DatePicker",
+    config: { type: "date" },
+  },
 
 ];
 
@@ -413,7 +418,7 @@ export const TabColumns = [
       { key: "materialClassifyThreeName", title: "物料三级分类名称", type: "Input", },
       // { key: "materialClassifyFour", title: "物料四级分类",type: "Input", },
       { key: "materialClassifyFourName", title: "物料四级分类名称", type: "Input", },
-      { key: "price", title: "无税单价" }
+      { key: "price", title: "无税单价", type: "Input", }
     ]
   },
   {

+ 22 - 10
src/views/purchase/purchase-order/add/index.vue

@@ -9,9 +9,15 @@ const NewTabColumns = TabColumns.map((element) => ({
   tableColumns: initColumns(element.tableColumns),
 }));
 
+const SelectColumns = NewColumns.filter(column => column.type === 'Select')
+NewTabColumns.forEach(column => {
+  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.type === 'Select'))
+});
+
+
 export default {
   name: "AddPurchaseOrderDrawer",
-  dicts: initDicts(NewColumns),
+  dicts: initDicts(SelectColumns),
   components: {
     DrInputDialog: () => import("@/components/input-dialog/index.vue"),
   },
@@ -31,11 +37,6 @@ export default {
       tabColumns: NewTabColumns,
 
       tabName: "puOrderItemList",
-      // tabTableParams: {
-      //   puOrderItemList: [],
-      //   puOrderExecuteList: [],
-      // },
-      // currentComponent: { name: "", title: "", value: "", row: {}, source: {} },
     };
   },
   computed: {},
@@ -54,12 +55,14 @@ export default {
     setVisible(prop) {
       this.visible = prop;
     },
+    // 增行
     addTableRow(prop) {
       const arr = this.tabColumns.find(
         (element) => element.key === this.tabName
       ).tableColumns;
       prop.push(initParams(arr, "key", "value"));
     },
+    // 删行
     delTableRow(prop, index) {
       prop.splice(index, 1);
     },
@@ -222,15 +225,24 @@ export default {
                   </dr-input-dialog>
                   <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
                     :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" size="mini"
-                    style="width: 100%"></el-input-number>
-                  <el-input v-if="column.type === 'InputDialog'" v-model="params[column.key]"
+                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" size="mini" style="width: 100%">
+                  </el-input-number>
+                  <el-select v-if="cColumn.type === 'Select'" v-model="params[cColumn.key]"
+                    :placeholder="column.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    style="width: 100%">
+                    <el-option v-for="item in dict.type[cColumn.config.optionsName]" :key="item.value" :label="item.label"
+                      :value="item.value">
+                    </el-option>
+                  </el-select>
+                  <el-checkbox v-else-if="cColumn.type === 'Checkbox'" v-model="params[cColumn.key]" true-label="Y"
+                    false-label="N"></el-checkbox>
+                  <!-- <el-input v-if="column.type === 'InputDialog'" v-model="params[column.key]"
                     :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
                     :readonly="column.readonly" style="width: 100%; cursor: pointer">
                     <template #suffix>
                       <el-icon class="el-icon-thumb"></el-icon>
                     </template>
-                  </el-input>
+                  </el-input> -->
                 </template>
               </el-table-column>
               <el-table-column fixed="right" label="操作" width="120">

+ 101 - 0
src/views/purchase/purchase-order/column.js

@@ -75,4 +75,105 @@ export const TableColumns = [
       { key: "midOrderNo", title: "中台采购订单号" }
 ];
 
+export const TabColumns = [
+   {
+     title: '物料信息',
+     key: 'puOrderItemList',
+     tableColumns: [
+       { key: "rowNo", title: "行号" },
+       { key: "orderId", title: "采购订单ID" },
+       { key: "material", title: "物料" },
+       { key: "materialName", title: "物料名称" },
+       { key: "materialCode", title: "物料编码" },
+       { key: "materialClassify", title: "物料分类" },
+       { key: "materialManufacturersCode", title: "厂家物料编码" },
+       { key: "specification", title: "规格" },
+       { key: "model", title: "型号" },
+       { key: "isMedcine", title: "医药物料" },
+       { key: "manufacturer", title: "生产厂家代理人" },
+       { key: "isDrug", title: "物料药品属性" },
+       { key: "unit", title: "单位" },
+       { key: "qty", title: "数量" },
+       { key: "taxPrice", title: "含税单价" },
+       { key: "money", title: "价税合计" },
+       { key: "tax", title: "税率" },
+       { key: "taxDeductMoneya", title: "折扣金额" },
+       { key: "arrivalQty", title: "已到货数量" },
+       { key: "unarrivedQty", title: "未到货数量" },
+       { key: "notaxMoney", title: "无税金额" },
+       { key: "priceSource", title: "价格目录ID" },
+       { key: "isStorage", title: "入库关闭" },
+       { key: "isInvoice", title: "开票关闭" },
+       { key: "isArrival", title: "到货关闭" },
+       { key: "isPayment", title: "付款关闭" },
+       { key: "isGift", title: "赠品" },
+       { key: "warehouse", title: "收货仓库" },
+       { key: "place", title: "收货地点" },
+       { key: "address", title: "收货地址" },
+       { key: "productBatch", title: "产品批号" },
+       { key: "manufactureDate", title: "生产日期" },
+       { key: "efficacyLoseDate", title: "有效期至/失效日期" },
+       { key: "approvalNumber", title: "批准文号" },
+       { key: "registration", title: "注册证号" },
+       { key: "storageCondition", title: "存储条件" },
+       { key: "carriageCondition", title: "运输条件" },
+       { key: "isBatchLock", title: "批号锁定标识" },
+       { key: "isReplenishment", title: "补单标识" },
+       { key: "isUrgency", title: "紧急标识" },
+       { key: "originalQty", title: "原始数量" },
+       { key: "originalMoney", title: "原始金额" },
+       { key: "directProductBatch", title: "直运产品批号" },
+       { key: "discountRule", title: "折扣规则编码" },
+       { key: "reservedQty", title: "预留数量" },
+       { key: "reservedPeriod", title: "预留周期" },
+       { key: "taxDeductClassify", title: "扣税类别" },
+       { key: "exchangeRate", title: "折本汇率" },
+       { key: "source", title: "上游单据号" },
+       { key: "sourceId", title: "上游单据ID" },
+       { key: "demandCode", title: "采购需求单号" },
+       { key: "arrivalDatePlan", title: "计划到货日期" },
+       { key: "priceType", title: "价格类型" },
+       { key: "isDistributionPrice", title: "配送价" },
+       // { key: "tenantId", title: "租户号" },
+       // { key: "revision", title: "乐观锁" },
+       { key: "createByName", title: "创建人名称" },
+       { key: "updateByName", title: "更新人名称" },
+       // { key: "delFlag", title: "删除标记" },
+       // { key: "materialClassifyOne", title: "物料一级分类" },
+       { key: "materialClassifyOneName", title: "物料一级分类名称" },
+       // { key: "materialClassifyTwo", title: "物料二级分类" },
+       { key: "materialClassifyTwoName", title: "物料二级分类名称" },
+       // { key: "materialClassifyThree", title: "物料三级分类" },
+       { key: "materialClassifyThreeName", title: "物料三级分类名称" },
+       // { key: "materialClassifyFour", title: "物料四级分类" },
+       { key: "materialClassifyFourName", title: "物料四级分类名称" },
+       { key: "price", title: "无税单价" }
+     ]
+   },
+   {
+     title: '执行结果',
+     key: 'puOrderExecuteList',
+     tableColumns: [
+       // { key: "id", title: "主键" },
+       { key: "orderId", title: "采购订单ID" },
+       { key: "rowno", title: "行号" },
+       { key: "material", title: "物料" },
+       { key: "materialName", title: "物料名称" },
+       { key: "specification", title: "规格" },
+       { key: "qty", title: "数量" },
+       { key: "stroageQty", title: "累计到货主数量" },
+       { key: "stockQty", title: "累计入库主数量" },
+       { key: "invoiceQty", title: "累计开票主数量" },
+       { key: "rollbackQty", title: "累计退货主数量" },
+       { key: "backStockQty", title: "累计退库主数量" },
+       { key: "floatQty", title: "未到货数量" },
+       // { key: "tenantId", title: "租户号" },
+       // { key: "revision", title: "乐观锁" },
+       { key: "createByName", title: "创建人名称" },
+       { key: "updateByName", title: "更新人名称" },
+       // { key: "delFlag", title: "删除标记" }
+     ]
+   },
+ ];
+
 export const SearchColumns = TableColumns.filter((element) => element.search);

+ 72 - 58
src/views/purchase/purchase-order/edit/index.vue

@@ -8,10 +8,15 @@ const NewTabColumns = TabColumns.map((element) => ({
   ...element,
   tableColumns: initColumns(element.tableColumns),
 }));
+// 
+const SelectColumns = NewColumns.filter(column => column.type === 'Select')
+NewTabColumns.forEach(column => {
+  SelectColumns.push(...column.tableColumns.filter(cColumn => cColumn.type === 'Select'))
+});
 
 export default {
   name: "EditPurchaseOrderDrawer",
-  dicts: initDicts(NewColumns),
+  dicts: initDicts(SelectColumns),
   components: {
     DrInputDialog: () => import("@/components/input-dialog/index.vue"),
   },
@@ -24,28 +29,25 @@ export default {
       rules: initRules(NewColumns),
       params: {
         ...initParams(NewColumns),
-        contractItemList: [],
-        contractClauseList: [],
-        contractExpenseList: [],
-        contractAgreementList: [],
-        contractApplyOrgList: [],
+        puOrderItemList: [],
+        puOrderExecuteList: [],
       },
 
       tabColumns: NewTabColumns,
-      tabName: "contractItemList",
+      tabName: "puOrderItemList",
     };
   },
   computed: {},
   watch: {
     "params.contractType": function (newProp) {
       this.tabColumns = NewTabColumns.filter((element) =>
-        newProp === "1" ? element.key !== "contractItemList" : element
+        newProp === "1" ? element.key !== "puOrderItemList" : element
       );
       this.tabName = this.tabColumns[0].key;
     },
     tabName: function (newProp) {
       const { id } = this.params;
-      this.fetchTable(id, newProp);
+      // this.fetchTable(id, newProp);
     },
   },
   methods: {
@@ -58,7 +60,8 @@ export default {
         this.loading = true;
         const { code, msg, data } = await orderApi.details(prop);
         if (code === 200) {
-          this.params = data;
+          this.params = { ...this.params, ...data };
+          console.log(this.params, 'this.params----------');
           this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });
@@ -70,22 +73,22 @@ export default {
       }
     },
     // 查询详情关联TABLE
-    async fetchTable(prop, name) {
-      try {
-        this.loading = true;
-        const { code, msg, rows } = await itemTableList({ id: prop }, name);
-        if (code === 200) {
-          this.params[name] = rows;
-          this.$notify.success({ title: msg });
-        } else {
-          this.$notify.warning({ title: msg });
-        }
-      } catch (err) {
-        this.$notify.error({ title: "error", message: err });
-      } finally {
-        this.loading = false;
-      }
-    },
+    // async fetchTable(prop, name) {
+    //   try {
+    //     this.loading = true;
+    //     const { code, msg, rows } = await itemTableList({ id: prop }, name);
+    //     if (code === 200) {
+    //       this.params[name] = rows;
+    //       this.$notify.success({ title: msg });
+    //     } else {
+    //       this.$notify.warning({ title: msg });
+    //     }
+    //   } catch (err) {
+    //     this.$notify.error({ title: "error", message: err });
+    //   } finally {
+    //     this.loading = false;
+    //   }
+    // },
     // 新增行
     addTableRow(prop) {
       const arr = this.tabColumns.find(
@@ -103,39 +106,37 @@ export default {
       this.params = initParams(this.columns, "key", "value");
     },
     // 保存
-    handleSava() {
-      this.setVisible(false);
-    },
-    // 保存并新增
-    async handleSubmit() {
+    async handleSava() {
+
       try {
-        const createById = this.params.buyer;
-        const createByName = this.params.buyerName;
-        const updateById = this.$store.state.user.id;
-        const updateByName = this.$store.state.user.name;
-        const { code, msg } = await edit({
-          createById,
-          createByName,
-          updateById,
-          updateByName,
-          ...this.params,
-        });
+        this.loading = true;
+        const { code, msg } = await (this.handleIsRevise(this.params.status) ?
+          orderApi.revision(this.params)
+          : orderApi.edit(this.params)
+        )
         if (code === 200) {
-          this.$notify.success({ title: msg });
           this.setVisible(false);
+          this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });
         }
       } catch (err) {
         this.$notify.error({ title: "error", message: err });
       } finally {
-        // this.setVisible(false);
+        this.loading = false;
       }
+
+    },
+    beforeOpen() {
+    },
+    // 判断修订还是编辑
+    handleIsRevise(status) {
+      return status == '2';
     },
-    beforeOpen() { },
   },
   created() {
     console.log("ADD CREATED");
+    console.log(this.params, 'this.params');
   },
   mounted() { },
   destroyed() { },
@@ -155,7 +156,7 @@ export default {
             justify-content: space-between;
             align-items: center;
           ">
-          <h3>{{ params.status == '2' ? '修订' : '编辑' }}</h3>
+          <h3>{{ handleIsRevise(params.status) ? '修订' : '编辑' }}</h3>
           <div style="text-align: right">
             <el-button :size="size" @click="handleCancel">取 消</el-button>
             <el-button :size="size" type="danger" @click="handleSava">更 新</el-button>
@@ -165,18 +166,21 @@ export default {
           <el-col v-for="(column, index) in columns" :key="index" :span="column.span || 6">
             <el-form-item :prop="column.key" :label="column.title">
               <el-input v-if="column.type === 'Input'" v-model="params[column.key]" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input>
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
+              </el-input>
               <dr-input-dialog v-if="column.type === 'InputDialog'" v-model="params[column.key]"
                 :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                :readonly="column.readonly" :title="column.title" :type="column.config.componentName"
-                :data-mapping="column.config.dataMapping" :source.sync="params">
+                :readonly="column.readonly" :query-params="column.config.queryParams" :title="column.title"
+                :type="column.config.componentName" :data-mapping="column.config.dataMapping" :source.sync="params">
               </dr-input-dialog>
               <el-input v-if="column.type === 'Textarea'" v-model="params[column.key]" type="textarea"
                 :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                style="width: 100%"></el-input>
+                style="width: 100%">
+              </el-input>
               <el-input-number v-if="column.type === 'InputNumber'" v-model="params[column.key]"
                 :controls-position="column.config.controlsPosition" :placeholder="column.placeholder"
-                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%"></el-input-number>
+                :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
+              </el-input-number>
               <el-select v-if="column.type === 'Select'" v-model="params[column.key]" :placeholder="column.placeholder"
                 :clearable="column.clearable" :disabled="column.disabled" style="width: 100%">
                 <el-option v-for="item in dict.type[column.config.optionsName]" :key="item.value" :label="item.label"
@@ -196,8 +200,9 @@ export default {
                 :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
                 :picker-options="column.pickerOptions" style="width: 100%">
               </el-date-picker>
-              <el-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
-                false-label="N"></el-checkbox>
+              <el-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" :disabled="column.disabled"
+                true-label="Y" false-label="N">
+              </el-checkbox>
               <el-upload v-if="column.type === 'Upload'" :file-list="params[column.key]" :disabled="column.disabled" drag
                 action="https://sy.derom.com/document-center/fastdfs/upload" multiple>
                 <i class="el-icon-upload"></i>
@@ -233,18 +238,27 @@ export default {
                     {{ scope.row[cColumn.key] }}</span>
                   <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
                     :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    :size="size" style="width: 100%"></el-input>
+                    :size="size" style="width: 100%">
+                  </el-input>
                   <dr-input-dialog v-if="cColumn.type === 'InputDialog'" v-model="scope.row[cColumn.key]"
                     :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
                     :readonly="cColumn.readonly" :title="cColumn.title" :type="cColumn.config.componentName"
                     :data-mapping="cColumn.config.dataMapping" :source.sync="scope.row" :size="size">
                   </dr-input-dialog>
-                  <el-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
-                    false-label="N"></el-checkbox>
+                  <el-select v-if="cColumn.type === 'Select'" v-model="params[cColumn.key]"
+                    :placeholder="column.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
+                    style="width: 100%">
+                    <el-option v-for="item in dict.type[cColumn.config.optionsName]" :key="item.value" :label="item.label"
+                      :value="item.value">
+                    </el-option>
+                  </el-select>
+                  <el-checkbox v-else-if="cColumn.type === 'Checkbox'" v-model="params[cColumn.key]" true-label="Y"
+                    false-label="N">
+                  </el-checkbox>
                   <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
                     :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size"
-                    style="width: 100%"></el-input-number>
+                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :size="size" style="width: 100%">
+                  </el-input-number>
                 </template>
               </el-table-column>
               <el-table-column fixed="right" label="操作" width="120">

+ 120 - 121
src/views/purchase/purchase-order/index.vue

@@ -1,6 +1,6 @@
 <!-- 采购订单修订—— 列表 -->
 <script>
-import { TableColumns, SearchColumns } from "./column";
+import { TableColumns, SearchColumns, TabColumns } from "./column";
 import orderApi from "@/api/business/purchase/purchase-order";
 import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
 export default {
@@ -12,107 +12,107 @@ export default {
   },
   data() {
 
-    const tabColumns = [
-      {
-        title: '物料信息',
-        key: 'first',
-        tableColumns: [
-          { key: "rowNo", title: "行号" },
-          { key: "orderId", title: "采购订单ID" },
-          { key: "material", title: "物料" },
-          { key: "materialName", title: "物料名称" },
-          { key: "materialCode", title: "物料编码" },
-          { key: "materialClassify", title: "物料分类" },
-          { key: "materialManufacturersCode", title: "厂家物料编码" },
-          { key: "specification", title: "规格" },
-          { key: "model", title: "型号" },
-          { key: "isMedcine", title: "医药物料" },
-          { key: "manufacturer", title: "生产厂家代理人" },
-          { key: "isDrug", title: "物料药品属性" },
-          { key: "unit", title: "单位" },
-          { key: "qty", title: "数量" },
-          { key: "taxPrice", title: "含税单价" },
-          { key: "money", title: "价税合计" },
-          { key: "tax", title: "税率" },
-          { key: "taxDeductMoneya", title: "折扣金额" },
-          { key: "arrivalQty", title: "已到货数量" },
-          { key: "unarrivedQty", title: "未到货数量" },
-          { key: "notaxMoney", title: "无税金额" },
-          { key: "priceSource", title: "价格目录ID" },
-          { key: "isStorage", title: "入库关闭" },
-          { key: "isInvoice", title: "开票关闭" },
-          { key: "isArrival", title: "到货关闭" },
-          { key: "isPayment", title: "付款关闭" },
-          { key: "isGift", title: "赠品" },
-          { key: "warehouse", title: "收货仓库" },
-          { key: "place", title: "收货地点" },
-          { key: "address", title: "收货地址" },
-          { key: "productBatch", title: "产品批号" },
-          { key: "manufactureDate", title: "生产日期" },
-          { key: "efficacyLoseDate", title: "有效期至/失效日期" },
-          { key: "approvalNumber", title: "批准文号" },
-          { key: "registration", title: "注册证号" },
-          { key: "storageCondition", title: "存储条件" },
-          { key: "carriageCondition", title: "运输条件" },
-          { key: "isBatchLock", title: "批号锁定标识" },
-          { key: "isReplenishment", title: "补单标识" },
-          { key: "isUrgency", title: "紧急标识" },
-          { key: "originalQty", title: "原始数量" },
-          { key: "originalMoney", title: "原始金额" },
-          { key: "directProductBatch", title: "直运产品批号" },
-          { key: "discountRule", title: "折扣规则编码" },
-          { key: "reservedQty", title: "预留数量" },
-          { key: "reservedPeriod", title: "预留周期" },
-          { key: "taxDeductClassify", title: "扣税类别" },
-          { key: "exchangeRate", title: "折本汇率" },
-          { key: "source", title: "上游单据号" },
-          { key: "sourceId", title: "上游单据ID" },
-          { key: "demandCode", title: "采购需求单号" },
-          { key: "arrivalDatePlan", title: "计划到货日期" },
-          { key: "priceType", title: "价格类型" },
-          { key: "isDistributionPrice", title: "配送价" },
-          // { key: "tenantId", title: "租户号" },
-          // { key: "revision", title: "乐观锁" },
-          { key: "createByName", title: "创建人名称" },
-          { key: "updateByName", title: "更新人名称" },
-          // { key: "delFlag", title: "删除标记" },
-          // { key: "materialClassifyOne", title: "物料一级分类" },
-          { key: "materialClassifyOneName", title: "物料一级分类名称" },
-          // { key: "materialClassifyTwo", title: "物料二级分类" },
-          { key: "materialClassifyTwoName", title: "物料二级分类名称" },
-          // { key: "materialClassifyThree", title: "物料三级分类" },
-          { key: "materialClassifyThreeName", title: "物料三级分类名称" },
-          // { key: "materialClassifyFour", title: "物料四级分类" },
-          { key: "materialClassifyFourName", title: "物料四级分类名称" },
-          { key: "price", title: "无税单价" }
-        ]
-      },
-      {
-        title: '执行结果',
-        key: 'second',
-        tableColumns: [
-          // { key: "id", title: "主键" },
-          { key: "orderId", title: "采购订单ID" },
-          { key: "rowno", title: "行号" },
-          { key: "material", title: "物料" },
-          { key: "materialName", title: "物料名称" },
-          { key: "specification", title: "规格" },
-          { key: "qty", title: "数量" },
-          { key: "stroageQty", title: "累计到货主数量" },
-          { key: "stockQty", title: "累计入库主数量" },
-          { key: "invoiceQty", title: "累计开票主数量" },
-          { key: "rollbackQty", title: "累计退货主数量" },
-          { key: "backStockQty", title: "累计退库主数量" },
-          { key: "floatQty", title: "未到货数量" },
-          // { key: "tenantId", title: "租户号" },
-          // { key: "revision", title: "乐观锁" },
-          { key: "createByName", title: "创建人名称" },
-          { key: "updateByName", title: "更新人名称" },
-          // { key: "delFlag", title: "删除标记" }
-        ]
-      },
-    ];
-    const initTabColumns = () => tabColumns;
+    // const tabColumns = [
+    //   {
+    //     title: '物料信息',
+    //     key: 'first',
+    //     tableColumns: [
+    //       { key: "rowNo", title: "行号" },
+    //       { key: "orderId", title: "采购订单ID" },
+    //       { key: "material", title: "物料" },
+    //       { key: "materialName", title: "物料名称" },
+    //       { key: "materialCode", title: "物料编码" },
+    //       { key: "materialClassify", title: "物料分类" },
+    //       { key: "materialManufacturersCode", title: "厂家物料编码" },
+    //       { key: "specification", title: "规格" },
+    //       { key: "model", title: "型号" },
+    //       { key: "isMedcine", title: "医药物料" },
+    //       { key: "manufacturer", title: "生产厂家代理人" },
+    //       { key: "isDrug", title: "物料药品属性" },
+    //       { key: "unit", title: "单位" },
+    //       { key: "qty", title: "数量" },
+    //       { key: "taxPrice", title: "含税单价" },
+    //       { key: "money", title: "价税合计" },
+    //       { key: "tax", title: "税率" },
+    //       { key: "taxDeductMoneya", title: "折扣金额" },
+    //       { key: "arrivalQty", title: "已到货数量" },
+    //       { key: "unarrivedQty", title: "未到货数量" },
+    //       { key: "notaxMoney", title: "无税金额" },
+    //       { key: "priceSource", title: "价格目录ID" },
+    //       { key: "isStorage", title: "入库关闭" },
+    //       { key: "isInvoice", title: "开票关闭" },
+    //       { key: "isArrival", title: "到货关闭" },
+    //       { key: "isPayment", title: "付款关闭" },
+    //       { key: "isGift", title: "赠品" },
+    //       { key: "warehouse", title: "收货仓库" },
+    //       { key: "place", title: "收货地点" },
+    //       { key: "address", title: "收货地址" },
+    //       { key: "productBatch", title: "产品批号" },
+    //       { key: "manufactureDate", title: "生产日期" },
+    //       { key: "efficacyLoseDate", title: "有效期至/失效日期" },
+    //       { key: "approvalNumber", title: "批准文号" },
+    //       { key: "registration", title: "注册证号" },
+    //       { key: "storageCondition", title: "存储条件" },
+    //       { key: "carriageCondition", title: "运输条件" },
+    //       { key: "isBatchLock", title: "批号锁定标识" },
+    //       { key: "isReplenishment", title: "补单标识" },
+    //       { key: "isUrgency", title: "紧急标识" },
+    //       { key: "originalQty", title: "原始数量" },
+    //       { key: "originalMoney", title: "原始金额" },
+    //       { key: "directProductBatch", title: "直运产品批号" },
+    //       { key: "discountRule", title: "折扣规则编码" },
+    //       { key: "reservedQty", title: "预留数量" },
+    //       { key: "reservedPeriod", title: "预留周期" },
+    //       { key: "taxDeductClassify", title: "扣税类别" },
+    //       { key: "exchangeRate", title: "折本汇率" },
+    //       { key: "source", title: "上游单据号" },
+    //       { key: "sourceId", title: "上游单据ID" },
+    //       { key: "demandCode", title: "采购需求单号" },
+    //       { key: "arrivalDatePlan", title: "计划到货日期" },
+    //       { key: "priceType", title: "价格类型" },
+    //       { key: "isDistributionPrice", title: "配送价" },
+    //       // { key: "tenantId", title: "租户号" },
+    //       // { key: "revision", title: "乐观锁" },
+    //       { key: "createByName", title: "创建人名称" },
+    //       { key: "updateByName", title: "更新人名称" },
+    //       // { key: "delFlag", title: "删除标记" },
+    //       // { key: "materialClassifyOne", title: "物料一级分类" },
+    //       { key: "materialClassifyOneName", title: "物料一级分类名称" },
+    //       // { key: "materialClassifyTwo", title: "物料二级分类" },
+    //       { key: "materialClassifyTwoName", title: "物料二级分类名称" },
+    //       // { key: "materialClassifyThree", title: "物料三级分类" },
+    //       { key: "materialClassifyThreeName", title: "物料三级分类名称" },
+    //       // { key: "materialClassifyFour", title: "物料四级分类" },
+    //       { key: "materialClassifyFourName", title: "物料四级分类名称" },
+    //       { key: "price", title: "无税单价" }
+    //     ]
+    //   },
+    //   {
+    //     title: '执行结果',
+    //     key: 'second',
+    //     tableColumns: [
+    //       // { key: "id", title: "主键" },
+    //       { key: "orderId", title: "采购订单ID" },
+    //       { key: "rowno", title: "行号" },
+    //       { key: "material", title: "物料" },
+    //       { key: "materialName", title: "物料名称" },
+    //       { key: "specification", title: "规格" },
+    //       { key: "qty", title: "数量" },
+    //       { key: "stroageQty", title: "累计到货主数量" },
+    //       { key: "stockQty", title: "累计入库主数量" },
+    //       { key: "invoiceQty", title: "累计开票主数量" },
+    //       { key: "rollbackQty", title: "累计退货主数量" },
+    //       { key: "backStockQty", title: "累计退库主数量" },
+    //       { key: "floatQty", title: "未到货数量" },
+    //       // { key: "tenantId", title: "租户号" },
+    //       // { key: "revision", title: "乐观锁" },
+    //       { key: "createByName", title: "创建人名称" },
+    //       { key: "updateByName", title: "更新人名称" },
+    //       // { key: "delFlag", title: "删除标记" }
+    //     ]
+    //   },
+    // ];
+    const initTabColumns = () => TabColumns;
     return {
       loading: false,
       isSimpleSearch: true,
@@ -125,12 +125,11 @@ export default {
       tableColumns: TableColumns,
       tableData: [],
       tabColumns: initTabColumns(),
-      tabName: "first",
+      tabName: "puOrderItemList",
       tabTableDatas: {
-        first: [],
-        second: [],
+        puOrderItemList: [],
+        puOrderExecuteList: [],
       },
-      checkedData: {}
     };
   },
   computed: {
@@ -204,7 +203,7 @@ export default {
     handleResetList() {
 
       this.page = initPage();
-      this.params = initParams();
+      this.params = initParams(SearchColumns);
       this.fetchList(this.params, this.page);
     },
     handleTabClick() { },
@@ -233,10 +232,10 @@ export default {
       try {
         const { code, msg, data } = await orderApi.details(row.id);
         if (code === 200) {
-          this.checkedData = data;
           // 物料信息:puOrderItemList   执行结果:puOrderExecuteList
-          this.tabTableDatas.first = data.puOrderItemList;
-          this.tabTableDatas.second = data.puOrderExecuteList;
+          for (const key in this.tabTableDatas) {
+            this.tabTableDatas[key] = data[key];
+          }
           this.$notify.success({ title: msg });
         } else {
           this.$notify.warning({ title: msg });
@@ -248,10 +247,10 @@ export default {
       }
     },
     // 删除操作
-    async handleDeleteList(prop) {
+    async handleDeleteList(row) {
       try {
         this.loading = true;
-        const { id } = prop;
+        const { id } = row;
         console.log(id, 'id');
         const { code, msg } = await orderApi.remove(id);
         if (code === 200) {
@@ -266,6 +265,10 @@ export default {
         this.loading = false;
       }
     },
+    // 提交
+    async handleSubmit(row) {
+
+    }
 
   },
 };
@@ -307,11 +310,10 @@ export default {
         <el-button-group style="margin-left: 10px">
           <el-button size="mini" type="danger" @click="handleOpenAddDrawer">新增</el-button>
           <el-button size="mini">复制</el-button>
-          <el-button size="mini">提交</el-button>
+
         </el-button-group>
 
         <el-button-group style="margin-left: 10px">
-          <!-- <el-button size="mini" :disabled="checkedData.status != '2'">修订</el-button> -->
           <el-button size="mini">退回</el-button>
         </el-button-group>
 
@@ -332,10 +334,13 @@ export default {
       </el-table-column>
       <el-table-column fixed="right" label="操作" width="120">
         <template slot-scope="scope">
-          <el-button @click.stop="handleOpenSeeDrawer(scope.row)" type="text" size="small">查看</el-button>
+          <!-- <el-button @click.stop="handleOpenSeeDrawer(scope.row)" type="text" size="small">查看</el-button> -->
           <el-button type="text" size="small" @click.stop="handleOpenEditDrawer(scope.row)">
             {{ scope.row.status == '2' ? '修订' : '编辑' }}</el-button>
+          <!-- 0=自由态,1=审批中,2=已审核,3=已驳回 -->
           <el-button type="text" size="small" @click.stop="handleDeleteList(scope.row)">删除</el-button>
+          <el-button v-if="scope.row.status == '0' || scope.row.status == '3'" type="text" size="mini"
+            @click.stop="handleSubmit(scope.row)">提交</el-button>
         </template>
       </el-table-column>
 
@@ -345,11 +350,6 @@ export default {
       :layout="layout">
     </el-pagination>
 
-    <!-- <el-card :body-style="{
-      padding: '20px',
-      display: 'flex',
-      'flex-wrap': 'wrap',
-    }" style="margin: 10px"> -->
     <el-tabs v-model="tabName" @tab-click="handleTabClick" style="width: 100%;padding: 20px 10px">
       <el-tab-pane v-for="(column, index) in tabColumns" :key="index" :label="column.title" :name="column.key">
         <el-table :data="tabTableDatas[column.key]" style="width: 100%" highlight-current-row>
@@ -360,7 +360,6 @@ export default {
         </el-table>
       </el-tab-pane>
     </el-tabs>
-    <!-- </el-card> -->
 
   </el-card>
 </template>

+ 11 - 7
src/views/purchase/purchase-order/see/index.vue

@@ -12,7 +12,10 @@ import orderApi from "@/api/business/purchase/purchase-order";
 const NewColumns = initColumns(Columns, { disabled: true, readonly: true });
 const NewTabColumns = TabColumns.map((element) => ({
   ...element,
-  tableColumns: initColumns(element.tableColumns),
+  tableColumns: initColumns(element.tableColumns, {
+    disabled: true,
+    readonly: true,
+  }),
 }));
 
 
@@ -107,7 +110,8 @@ export default {
                 </el-option>
               </el-select>
               <el-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
-                false-label="N"></el-checkbox>
+                false-label="N" :disabled="column.disabled" :readonly="column.readonly">
+              </el-checkbox>
 
               <el-date-picker v-else-if="column.type === 'DatePicker'" v-model="params[column.key]"
                 :type="column.config.type" :placeholder="column.placeholder" :clearable="column.clearable"
@@ -148,21 +152,21 @@ export default {
                   </el-tag>
                   <el-input v-if="cColumn.type === 'Input'" v-model="scope.row[cColumn.key]"
                     :placeholder="cColumn.placeholder" :clearable="cColumn.clearable" :disabled="cColumn.disabled"
-                    size="mini" style="width: 100%"></el-input>
+                    :readonly="cColumn.readonly" size="mini" style="width: 100%"></el-input>
                   <el-input-number v-if="cColumn.type === 'InputNumber'" v-model="scope.row[cColumn.key]"
                     :controls-position="cColumn.config.controlsPosition" :placeholder="cColumn.placeholder"
-                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" size="mini"
+                    :clearable="cColumn.clearable" :disabled="cColumn.disabled" :readonly="cColumn.readonly" size="mini"
                     style="width: 100%"></el-input-number>
                   <el-input v-if="column.type === 'InputDialog'" v-model="params[column.key]"
-                    :placeholder="column.placeholder" :clearable="column.clearable" :disabled="column.disabled"
-                    :readonly="column.readonly" style="width: 100%; cursor: pointer"
+                    :placeholder="column.placeholder" :clearable="column.clearable" :disabled="cColumn.disabled"
+                    :readonly="cColumn.readonly" style="width: 100%; cursor: pointer"
                     @click.native.stop="openAsyncInputDialog(column, params)">
                     <template #suffix>
                       <el-icon class="el-icon-thumb"></el-icon>
                     </template>
                   </el-input>
                   <el-checkbox v-else-if="column.type === 'Checkbox'" v-model="params[column.key]" true-label="Y"
-                    false-label="N"></el-checkbox>
+                    :disabled="cColumn.disabled" false-label="N"></el-checkbox>
                 </template>
               </el-table-column>
               <!-- <el-table-column fixed="right" label="操作" width="120">

+ 23 - 10
src/views/purchase/task/column.js

@@ -1,18 +1,26 @@
 export const TableColumns = [
   { key: "id", title: "主键" },
-  { key: "material", title: "物料", search: true },
-  { key: "materialName", title: "物料名称", search: true },
-  { key: "status", title: "状态", search: true },
-  { key: "materialDesc", title: "物料/物料描述", search: true },
+  { key: "material", title: "物料", search: true, type: "Input" },
+  { key: "materialName", title: "物料名称", search: true, type: "Input" },
+  {
+    key: "status",
+    title: "状态",
+    search: true,
+    type: "Select",
+    config: {
+      optionsName: "purchase_task_status",
+    },
+  },
+  { key: "materialDesc", title: "物料/物料描述", search: true, type: "Input" },
   { key: "manufacturer", title: "生产厂家" },
   { key: "manufacturerName", title: "生产厂家名称" },
   { key: "priceType", title: "价格类型" },
   { key: "buyer", title: "采购员" },
-  { key: "buyerName", title: "采购员名称", search: true },
+  { key: "buyerName", title: "采购员名称", search: true, type: "Input" },
   { key: "supplier", title: "建议供应商" },
   { key: "supplierName", title: "建议供应商名称" },
   { key: "puOrg", title: "采购组织" },
-  { key: "puOrgName", title: "采购组织名称", search: true },
+  { key: "puOrgName", title: "采购组织名称", search: true, type: "Input" },
   { key: "currency", title: "币种" },
   { key: "currencyName", title: "币种名称" },
   { key: "billYpe", title: "交易类型" },
@@ -22,14 +30,19 @@ export const TableColumns = [
   { key: "puUnit", title: "采购单位" },
   { key: "puUnitName", title: "采购单位名称" },
   { key: "puQty", title: "采购数量" },
-  { key: "demandDate", title: "需求时间", search: true },
+  { key: "demandDate", title: "需求时间", search: true, type: "Input" },
   { key: "projectName", title: "项目名称" },
   { key: "demandPersonal", title: "需求人" },
-  { key: "demandPersonalName", title: "需求人名称", search: true },
-  { key: "demandOrg", title: "需求组织", search: true },
+  {
+    key: "demandPersonalName",
+    title: "需求人名称",
+    search: true,
+    type: "Input",
+  },
+  { key: "demandOrg", title: "需求组织", search: true, type: "Input" },
   { key: "demandOrgName", title: "需求组织名称" },
   { key: "demandDept", title: "需求部门" },
-  { key: "demandDeptName", title: "需求部门名称", search: true },
+  { key: "demandDeptName", title: "需求部门名称", search: true, type: "Input" },
   { key: "isBack", title: "是否退回" },
   { key: "baskCause", title: "退回原因" },
   { key: "backDate", title: "退回日期" },

+ 169 - 30
src/views/purchase/task/first-direct/index.vue

@@ -1,6 +1,6 @@
 <script>
 import { TableColumns } from "./column";
-import { FirstDirect } from "@/api/business/purchase/task";
+import { FIRSTDIRECT, ADD } from "@/api/business/purchase/task";
 import { initColumns } from "@/utils/init";
 export default {
   name: "FirstDirectPurchaseDrawer",
@@ -28,7 +28,7 @@ export default {
     async fetchItem(prop) {
       try {
         this.loading = true;
-        const { code, msg, data } = await FirstDirect(prop);
+        const { code, msg, data } = await FIRSTDIRECT(prop);
         if (code === 200) {
           this.data = data;
           this.$notify.success({ title: msg });
@@ -45,8 +45,34 @@ export default {
     handleCancel() {
       this.setVisible(false);
     },
+    // 保存并新增
+    async handleSubmit() {
+      const params = this.data
+        .map((item) => ({
+          ...item,
+          orderPriceVos: item.orderPriceVos.filter(
+            (citem) => citem.purchaseQuantity
+          ),
+        }))
+        .filter((item) => item.orderPriceVos.length);
+      try {
+        const { code, msg } = await ADD(params);
+        if (code === 200) {
+          this.$notify.success({ title: msg });
+          this.setVisible(false);
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        // this.setVisible(false);
+      }
+    },
+  },
+  created() {
+    console.log("initColumns(TableColumns)", initColumns(TableColumns));
   },
-  created() {},
   mounted() {},
   destroyed() {},
 };
@@ -78,6 +104,9 @@ export default {
         <h3>首次协议直采</h3>
         <div style="text-align: right">
           <el-button :size="size" @click="handleCancel">取 消</el-button>
+          <el-button :size="size" type="info" @click="handleSubmit">
+            新 增
+          </el-button>
         </div>
       </div>
       <div
@@ -107,46 +136,156 @@ export default {
           style="width: 100%"
         >
           <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"
+            prop="supplier"
+            label="供应商"
+            width="125"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            prop="supplierName"
+            label="供应商名称"
+            width="125"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            prop="puOrg"
+            label="采购组织"
+            width="125"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            prop="puOrgName"
+            label="采购组织名称"
+            width="150"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            prop="customer"
+            label="客户"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            prop="customerName"
+            label="客户名称"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            prop="priceType"
+            label="价格类型"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            prop="isDistribution"
+            label="配送价"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            prop="effectiveDate"
+            label="价格生效日期"
+            width="150"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            prop="endDate"
+            label="价格失效日期"
+            width="150"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            prop="tax"
+            label="税率"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            prop="taxFreePrice"
+            label="无税单价"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            prop="taxPrice"
+            label="主含税单价"
+            width="125"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            prop="purchaseQuantity"
+            label="本次采购数量"
+            width="175"
+          >
+            <template slot-scope="scope">
+              <el-input-number
+                v-model="scope.row.purchaseQuantity"
+                :min="0"
+                :max="item.puQty - (item.executeQty || 0)"
+                size="mini"
+                controls-position="right"
+                style="width: 100%"
+              ></el-input-number>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="arrivalDatePlan"
+            label="计划到货日期"
+            width="175"
+          >
+            <template slot-scope="scope">
+              <el-date-picker
+                v-model="scope.row.arrivalDatePlan"
+                size="mini"
+                style="width: 100%"
+              ></el-date-picker>
+            </template>
+          </el-table-column>
+          <el-table-column prop="note" label="备注" width="250">
+            <template slot-scope="scope">
+              <el-input
+                v-model="scope.row.note"
+                autosize
+                size="mini"
+                type="textarea"
+                style="width: 100%"
+              ></el-input>
+            </template>
+          </el-table-column>
+          <!-- <el-table-column
+            v-for="(cItem, cIndex) in tableColumns"
+            :key="cIndex"
+            :prop="cItem.key"
+            :label="cItem.title"
+            :width="cItem.width || 180"
+            :show-overflow-tooltip="cItem.showOverflowTooltip || true"
           >
             <template slot-scope="scope">
               <el-input-number
-                v-if="column.edit && column.editConfig.type === 'InputNumber'"
-                v-model="scope.row[column.key]"
-                :controls-position="column.editConfig.controlsPosition"
-                :min="column.editConfig.min"
-                :max="column.editConfig.max"
-                :size="column.editConfig.size || 'mini'"
-                :placeholder="column.editConfig.placeholder"
+                v-if="cItem.edit && cItem.editConfig.type === 'InputNumber'"
+                v-model="scope.row[cItem.key]"
+                :controls-position="cItem.editConfig.controlsPosition"
+                :min="cItem.editConfig.min"
+                :max="cItem.editConfig.max"
+                :size="cItem.editConfig.size || 'mini'"
+                :placeholder="cItem.editConfig.placeholder"
                 style="width: 90%"
               ></el-input-number>
               <el-date-picker
-                v-else-if="
-                  column.edit && column.editConfig.type === 'DatePicker'
-                "
-                v-model="scope.row[column.key]"
-                :type="column.editConfig.showType"
-                :picker-options="column.editConfig.pickerOptions"
-                :size="column.editConfig.size || 'mini'"
-                :placeholder="column.editConfig.placeholder"
+                v-else-if="cItem.edit && cItem.editConfig.type === 'DatePicker'"
+                v-model="scope.row[cItem.key]"
+                :type="cItem.editConfig.showType"
+                :picker-options="cItem.editConfig.pickerOptions"
+                :size="cItem.editConfig.size || 'mini'"
+                :placeholder="cItem.editConfig.placeholder"
                 style="width: 90%"
               ></el-date-picker>
               <el-input
-                v-else-if="column.edit && column.editConfig.type === 'Textarea'"
-                v-model="scope.row[column.key]"
+                v-else-if="cItem.edit && cItem.editConfig.type === 'Textarea'"
+                v-model="scope.row[cItem.key]"
                 type="textarea"
-                :autosize="column.editConfig.autosize || true"
-                :size="column.editConfig.size || 'mini'"
+                :autosize="cItem.editConfig.autosize || true"
+                :size="cItem.editConfig.size || 'mini'"
                 style="width: 90%"
               ></el-input>
-              <span v-else>{{ scope.row[column.key] }}</span>
+              <span v-else>{{ scope.row[cItem.key] }}</span>
             </template>
-          </el-table-column>
+          </el-table-column> -->
         </el-table>
       </div>
       <!-- <el-pagination

+ 77 - 6
src/views/purchase/task/index.vue

@@ -1,9 +1,17 @@
 <script>
 import { TableColumns, SearchColumns } from "./column";
-import { list } from "@/api/business/purchase/task";
-import { initPage, initLayout, initPageSizes, initParams } from "@/utils/init";
+import { LIST, SHUTDOWN } from "@/api/business/purchase/task";
+import {
+  initPage,
+  initLayout,
+  initPageSizes,
+  initParams,
+  initColumns,
+  initDicts,
+} from "@/utils/init";
 export default {
   name: "PuchaseTask",
+  dicts: initDicts(TableColumns),
   components: {
     SeeDrawer: () => import("./see/index.vue"),
     FirstDirectDrawer: () => import("./first-direct/index.vue"),
@@ -14,7 +22,7 @@ export default {
 
       loading: false,
 
-      searchColumns: SearchColumns,
+      searchColumns: initColumns(SearchColumns),
       params: {
         isAsc: "",
         reasonable: "",
@@ -41,7 +49,7 @@ export default {
       try {
         this.loading = true;
         const { pageNum, pageSize } = page;
-        const { code, msg, rows, total } = await list({
+        const { code, msg, rows, total } = await LIST({
           pageNum,
           pageSize,
           ...params,
@@ -79,10 +87,27 @@ export default {
       this.page.pageNum = prop;
       this.fetchList(this.params, this.page);
     },
-    //
+    // 选择行
     handleSelectionChange(prop) {
       this.selectData = prop;
     },
+    // 行删除
+    async handleShutDown(prop) {
+      try {
+        this.loading = true;
+        const { demandItemId } = prop;
+        const { code, msg } = await SHUTDOWN(demandItemId);
+        if (code === 200) {
+          this.$notify.success({ title: msg });
+        } else {
+          this.$notify.warning({ title: msg });
+        }
+      } catch (err) {
+        this.$notify.error({ title: "error", message: err });
+      } finally {
+        this.loading = false;
+      }
+    },
     // 打开查看drawer
     async handleOpenSeeDrawer(prop) {
       const { id } = prop;
@@ -119,12 +144,37 @@ export default {
           :sm="12"
           :xs="24"
         >
-          <el-form-item :prop="column.key" :label="column.title">
+          <el-form-item
+            v-if="column.type === 'Input'"
+            :prop="column.key"
+            :label="column.title"
+          >
             <el-input
               v-model="params[column.key]"
               :placeholder="column.placeholder"
             ></el-input>
           </el-form-item>
+          <el-form-item
+            v-if="column.type === 'Select'"
+            :prop="column.key"
+            :label="column.title"
+          >
+            <el-select
+              v-model="params[column.key]"
+              :disabled="column.disabled"
+              :clearable="column.clearable"
+              :placeholder="column.placeholder"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in dict.type[column.config.optionsName]"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
         </el-col>
       </el-row>
     </el-form>
@@ -140,6 +190,27 @@ export default {
       <el-col :span="18" style="text-align: right">
         <el-button
           :size="size"
+          :disabled="selectData.length !== 1"
+          @click="handleShutDown(selectData[0])"
+        >
+          分配
+        </el-button>
+        <el-button
+          :size="size"
+          :disabled="selectData.length !== 1"
+          @click="handleShutDown(selectData[0])"
+        >
+          退回需求
+        </el-button>
+        <el-button
+          :size="size"
+          :disabled="selectData.length !== 1"
+          @click="handleShutDown(selectData[0])"
+        >
+          行删除
+        </el-button>
+        <el-button
+          :size="size"
           :disabled="!selectData.length"
           @click="handleOpenFristDirectDrawer(selectData)"
         >

+ 8 - 0
src/views/purchase/transferOrder/add.vue

@@ -245,6 +245,9 @@
 
       <el-tabs style="margin-top: 10px;" type="border-card">
         <el-tab-pane label="物料信息">
+          <div class="btn_grooup">
+            <el-button type="primary" size="small" @click="addLine">增行</el-button>
+          </div>
           <el-table
           :data="materialInfo" 
           fit
@@ -617,6 +620,11 @@ export default {
         }
       })
     },
+    addLine() {},
+    delLine(index) {
+      // console.log('删除行:', index)
+      // this.basicForm.puDemandItemList.splice(index, 1)
+    },
   }
 }
 </script>

+ 2 - 2
vue.config.js

@@ -37,14 +37,14 @@ module.exports = {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
         // target: `http://172.16.100.107:8080/drp-admin`, //测试
-        target: `http://test-sy.derom.com/drp-admin`, //测试
+        // target: `http://test-sy.derom.com/drp-admin`, //测试
         // target: `http://release-sy.derom.com/drp-admin`, //预发
         // target: `http://sy.derom.com/drp-admin`, //生产
         // target: `http://172.16.63.202:8000/drp-admin`, // D本地
         // target: `http://172.16.62.241:8000/drp-admin`, //笑寒本地
         // target: `http://172.16.13.152:8000/drp-admin`, //豪哥本地
         // target: `http://172.16.13.47:8000/drp-admin`, //石杨本地
-        // target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
+        target: `http://172.16.13.113:8000/drp-admin`, //DWT本地
         // target: `http://172.16.13.77:8000/drp-admin`, //TQ本地
         changeOrigin: true,
         pathRewrite: {