Browse Source

Merge branch 'purchaseDev' of http://172.16.100.139/new-business/drp-web into purchaseDev

002201 1 year ago
parent
commit
f221f50216

+ 6 - 0
src/components/super-table/index.vue

@@ -1,4 +1,5 @@
 <template>
+  <!-- v-if="innerValue.length" -->
   <el-table
     v-bind="$attrs"
     v-on="$listeners"
@@ -34,6 +35,11 @@
           v-bind="attr"
           v-model="scope.row[item.key]"
         ></component>
+        <component
+          v-else-if="attr.is === 'el-checkbox'"
+          v-bind="attr"
+          v-model="scope.row[item.key]"
+        ></component>
         <component v-else is="span">{{
           scope.row[item.key] || "--"
         }}</component>

+ 0 - 173
src/views/material/requisition/index copy.vue

@@ -1,173 +0,0 @@
-<!-- 物料申请单 -->
-<template>
-  <div class="material-requisition">
-    <!-- 操作栏 -->
-    <el-row :gutter="10" class="mb10">
-      <!-- 新增、修改、删除、复制 -->
-      <el-col :span="1.5">
-        <el-button-group>
-          <el-button size="small" @click="handleInster">新增</el-button>
-          <el-button size="small" @click="handleEdit">修改</el-button>
-          <el-button size="small" @click="handleDel">删除</el-button>
-          <el-button size="small" @click="handleCopy">复制</el-button>
-        </el-button-group>
-      </el-col>
-
-      <!-- 查询、刷新 -->
-      <el-col :span="1.5">
-        <el-button-group>
-          <el-button size="small" @click="handleQuery">查询</el-button>
-          <el-button size="small" @click="handleRefresh">刷新</el-button>
-        </el-button-group>
-      </el-col>
-
-      <!-- 提交、收回  审批、取消审批、查看审批意见 -->
-      <el-col :span="1.5">
-        <el-button-group>
-
-          <el-dropdown split-button size="small" @click="handleSubmit(true)" @command="handleSubmit">
-            提交
-            <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item :command="isSubmit(true)">提交</el-dropdown-item>
-              <el-dropdown-item :command="isSubmit(false)">收回</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-
-          <el-dropdown split-button size="small" @click="handleApproval('approval')" @command="handleApproval">
-            审批
-            <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item :command="approvalState('approval')">审批</el-dropdown-item>
-              <el-dropdown-item :command="approvalState('cancel')">取消审批</el-dropdown-item>
-              <el-dropdown-item :command="approvalState('view')">查看审批意见</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-        </el-button-group>
-      </el-col>
-
-      <!-- 附件管理 -->
-      <el-col :span="1.5">
-        <el-button-group>
-          <el-button size="small" v-if="isComponent == 'requestDetails'">附件管理</el-button>
-          <!-- <el-button size="small">维护物料</el-button> -->
-
-        </el-button-group>
-      </el-col>
-    </el-row>
-
-    <component :is="isComponent" @actionBar="handleActionBar" :headerParams="headerParams"></component>
-  </div>
-</template>
-
-<script>
-import './style/index.scss';
-
-import requestList from './list.vue';
-import requestDetails from './details.vue';
-
-import Store from '@/store/index'
-export default {
-  name: "material-requisition",
-  components: {
-    requestList,
-    requestDetails,
-  },
-  data() {
-    return {
-      isComponent: 'requestList',
-      // 头部参数
-      headerParams: {
-        // 是否编辑
-        isEdit: false,
-      },
-      // 总条数
-      total: 1,
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        code: null,
-        name: null
-      },
-    };
-  },
-  created() {
-    this.getList();
-    console.log(Store.state.user, 'Store');
-  },
-  methods: {
-    // 新增
-    handleInster() {
-      console.log('新增');
-      this.isComponent = 'requestDetails';
-    },
-    // 修改
-    handleEdit() {
-      console.log('修改');
-    },
-    // 删除
-    handleDel() {
-      console.log('删除');
-    },
-    // 复制
-    handleCopy() {
-      console.log('复制');
-    },
-    // 查询
-    handleQuery() {
-      console.log('查询');
-    },
-    // 刷新
-    handleRefresh() {
-      console.log('刷新');
-    },
-    // 提交
-    handleSubmit(val) {
-      console.log(val, '提交');
-    },
-    isSubmit(type) {
-      return type
-    },
-    // 审批
-    handleApproval(val) {
-      console.log(val, '审批');
-    },
-    approvalState(type) {
-      return type
-    },
-    // 触发动态组件
-    handleActionBar(params) {
-      console.log(`需要更换至${params}~~~`);
-      this.isComponent = params;
-    },
-
-    handleClick() { },
-    /** 查询【请填写功能名称】列表 */
-    getList() {
-
-    },
-    // 取消按钮
-    cancel() {
-
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-
-
-  }
-};
-</script>

+ 8 - 1
src/views/material/requisition/index.vue

@@ -60,6 +60,9 @@
       <el-col :span="1.5">
         <el-button size="small" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button type="primary" size="small" plain @click="download('/system/apply/material/download',{},'申请单模板.xlsx')">模板下载</el-button>
+      </el-col>
       <!-- <el-col :span="1.5">
         <el-button type="primary" size="small" plain>导入</el-button>
       </el-col>
@@ -100,11 +103,12 @@
           fixed="right"
           label="操作"
           align="center"
-          width="150"
+          width="180"
           >
           <template slot-scope="scope">
             <el-button type="text" size="small" @click="check(scope.row)">查看</el-button>
             <el-button @click="edit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">编辑</el-button>
+            <!-- <el-button @click="commit(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3" type="text" size="small">提交</el-button> -->
             <el-button type="text" size="small" @click="deleteRow(scope.row)" v-if="scope.row.status == 0 || scope.row.status == 3">删除</el-button>
           </template>
         </el-table-column>
@@ -243,6 +247,9 @@ export default {
       this.rowDetail = row
       this.disable = false
     },
+    commit(row) {
+      console.log('row', row)
+    },
     deleteRow(row) {
       this.$confirm('是否删除此条数据?', '提示', {
           confirmButtonText: '确定',

+ 0 - 217
src/views/material/requisition/index_bak.vue

@@ -1,217 +0,0 @@
-<!-- 物料申请单 -->
-<template>
-  <div class="material-requisition">
-    <!-- 操作栏 -->
-    <el-row :gutter="10" class="mb10">
-      <!-- 新增、修改、删除、复制 -->
-      <el-col :span="1.5">
-        <el-button-group>
-          <el-button size="small" @click="handleInster">新增</el-button>
-          <el-button size="small" @click="handleEdit">修改</el-button>
-          <el-button size="small" @click="handleDel">删除</el-button>
-          <el-button size="small" @click="handleCopy">复制</el-button>
-        </el-button-group>
-      </el-col>
-
-      <!-- 查询、刷新 -->
-      <el-col :span="1.5">
-        <el-button-group>
-          <el-button size="small" @click="handleQuery">查询</el-button>
-          <el-button size="small" @click="handleRefresh">刷新</el-button>
-        </el-button-group>
-      </el-col>
-
-      <!-- 提交、收回  审批、取消审批、查看审批意见 -->
-      <el-col :span="1.5">
-        <el-button-group>
-
-          <el-dropdown split-button size="small" @click="handleSubmit(true)" @command="handleSubmit">
-            提交
-            <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item :command="isSubmit(true)">提交</el-dropdown-item>
-              <el-dropdown-item :command="isSubmit(false)">收回</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-
-          <el-dropdown split-button size="small" @click="handleApproval('approval')" @command="handleApproval">
-            审批
-            <el-dropdown-menu slot="dropdown">
-              <el-dropdown-item :command="approvalState('approval')">审批</el-dropdown-item>
-              <el-dropdown-item :command="approvalState('cancel')">取消审批</el-dropdown-item>
-              <el-dropdown-item :command="approvalState('view')">查看审批意见</el-dropdown-item>
-            </el-dropdown-menu>
-          </el-dropdown>
-        </el-button-group>
-      </el-col>
-
-      <!-- 附件管理 -->
-      <el-col :span="1.5">
-        <el-button-group>
-          <el-button size="small" v-if="isComponent == 'requestDetails'">附件管理</el-button>
-          <!-- <el-button size="small">维护物料</el-button> -->
-
-        </el-button-group>
-      </el-col>
-    </el-row>
-
-    <el-card class="request-list">
-      <!-- v-loading="loading" @selection-change="handleSelectionChange" -->
-      <el-table :data="taskList" @cell-dblclick="handledbClick" class="request-table">
-        <el-table-column type="index" label="序号" width="55" align="center" />
-        <el-table-column label="主键" align="center" prop="id" />
-        <el-table-column label="编码" align="center" prop="code" />
-        <el-table-column label="名称" align="center" prop="name" />
-        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-          <template slot-scope="scope">
-            <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
-              v-hasPermi="['system:task:edit']">修改</el-button>
-            <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
-              v-hasPermi="['system:task:remove']">删除</el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-
-      <!-- v-show="total > 0" -->
-      <pagination :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
-        @pagination="getList" />
-    </el-card>
-  </div>
-</template>
-
-<script>
-import './style/index.scss';
-
-import requestList from './list.vue';
-import requestDetails from './details.vue';
-
-import Store from '@/store/index'
-export default {
-  name: "material-requisition",
-  components: {
-    requestList,
-    requestDetails,
-  },
-  data() {
-    return {
-      isComponent: 'requestList',
-      // 头部参数
-      headerParams: {
-        // 是否编辑
-        isEdit: false,
-      },
-      // 总条数
-      total: 1,
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        code: null,
-        name: null
-      },
-      // 物料基本信息数据
-      taskList: [
-        {
-          id: 1,
-          code: '001',
-          name: '名称'
-        }
-      ],
-      // 总条数
-      total: 0,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        code: null,
-        name: null
-      },
-    };
-  },
-  created() {
-    this.getList();
-    console.log(Store.state.user, 'Store');
-  },
-  methods: {
-    // 新增
-    handleInster() {
-      console.log('新增');
-      this.isComponent = 'requestDetails';
-    },
-    // 修改
-    handleEdit() {
-      console.log('修改');
-    },
-    // 删除
-    handleDel() {
-      console.log('删除');
-    },
-    // 复制
-    handleCopy() {
-      console.log('复制');
-    },
-    // 查询
-    handleQuery() {
-      console.log('查询');
-    },
-    // 刷新
-    handleRefresh() {
-      console.log('刷新');
-    },
-    // 提交
-    handleSubmit(val) {
-      console.log(val, '提交');
-    },
-    isSubmit(type) {
-      return type
-    },
-    // 审批
-    handleApproval(val) {
-      console.log(val, '审批');
-    },
-    approvalState(type) {
-      return type
-    },
-    // 触发动态组件
-    handleActionBar(params) {
-      console.log(`需要更换至${params}~~~`);
-      this.isComponent = params;
-    },
-
-    handleClick() { },
-    /** 查询【请填写功能名称】列表 */
-    getList() {
-
-    },
-    // 取消按钮
-    cancel() {
-
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 双击行
-    handledbClick(e) {
-      console.log(e, '双击行');
-      // console.log(this.$tab.openPage('测试', '/material/requisition/detail'), 'this.$tab');
-      console.log(this.$router.push('/material/requisition/detail'), 'this.$tab');
-      // this.$emit("actionBar", "requestDetails")
-    },
-    handleSelectionChange() { },
-
-  }
-};
-</script>

+ 0 - 62
src/views/material/requisition/list.vue

@@ -1,62 +0,0 @@
-<!-- 物料申请单——列表 -->
-<template>
-  <el-card class="request-list">
-    <!-- v-loading="loading" @selection-change="handleSelectionChange" -->
-    <el-table :data="taskList" @cell-dblclick="handledbClick" class="request-table">
-      <el-table-column type="index" label="序号" width="55" align="center" />
-      <el-table-column label="主键1" align="center" prop="id" />
-      <el-table-column label="编码" align="center" prop="code" />
-      <el-table-column label="名称" align="center" prop="name" />
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
-            v-hasPermi="['system:task:edit']">修改</el-button>
-          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
-            v-hasPermi="['system:task:remove']">删除</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-
-    <!-- v-show="total > 0" -->
-    <pagination :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
-      @pagination="getList" />
-  </el-card>
-</template>
-
-<script>
-export default {
-  name: 'request-list',
-  data() {
-    return {
-      // 物料基本信息数据
-      taskList: [
-        {
-          id: 1,
-          code: '001',
-          name: '名称'
-        }
-      ],
-      // 总条数
-      total: 0,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        code: null,
-        name: null
-      },
-    }
-  },
-  methods: {
-    // 双击行
-    handledbClick() {
-      this.$emit("actionBar", "requestDetails")
-    },
-    handleSelectionChange() { },
-
-    getList() {
-
-    },
-  }
-}
-</script>

+ 159 - 151
src/views/purchase/PurchaseDemandList/add.vue

@@ -280,6 +280,7 @@
           <el-table-column show-overflow-tooltip label="集团预测分类" align="center"  prop="forecastClassify" width="120px"/>
           <el-table-column show-overflow-tooltip label="近一月需求" align="center"  prop="onemonthAvgVolume" width="120px"/>
           <el-table-column show-overflow-tooltip label="近三月需求" align="center"  prop="threemonthAvgVolume" width="120px"/>
+          <el-table-column show-overflow-tooltip label="采购在途" align="center"  prop="puFreight" width="120px"/>
           <el-table-column show-overflow-tooltip label="交货日期" align="center"  prop="deliveryDate" width="230px">
             <template slot-scope="scope">
               <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'deliveryDate'" :rules="{ required: true, message: '请填写交货日期', trigger: 'blur' }">
@@ -764,6 +765,7 @@ export default {
         item.forecastClassify = ''
         item.onemonthAvgVolume = ''
         item.threemonthAvgVolume = ''
+        item.puFreight = ''
         item.superiorAllotQty = ''
         item.resDemandQty = ''
         item.executeQty = ''
@@ -907,6 +909,7 @@ export default {
         forecastClassify: null,
         onemonthAvgVolume: null,
         threemonthAvgVolume: null,
+        puFreight: null,
         deliveryDate: null,
         isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
         isReplenishment: this.basicForm.billType == 'BDXQ'? 'Y': 'N',
@@ -1105,6 +1108,7 @@ export default {
             item.forecastClassify = ''
             item.onemonthAvgVolume = ''
             item.threemonthAvgVolume = ''
+            item.puFreight = ''
             item.superiorAllotQty = ''
             item.resDemandQty = ''
             item.executeQty = ''
@@ -1184,6 +1188,7 @@ export default {
     },
     // 粘贴来的数据
     async pasteMe(e, scope, index) {
+      this.$modal.loading("正在处理数据...");
       e.preventDefault() //阻止默认粘贴事件
       let source = e.clipboardData.getData("Text");
       console.log('scope', scope.column.property)
@@ -1196,160 +1201,162 @@ export default {
       })
       console.log('复制的数组',rows);
       console.log('列表的数组',this.basicForm.puDemandItemList)
-      let linArr = []
-      // for (let i = 0; i<rows.length; i++) {
-        // console.log('items',rows[i])
+      if (rows.length < 1000) {
         await getRefer({ type: 'MATERIAL_PARAM', materialCodeList: rows }).then(res => {
-          // if (res.code === 200) {
-          //   let line = {
-          //     contacts: null,
-          //     id: null,
-          //     demandId: null,
-          //     status: null,
-          //     businessDept: null,
-          //     businessDeptName: null,
-          //     materialCategory: null,
-          //     buyer: null,
-          //     buyerName: null,
-          //     mateiralClassifyOne: null,
-          //     materialClassifyOneName: null,
-          //     materialClassifyTwo: null,
-          //     materialClassifyTwoName: null,
-          //     materialClassifyThree: null,
-          //     materialClassifyThreeName: null,
-          //     materialClassifyFour: null,
-          //     materialClassifyFourName: null,
-          //     materialCode: null,
-          //     material: null,
-          //     materialName: null,
-          //     classifyId: null,
-          //     specification: null,
-          //     unit: null,
-          //     unitName: null,
-          //     manufacturerName: null,
-          //     registrant: null,
-          //     puPeriod: null,
-          //     expiryUnit: null,
-          //     expiry: null,
-          //     minPackage: null,
-          //     minOrderQty: null,
-          //     minBatch: null,
-          //     safeStock: null,
-          //     averageQtyMonth: null,
-          //     qty: null,
-          //     adjustmentPersonal: null,
-          //     adjustmentTime: null,
-          //     manualRegulation: null,
-          //     updateCause: null,
-          //     reservedProportion: null,
-          //     reservedPeriod: null,
-          //     reservedQty: null,
-          //     demandPeriod: null,
-          //     forecastClassify: null,
-          //     onemonthAvgVolume: null,
-          //     threemonthAvgVolume: null,
-          //     deliveryDate: null,
-          //     isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
-          //     isReplenishment: this.basicForm.billType == 'BDXQ' ? 'Y' : 'N',
-          //     isBatchLock: 'N',
-          //     remark: null,
-          //     puRemark: null,
-          //     lastWarehouseQty: null,
-          //     resDemandQty: null,
-          //     lastWarehouse: null,
-          //     lastWarehouseName: null,
-          //     deliveryWarehouse: null,
-          //     deliveryWarehouseName: null,
-          //     lastAllocation: null,
-          //     lastAllocationName: null,
-          //     deliveryAllocation: null,
-          //     deliveryAllocationName: null,
-          //     passageOn: null,
-          //     puOrg: null,
-          //     purOrgName: null,
-          //     lastStockQty: null,
-          //     superiorCenterQty: null,
-          //     superiorAllotQty: null,
-          //     availableQty: null,
-          //     statusAllot: 'N',
-          //     additionalSupplier: null,
-          //     additionalSupplierName: null,
-          //     periodUnit: null,
-          //     demandCustomer: this.basicForm.customer,
-          //     demandCustomerName: this.basicForm.customerName,
-          //     businessDept: this.basicForm.demandDept,
-          //     businessDeptName: null,
-          //     lastStockOrg: null,
-          //     lastStockOrgName: null,
-          //     superiorStockOrg: null,
-          //     superiorStockOrgName: null,
-          //     allotCode: null,
-          //     deliveryAddress: null,
-          //     deliveryAddressName: null,
-          //     contacts: null,
-          //     contactsPhone: null,
-          //     address: null,
-          //     source: null,
-          //     priceType: 'order',
-          //     puManagerApprover: null,
-          //     puManagerApproverName: null,
-          //     processTime: null,
-          //     affirmer: null,
-          //     tenantId: null,
-          //     revision: null,
-          //     createBy: null,
-          //     createByName: null,
-          //     createTime: null,
-          //     updateBy: null,
-          //     updateByName: null,
-          //     updateTime: null,
-          //     delFlag: 0,
-          //     // 新增字段
-          //     model: null,
-          //     storageCondition: null,
-          //     transportationCondition: null,
-          //   }
-          //   line.businessDept = res.rows[0].businessDepartment
-          //   line.businessDeptName = res.rows[0].businessDepartmentName
-          //   line.materialCode = res.rows[0].code
-          //   line.material = res.rows[0].id
-          //   line.materialName = res.rows[0].name
-          //   line.classifyId = res.rows[0].classifyId
-          //   line.materialClassifyOneName = res.rows[0].oneClass
-          //   line.materialClassifyTwoName = res.rows[0].twoClass
-          //   line.materialClassifyThreeName = res.rows[0].threeClass
-          //   line.materialClassifyFourName = res.rows[0].fourClass
-          //   line.specification = res.rows[0].specification
-          //   line.model = res.rows[0].model
-          //   line.unit = res.rows[0].unitId
-          //   line.unitName = res.rows[0].unitIdName
-          //   line.registrant = res.rows[0].registrant
-          //   line.manufacturerName = res.rows[0].manufacturerIdName
-          //   line.puPeriod = res.rows[0].deliveryPeriod
-          //   line.expiry = res.rows[0].usefulLife
-          //   line.expiryUnit = res.rows[0].expiryUnitIdName
-          //   // line.minPackage = res.rows[0].usefulLife
-          //   line.minPackage = res.rows[0].minPackQty
-          //   line.minOrderQty = res.rows[0].minOrderQty
-          //   line.minBatch = res.rows[0].minBatchQty
-          //   line.safeStock = res.rows[0].safeStock
-          //   line.purOrgName = res.rows[0].purchasingOrganizationName
-          //   line.puOrg = res.rows[0].purchasingOrganization
-          //   // 物料存储条件和运输条件
-          //   line.transportationCondition = res.rows[0].transportationCondition
-          //   line.storageCondition = res.rows[0].storageCondition
-          //   linArr[i] = line
-          // }
+          if (res.code === 200) {
+            let rowList = res.rows
+            for (let i = 0; i<rowList.length; i++) {
+            let line = {
+              contacts: null,
+              id: null,
+              demandId: null,
+              status: null,
+              businessDept: null,
+              businessDeptName: null,
+              materialCategory: null,
+              buyer: null,
+              buyerName: null,
+              mateiralClassifyOne: null,
+              materialClassifyOneName: null,
+              materialClassifyTwo: null,
+              materialClassifyTwoName: null,
+              materialClassifyThree: null,
+              materialClassifyThreeName: null,
+              materialClassifyFour: null,
+              materialClassifyFourName: null,
+              materialCode: null,
+              material: null,
+              materialName: null,
+              classifyId: null,
+              specification: null,
+              unit: null,
+              unitName: null,
+              manufacturerName: null,
+              registrant: null,
+              puPeriod: null,
+              expiryUnit: null,
+              expiry: null,
+              minPackage: null,
+              minOrderQty: null,
+              minBatch: null,
+              safeStock: null,
+              averageQtyMonth: null,
+              qty: null,
+              adjustmentPersonal: null,
+              adjustmentTime: null,
+              manualRegulation: null,
+              updateCause: null,
+              reservedProportion: null,
+              reservedPeriod: null,
+              reservedQty: null,
+              demandPeriod: null,
+              forecastClassify: null,
+              onemonthAvgVolume: null,
+              threemonthAvgVolume: null,
+              puFreight: null,
+              deliveryDate: null,
+              isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
+              isReplenishment: this.basicForm.billType == 'BDXQ' ? 'Y' : 'N',
+              isBatchLock: 'N',
+              remark: null,
+              puRemark: null,
+              lastWarehouseQty: null,
+              resDemandQty: null,
+              lastWarehouse: null,
+              lastWarehouseName: null,
+              deliveryWarehouse: null,
+              deliveryWarehouseName: null,
+              lastAllocation: null,
+              lastAllocationName: null,
+              deliveryAllocation: null,
+              deliveryAllocationName: null,
+              passageOn: null,
+              puOrg: null,
+              purOrgName: null,
+              lastStockQty: null,
+              superiorCenterQty: null,
+              superiorAllotQty: null,
+              availableQty: null,
+              statusAllot: 'N',
+              additionalSupplier: null,
+              additionalSupplierName: null,
+              periodUnit: null,
+              demandCustomer: this.basicForm.customer,
+              demandCustomerName: this.basicForm.customerName,
+              businessDept: this.basicForm.demandDept,
+              businessDeptName: null,
+              lastStockOrg: null,
+              lastStockOrgName: null,
+              superiorStockOrg: null,
+              superiorStockOrgName: null,
+              allotCode: null,
+              deliveryAddress: null,
+              deliveryAddressName: null,
+              contacts: null,
+              contactsPhone: null,
+              address: null,
+              source: null,
+              priceType: 'order',
+              puManagerApprover: null,
+              puManagerApproverName: null,
+              processTime: null,
+              affirmer: null,
+              tenantId: null,
+              revision: null,
+              createBy: null,
+              createByName: null,
+              createTime: null,
+              updateBy: null,
+              updateByName: null,
+              updateTime: null,
+              delFlag: 0,
+              // 新增字段
+              model: null,
+              storageCondition: null,
+              transportationCondition: null,
+            }
+              line.businessDept = rowList[i].businessDepartment
+              line.businessDeptName = rowList[i].businessDepartmentName
+              line.materialCode = rowList[i].code
+              line.material = rowList[i].id
+              line.materialName = rowList[i].name
+              line.classifyId = rowList[i].classifyId
+              line.materialClassifyOneName = rowList[i].oneClass
+              line.materialClassifyTwoName = rowList[i].twoClass
+              line.materialClassifyThreeName = rowList[i].threeClass
+              line.materialClassifyFourName = rowList[i].fourClass
+              line.specification = rowList[i].specification
+              line.model = rowList[i].model
+              line.unit = rowList[i].unitId
+              line.unitName = rowList[i].unitIdName
+              line.registrant = rowList[i].registrant
+              line.manufacturerName = rowList[i].manufacturerIdName
+              line.puPeriod = rowList[i].deliveryPeriod
+              line.expiry = rowList[i].usefulLife
+              line.expiryUnit = rowList[i].expiryUnitIdName
+              // line.minPackage = rowList[i].usefulLife
+              line.minPackage = rowList[i].minPackQty
+              line.minOrderQty = rowList[i].minOrderQty
+              line.minBatch = rowList[i].minBatchQty
+              line.safeStock = rowList[i].safeStock
+              line.purOrgName = rowList[i].purchasingOrganizationName
+              line.puOrg = rowList[i].purchasingOrganization
+              // 物料存储条件和运输条件
+              line.transportationCondition = rowList[i].transportationCondition
+              line.storageCondition = rowList[i].storageCondition
+              this.basicForm.puDemandItemList.push(line)
+              // console.log('临时数组', line)
+            }
+            this.$modal.msgSuccess("共粘贴" + rowList.length + '条数据');
+          }
+        }).catch(err => {
+          this.$modal.closeLoading();
         })
-        console.log('临时数组', linArr)
-      // }
-      this.basicForm.puDemandItemList.push(...linArr)
+        this.$modal.closeLoading();
       console.log('列表', this.basicForm.puDemandItemList)
-      // this.basicForm.puDemandItemList.forEach(e => {
-      //   rows.forEach(d => {
-      //     e.materialCode = d
-      //   })
-      // })
+      } else {
+        this.$modal.msgWarning("复制长度不能超过1000!");
+      }
     },
     // 明细行选择物料编码带出数据
     chooseMaterial(index) {
@@ -1496,6 +1503,7 @@ export default {
           item.forecastClassify = ''
           item.onemonthAvgVolume = ''
           item.threemonthAvgVolume = ''
+          item.puFreight = ''
           item.superiorAllotQty = ''
           item.resDemandQty = ''
           item.executeQty = ''

+ 16 - 2
src/views/purchase/PurchaseDemandList/index.vue

@@ -183,11 +183,12 @@
           fixed="right"
           label="操作"
           align="center"
-          width="150"
+          width="180"
           >
           <template slot-scope="scope">
             <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="edit(scope.row)">编辑</el-button>
+            <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="commit(scope.row)">提交</el-button>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="deleteids(scope.row)">删除</el-button>
           </template>
         </el-table-column>
@@ -289,7 +290,7 @@ import Add from './add.vue'
 import Refers from '@/components/Refers/refers.vue'
 import TreeRefers from '@/components/Refers/treeRefer.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
-import {getDemandList, delDemand, downLoadDemand, exportDemand } from '@/api/purchase/purchaseDemand.js'
+import {getDemandList, delDemand, downLoadDemand, exportDemand, submitDemand } from '@/api/purchase/purchaseDemand.js'
 export default {
   name: 'PurchaseDemandList',
   components: {
@@ -572,6 +573,19 @@ export default {
       this.rowDetail = row
       this.disable = false
     },
+    commit(row) {
+      console.log('row', row)
+      this.$modal.loading("提交中...");
+      submitDemand(row).then(res => {
+        if (res.code === 200) {
+          this.$modal.msgSuccess("提交成功");
+          this.$modal.closeLoading();
+          this.getList(this.queryParams)
+        }
+      }).catch(err => {
+        this.$modal.closeLoading();
+      })
+    },
     // 行内删除
     deleteids(row) {
       console.log('row', row)

File diff suppressed because it is too large
+ 761 - 197
src/views/purchase/purchase-order/column.js


+ 173 - 43
src/views/purchase/purchase-order/index.vue

@@ -5,19 +5,31 @@ import orderApi from "@/api/business/purchase/purchase-order";
 import {
   initPage,
   initParams,
-  initDicts,
+  // initDicts,
 } from "@/utils/init/index.js";
+import {  initDicts } from "@/utils/init.js";
+
+const allColumns = [...TableColumns, ...SearchColumns];
+
+TabColumns.forEach(column =>{
+  allColumns.push(...column.tableColumns)
+})
 
 
 export default {
   name: "PuchaseOrder",
-  dicts: initDicts(SelectColumns),
+  // dicts: initDicts(SelectColumns),
+  dicts: [...initDicts(allColumns)],
   components: {
     AddDrawer: () => import('./add/index.vue'),
     SeeDrawer: () => import('./see/index.vue'),
     EditDrawer: () => import('./edit/index.vue'),
     PurchaseReturnDrawer: () => import('./purchaseReturn/index.vue'),
-  },
+    ElHideTableColumnButton: () =>
+      import("@/components/hide-table-column/index.vue"),
+    ElSuperTable: () => import("@/components/super-table/index.vue"),
+    ElSuperSearch: () => import("@/components/super-search/index.vue"),
+    },
   data() {
     const initTabColumns = () => TabColumns;
     return {
@@ -52,6 +64,16 @@ export default {
         ? this.searchColumns.slice(0, 4)
         : this.searchColumns;
     },
+    // tableShowColumns:{
+    //   get() {
+    //     return this.tableColumns.filter(({ attr }) => attr.isHidden);
+    //   },
+    // },
+    $dicts: {
+      get: function () {
+        return this.dict.type;
+      },
+    },
   },
   created() {
     // this.fetchList(this.params, this.page);
@@ -61,8 +83,11 @@ export default {
     async fetchList(data, params) {
 
       try {
+
         this.loading = true;
+
         params['isAsc'] = 'desc';
+        
         params['orderByColumn'] = 'updateTime';
         
         const { code, msg, rows, total } = await orderApi.list(data, params);
@@ -92,54 +117,66 @@ export default {
 
     // 刷新操作
     handleRefreshList() {
+
       this.page = initPage();
+
       this.checkedList = [];
               
       this.checkedTabList = [];
 
       this.primaryResource = {};
+
       this.fetchList(this.params, this.page);
     },
     // 查询操作
     handleQueryList() {
+
       let {date} = this.params;
+
       this.params.startDate = date ? date[0] :'';
+
       this.params.endDate = date ? date[1] : '';
+
       this.fetchList(this.params, this.page);
+
     },
     // 重置操作
     handleResetList() {
+
       this.page = initPage();
+
       this.params = initParams(SearchColumns);
+
       this.fetchList(this.params, this.page);
+
     },
     handleTabClick() { },
     // 新增
     handleOpenAddDrawer(copyVal) {
+
       const { setVisible, setCopyParams } = this.$refs.addDrawerFef;
+
       setVisible(true,(copyVal.id && copyVal.id != '') ? true :false);
 
       copyVal.id && copyVal.id != '' && setCopyParams(copyVal.id);
     },
     // 复制
     handleCopy() {
-
-      // let rowDetails = {
-      //   ... this.checkedList[0],
-      //   id: '',
-      //   code: '',
-      //   status: '0',
-      //   source: '3',
-      // };
       this.handleOpenAddDrawer(this.checkedList[0]);
     },
     // 查看
     async handleOpenSeeDrawer(row) {
+
       window.clearInterval(this.timeOut);
+
       const { id } = row;
+
       const { setVisible, fetchItem } = this.$refs.seeDrawerRef;
+
       await setVisible(true);
+
       await fetchItem(id);
+
     },
     // 编辑、修订
     async handleOpenEditDrawer(row) {
@@ -275,10 +312,7 @@ export default {
           }
 
         })
-      } catch (error) {
-      } finally {
-      }
-      
+      } catch (error) {} 
     },
 
     // 判断“整单退回”按钮
@@ -316,9 +350,13 @@ export default {
     },
     // 行退回
     handleLineReturn(){
+
       let ids = this.checkedTabList.map(checked => checked.id);
+
       console.log(ids,'行退回ids');
+
       this.handleReturn(this.primaryResource.id,ids);
+
     },
     // 退回接口
     handleReturn(id,documentIds){
@@ -331,9 +369,13 @@ export default {
         }).then(async ({ value }) => {
 
           let data = {
+
             id:Number(id),
+
             documentIds:documentIds.map(ids =>Number(ids)),
+
             baskCause: value,
+            
           };
 
           console.log(data);
@@ -374,7 +416,6 @@ export default {
 
           let puOrderIds = this.checkedList.map(order => Number(order.id));
 
-          // console.log(puOrderIds,'puOrderIds');
           let { code } = await orderApi.close({ puOrderIds });
 
           if (code === 200) {
@@ -389,29 +430,33 @@ export default {
     async handlePaymentRequest(){
       // name:工号
       try {
-        // let {name} = this.$store.state.user;
 
         let {code,msg} = await orderApi.payRequest();
 
         if(code == 200){
+
           msg.replace(/\/n/g,'');
+
           let url = `uclient://start/http://172.16.100.2:8081?ssoKey=${msg}&uiloader=nc.uap.lfw.applet.PortalUILoader&nodeId=40040407`
 
           window.location.href = url;
 
         }
 
-      } catch (error) {
-        
-      }
+      } catch (error) {}
       
     },
     // 退货
     async handlePurchaseReturn(){
+
       const { id } = this.checkedList[0];
+
       const { setVisible, fetchStorage } = this.$refs.PurchaseReturnDrawerRef;
+
       await setVisible(true);
+
       await fetchStorage(id);
+
     },
     // 主表Select框
     handleSelect(selection, row) {
@@ -430,20 +475,34 @@ export default {
     },
     // 保留两位小数,补位
     keepTwoDecimalStr(num) {
+
       if(num){
+
           const result = Number(num.toString().match(/^\d+(?:\.\d{0,2})?/));
+
           let s = result.toString();
+
           let rs = s.indexOf('.');
+
           if (rs < 0) {
+
             rs = s.length;
+
             s += '.';
+
           }
           while (s.length <= rs + 2) {
+
             s += '0';
+
           }
+
           return s;
+
       }else{
+
         return '';
+
       }
     }
   }
@@ -567,38 +626,96 @@ export default {
       <el-col :span="24" style="text-align: right;margin: 0 10px 0 0">
 
         <!-- <el-button-group style="margin-left: 10px"> -->
-        <el-button size="mini" type="primary" plain @click="handleOpenAddDrawer"
+        <el-button size="mini" type="primary" @click="handleOpenAddDrawer"
           v-hasPermi="['material:order:add']">新增</el-button>
         <!-- </el-button-group> -->
 
         <el-button-group style="margin-left: 10px">
-          <el-button size="mini" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
-          <el-button size="mini" @click="handleBatchSubmit">批量提交</el-button>
+          <el-button type="primary" size="mini" :disabled="checkedList.length != 1" @click="handleCopy">复制</el-button>
+          <el-button type="primary" size="mini" @click="handleBatchSubmit">批量提交</el-button>
         </el-button-group>
 
         <el-button-group style="margin-left: 10px" :key="checkedList.length + 1">
-          <el-button size="mini" @click="handleAllReturn" :disabled="judgeIsAllReturn()">整单退回</el-button>
-          <el-button size="mini" @click="handleAllClose" :disabled="judgeIsAllClose()">整单关闭</el-button>
+          <el-button type="primary" size="mini" @click="handleAllReturn" :disabled="judgeIsAllReturn()">整单退回</el-button>
+          <el-button type="primary" size="mini" @click="handleAllClose" :disabled="judgeIsAllClose()">整单关闭</el-button>
         </el-button-group>
 
-        <el-button-group style="margin-left: 10px">
+        <el-button-group style="margin:0 10px">
           <!-- <el-button size="mini" 
             :disabled="!(checkedList.length == 1 && checkedList[0].deliveryStatus == '0')"
             :key="checkedList.length"
             @click="handlePurchaseReturn"
           >采购退货</el-button> -->
-          <el-button size="mini" @click="handlePaymentRequest">付款申请</el-button>
+          <el-button type="primary" size="mini" @click="handlePaymentRequest">付款申请</el-button>
 
           <!-- <el-button size="mini">附件管理</el-button>
           <el-button size="mini">单据追溯</el-button> -->
         </el-button-group>
+
+        <el-hide-table-column-button
+          v-model="tableColumns"
+          size="mini"
+        ></el-hide-table-column-button>
+
       </el-col>
     </el-row>
 
-    <el-table 
+    <el-super-table
+      v-model="tableData"
+      size="mini"
+      :dict="dict"
+      :columns="tableColumns"
+      @row-dblclick="handleOpenSeeDrawer" 
+      @row-click="handleDetailsData" 
+      @select="handleSelect"
+    >
+
+      <el-table-column type="selection" width="45" ></el-table-column>
+      <el-table-column type="index" width="50" label="序号"></el-table-column>
+      <el-table-column fixed="right" label="操作" width="120">
+          <template slot-scope="scope">
+            <el-button 
+              v-if="scope.row.status == '2'"
+              type="text" 
+              size="small" 
+              @click.stop="handleOpenEditDrawer(scope.row)"
+              v-hasPermi="['material:order:edit']">
+            修订
+            </el-button>
+            <el-button 
+              v-if="scope.row.status == '0' || scope.row.status == '3'"
+              type="text" 
+              size="small" 
+              @click.stop="handleOpenEditDrawer(scope.row)"
+              v-hasPermi="['material:order:edit']">
+            编辑
+            </el-button>
+            <!-- 0=自由态,1=审批中,2=已审核,3=已驳回 4=提交中-->
+            <el-button 
+              v-if="(scope.row.status == '0' || scope.row.status == '3') && scope.row.source == '3'" 
+              type="text" 
+              size="small" 
+              @click.stop="handleDeleteList(scope.row)"
+              v-hasPermi="['material:order:remove']"
+            >删除</el-button>
+            <el-button 
+              v-if="scope.row.status == '0' || scope.row.status == '3'" 
+              type="text" 
+              size="mini"
+              v-hasPermi="['material:order:toOa']" 
+              @click.stop="handleSubmit(scope.row)"
+            >提交</el-button>
+          </template>
+      </el-table-column>
+    
+    </el-super-table>
+
+    <!-- <el-table 
       @row-dblclick="handleOpenSeeDrawer" 
       @row-click="handleDetailsData" 
       :data="tableData" 
+      border
+      stripe
       size="mini"
       highlight-current-row
       @select="handleSelect"
@@ -608,28 +725,28 @@ export default {
       <el-table-column type="selection" width="45" ></el-table-column>
       <el-table-column type="index" width="50" label="序号"></el-table-column>
       <el-table-column 
-        v-for="(column, index) in tableColumns" 
+        v-for="({item}, index) in tableShowColumns" 
         :key="index" 
-        :prop="column.key" 
-        :label="column.title"
-        :width="column.width || 180" 
-        :show-overflow-tooltip="column.showOverflowTooltip || true"
+        :prop="item.key" 
+        :label="item.title"
+        :width="item.width || 180" 
+        :show-overflow-tooltip="item.showOverflowTooltip || true"
       >
 
         <template slot-scope="scope">
-          <dict-tag v-if="column.inputType === 'Select'" 
+          <dict-tag v-if="item.inputType === 'Select'" 
             size="small" 
-            :value="scope.row[column.key]"
-            :options="dict.type[column.referName]"
+            :value="scope.row[item.key]"
+            :options="dict.type[item.referName]"
            />
 
-          <el-checkbox v-else-if="column.inputType === 'Checkbox'"
-            v-model="scope.row[column.key]" 
+          <el-checkbox v-else-if="item.inputType === 'Checkbox'"
+            v-model="scope.row[item.key]" 
             disabled 
             true-label="Y"
             false-label="N"
           > </el-checkbox>
-          <span v-else>{{column.precision ? keepTwoDecimalStr(scope.row[column.key]):scope.row[column.key] }}</span>
+          <span v-else>{{item.precision ? keepTwoDecimalStr(scope.row[item.key]):scope.row[item.key] }}</span>
         </template>
       </el-table-column>
       <el-table-column fixed="right" label="操作" width="120">
@@ -650,7 +767,6 @@ export default {
             v-hasPermi="['material:order:edit']">
            编辑
           </el-button>
-          <!-- 0=自由态,1=审批中,2=已审核,3=已驳回 4=提交中-->
           <el-button 
             v-if="(scope.row.status == '0' || scope.row.status == '3') && scope.row.source == '3'" 
             type="text" 
@@ -668,7 +784,7 @@ export default {
         </template>
       </el-table-column>
 
-    </el-table>
+    </el-table> -->
 
     <pagination
       v-show="page.total>0"
@@ -694,7 +810,21 @@ export default {
           :label="column.title" 
           :name="column.key"
         >
-          <el-table 
+          <el-super-table
+            v-model="tabTableDatas[column.key]"
+            size="mini"
+            :dict="dict"
+            :columns="column.tableColumns"
+            @select="handleTabSelect"
+          >
+            <el-table-column
+              v-if=" tabName === 'puOrderItemList'" 
+              type="selection" 
+              width="45"
+            ></el-table-column>
+            <el-table-column type="index" width="50" label="序号"></el-table-column>
+          </el-super-table>
+          <!-- <el-table 
             :data="tabTableDatas[column.key]" 
             style="width: 100%" 
             highlight-current-row
@@ -730,7 +860,7 @@ export default {
                 <span v-else>{{cColumn.precision ? keepTwoDecimalStr(scope.row[cColumn.key]): scope.row[cColumn.key] }}</span>
               </template>
             </el-table-column>
-          </el-table>
+          </el-table> -->
         </el-tab-pane>
         
       </el-tabs>

+ 15 - 2
src/views/purchase/transferOrder/index.vue

@@ -139,11 +139,12 @@
           fixed="right"
           label="操作"
           align="center"
-          width="150"
+          width="180"
           >
           <template slot-scope="scope">
             <el-button type="text" size="mini" @click="check(scope.row)">查看</el-button>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="edit(scope.row)">编辑</el-button>
+            <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="commit(scope.row)">提交</el-button>
             <el-button type="text" size="mini" v-if="scope.row.status == '0' || scope.row.status == '3'" @click="deleteids(scope.row)">删除</el-button>
           </template>
         </el-table-column>
@@ -325,7 +326,7 @@
 import Add from './add.vue'
 import CollapseTransition from '@/components/MyCollapse/collapse.vue'
 import Refers from '@/components/Refers/refers.vue'
-import {getOrderList, delOrder} from '@/api/purchase/transferOrder.js'
+import {getOrderList, delOrder, submitOrder } from '@/api/purchase/transferOrder.js'
 export default {
   name: 'transferOrder',
   dicts: ['sys_allot_billtype'],
@@ -418,6 +419,18 @@ export default {
       this.rowDetail = row
       this.disable = false
     },
+    commit(row) {
+      this.$modal.loading("提交中...");
+      submitOrder(row).then(res => {
+        if (res.code === 200) {
+          this.$modal.closeLoading();
+          this.$modal.msgSuccess("提交成功");
+          this.getList(this.queryParams)
+        }
+      }).catch(err => {
+        this.$modal.closeLoading();
+      })
+    },
     // 选中某行
     select(row) {
       console.log('选中', row)

Some files were not shown because too many files changed in this diff