|
@@ -0,0 +1,525 @@
|
|
|
|
+<template>
|
|
|
|
+ <j-modal
|
|
|
|
+ :title="title"
|
|
|
|
+ width="100%"
|
|
|
|
+ :visible="visible"
|
|
|
|
+ :confirmLoading="confirmLoading"
|
|
|
|
+ :keyboard="false"
|
|
|
|
+ :forceRender="true"
|
|
|
|
+ v-bind:prefixNo="prefixNo"
|
|
|
|
+ fullscreen
|
|
|
|
+ switchFullscreen
|
|
|
|
+ @cancel="handleCancel"
|
|
|
|
+ :id="prefixNo"
|
|
|
|
+ style="top: 20px; height: 95%"
|
|
|
|
+ >
|
|
|
|
+ <template slot="footer" v-if="!approvalId">
|
|
|
|
+ <a-button @click="handleCancel">取消</a-button>
|
|
|
|
+ <a-button v-if="isShowBtn" @click="submit(9)" :loading="confirmLoading">保存并申请审核</a-button>
|
|
|
|
+ <a-button v-if="isShowBtn" @click="submit(0)" :loading="confirmLoading" type="primary">保存</a-button>
|
|
|
|
+ </template>
|
|
|
|
+ <template slot="footer" v-else>
|
|
|
|
+ <a-button v-if="!approvalIsReadonly" :loading="confirmLoading" @click="submitApproval(2)">审核不通过</a-button>
|
|
|
|
+ <a-button type="primary" v-if="!approvalIsReadonly" :loading="confirmLoading" @click="submitApproval(1)">审核通过</a-button>
|
|
|
|
+ <a-button key="back" v-if="approvalIsReadonly" @click="handleCancel">取消</a-button>
|
|
|
|
+ </template>
|
|
|
|
+ <a-spin :spinning="confirmLoading">
|
|
|
|
+ <a-form-model :model="model" ref="form" :rules="rules" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
|
+ <a-row class="form-row" :gutter="24" type="flex">
|
|
|
|
+ <a-col :xl="6" :lg="8" :md="12" :sm="24" >
|
|
|
|
+ <a-form-model-item label="盘点单号" prop="number">
|
|
|
|
+ <a-input disabled placeholder="自动生成" v-model="model.number" />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xl="6" :lg="8" :md="12" :sm="24" >
|
|
|
|
+ <a-form-model-item label="盘点类型" prop="taskType">
|
|
|
|
+ <a-select
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ @change="handleChangeForm"
|
|
|
|
+ v-model="model.taskType"
|
|
|
|
+ :options="taskTypeList"
|
|
|
|
+ :disabled="isDisabled"
|
|
|
|
+ >
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xl="6" :lg="8" :md="12" :sm="24" >
|
|
|
|
+ <a-form-model-item prop="taskName" label="盘点任务名称">
|
|
|
|
+ <a-input placeholder="请输入" :disabled="isDisabled" v-model="model.taskName" />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xl="6" :lg="8" :md="12" :sm="24" >
|
|
|
|
+ <a-form-model-item prop="depotId" label="盘点仓库">
|
|
|
|
+ <a-select
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ :options="deoptData"
|
|
|
|
+ v-model="model.depotId"
|
|
|
|
+ :disabled="isDisabled"
|
|
|
|
+ @change="handleChangeForm"
|
|
|
|
+ >
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xl="6" :lg="8" :md="12" :sm="24" >
|
|
|
|
+ <a-form-model-item label="盘点负责人" prop="creator">
|
|
|
|
+ <a-select placeholder="请选择" v-model="model.creator" :options="spinnerList" :disabled="isDisabled">
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xl="6" :lg="8" :md="12" :sm="24" >
|
|
|
|
+ <a-form-model-item label="创建人" prop="createByName">
|
|
|
|
+ <a-input placeholder="自动生成" v-model="model.createByName" disabled />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xl="6" :lg="8" :md="12" :sm="24" >
|
|
|
|
+ <a-form-model-item label="创建时间" prop="createTime">
|
|
|
|
+ <a-input placeholder="自动生成" v-model="model.createTime" disabled />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xl="6" :lg="8" :md="12" :sm="24" >
|
|
|
|
+ <a-form-model-item label="盘点库位范围" prop="positionRange">
|
|
|
|
+ <a-input placeholder="自动生成" v-model="model.positionRange" disabled />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xl="6" :lg="8" :md="12" :sm="24" >
|
|
|
|
+ <a-form-model-item label="商品数量" prop="materialCount">
|
|
|
|
+ <a-input disabled placeholder="自动生成" v-model="model.materialCount" />
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :xl="6" :lg="8" :md="12" :sm="24" >
|
|
|
|
+ <a-form-model-item label="盘点状态" prop="taskStatus">
|
|
|
|
+ <a-select placeholder="自动生成" v-model="model.taskStatus" :options="taskStatusList" disabled>
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ </a-form-model>
|
|
|
|
+ <div>
|
|
|
|
+ <a-button v-if="model.taskType === 2&&action!='detail'" style="margin-bottom: 6px" type="primary" @click="onChangeGoods"
|
|
|
|
+ >选择商品</a-button
|
|
|
|
+ >
|
|
|
|
+ <a-table
|
|
|
|
+ v-if="dataSource.length"
|
|
|
|
+ ref="table"
|
|
|
|
+ size="middle"
|
|
|
|
+ bordered
|
|
|
|
+ rowKey="id"
|
|
|
|
+ :scroll="{ x: 'max-content'}"
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :dataSource="dataSource"
|
|
|
|
+ :loading="loading"
|
|
|
|
+ :pagination="ipagination"
|
|
|
|
+ @change="handleTableChange"
|
|
|
|
+ >
|
|
|
|
+ <span v-if="isShowBtn" slot="action" slot-scope="text, record">
|
|
|
|
+ <a-popconfirm @confirm="handleDelete(record)" title="确定删除吗?">
|
|
|
|
+ <a v-if="model.taskType!=1">删除</a>
|
|
|
|
+ </a-popconfirm>
|
|
|
|
+ </span>
|
|
|
|
+ </a-table>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 审批历史 -->
|
|
|
|
+ <section v-if="approvalId">
|
|
|
|
+ <h4 class="block-title">审批历史</h4>
|
|
|
|
+ <a-table
|
|
|
|
+ size="middle"
|
|
|
|
+ bordered
|
|
|
|
+ rowKey="id"
|
|
|
|
+ :pagination="false"
|
|
|
|
+ :loading="approval.loading"
|
|
|
|
+ :columns="approval.columns"
|
|
|
|
+ :rowClassName="rowClassName"
|
|
|
|
+ :dataSource="approval.dataSource"
|
|
|
|
+ :scroll="{ x: '100%' }"
|
|
|
|
+ ></a-table>
|
|
|
|
+ <a-textarea :rows="1" placeholder="审核备注" v-model="auditComment" v-if="!approvalIsReadonly" style="margin-top: 8px" />
|
|
|
|
+ </section>
|
|
|
|
+ </a-spin>
|
|
|
|
+ <j-select-material-modal
|
|
|
|
+ @ok="getGoods"
|
|
|
|
+ @all="findAllSelect"
|
|
|
|
+ ref="selectModal"
|
|
|
|
+ :multi="true"
|
|
|
|
+ :isStock="true"
|
|
|
|
+ ></j-select-material-modal>
|
|
|
|
+ </j-modal>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import JSelectMaterialModal from '@/components/jeecgbiz/modal/JSelectMaterialModal.vue'
|
|
|
|
+import { getAction, postAction } from '@/api/manage'
|
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ name: 'InventoryCheckModal',
|
|
|
|
+ components: { JSelectMaterialModal },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ labelCol: {
|
|
|
|
+ xs: { span: 24 },
|
|
|
|
+ sm: { span: 9 },
|
|
|
|
+ },
|
|
|
|
+ wrapperCol: {
|
|
|
|
+ xs: { span: 24 },
|
|
|
|
+ sm: { span: 15 },
|
|
|
|
+ },
|
|
|
|
+ visible: false,
|
|
|
|
+ spinnerList: [],
|
|
|
|
+ deoptData: [],
|
|
|
|
+ taskTypeList: [
|
|
|
|
+ { value: 1, label: '全盘' },
|
|
|
|
+ { value: 2, label: '抽盘' },
|
|
|
|
+ ],
|
|
|
|
+ taskStatusList: [
|
|
|
|
+ { value: 0, label: '未审核' },
|
|
|
|
+ { value: 1, label: '已审核' },
|
|
|
|
+ { value: 2, label: '进行中' },
|
|
|
|
+ { value: 3, label: '已完成' },
|
|
|
|
+ { value: 4, label: '已取消' },
|
|
|
|
+ { value: 5, label: '已更新' },
|
|
|
|
+ { value: 8, label: '审核未通过' },
|
|
|
|
+ { value: 9, label: '审核中' },
|
|
|
|
+ ],
|
|
|
|
+ confirmLoading: false,
|
|
|
|
+ prefixNo: 'PDRW',
|
|
|
|
+ loading: false,
|
|
|
|
+ dataSource: [],
|
|
|
|
+ columns: [
|
|
|
|
+ {
|
|
|
|
+ title: '操作',
|
|
|
|
+ dataIndex: 'action',
|
|
|
|
+ align: 'center',
|
|
|
|
+ width: 90,
|
|
|
|
+ scopedSlots: { customRender: 'action' },
|
|
|
|
+ },
|
|
|
|
+ { dataIndex: 'batchNumber', title: '批次号' },
|
|
|
|
+ { dataIndex: 'materialName', title: '商品名称', scopedSlots: { customRender: 'customName' } },
|
|
|
|
+ { dataIndex: 'categoryName', title: '类别' },
|
|
|
|
+ { dataIndex: 'standard', title: '规格' },
|
|
|
|
+ { dataIndex: 'model', title: '型号' },
|
|
|
|
+ { dataIndex: 'color', title: '颜色' },
|
|
|
|
+ { dataIndex: 'brand', title: '品牌' },
|
|
|
|
+ { dataIndex: 'supplierName', title: '供应商' },
|
|
|
|
+ { dataIndex: 'commodityUnit', title: '单位' },
|
|
|
|
+ { dataIndex: 'inventory', title: '库存' },
|
|
|
|
+ { dataIndex: 'productionDate', title: '生产日期' },
|
|
|
|
+ { dataIndex: 'expiryNum', title: '保质期' },
|
|
|
|
+ { dataIndex: 'sku', title: 'SKU' },
|
|
|
|
+ { dataIndex: 'depotName', title: '仓库名称' },
|
|
|
|
+ { dataIndex: 'position', title: '仓库货架' },
|
|
|
|
+ ],
|
|
|
|
+ ipagination: {
|
|
|
|
+ current: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ pageSizeOptions: ['10', '20', '30', '50', '100'],
|
|
|
|
+ showTotal: (total, range) => {
|
|
|
|
+ return range[0] + '-' + range[1] + ' 共' + total + '条'
|
|
|
|
+ },
|
|
|
|
+ showQuickJumper: true,
|
|
|
|
+ showSizeChanger: true,
|
|
|
|
+ total: 0,
|
|
|
|
+ },
|
|
|
|
+ url: {
|
|
|
|
+ add: '/stocktaking/add',
|
|
|
|
+ update: '/stocktaking/detailUpdate',
|
|
|
|
+ spinnerList: '/stocktaking/creatorSpinnerList',
|
|
|
|
+ depotList: '/depot/findDepotByCurrentUser',
|
|
|
|
+ },
|
|
|
|
+ batchNumberStr: '',
|
|
|
|
+ action: '',
|
|
|
|
+ title: '',
|
|
|
|
+ rules: {
|
|
|
|
+ taskType: [{ required: true, message: '请选择盘点类型', trigger: 'change' }],
|
|
|
|
+ depotId: [{ required: true, message: '请选择盘点仓库',trigger: 'change' }],
|
|
|
|
+ taskName: [{ required: true, message: '请输入盘点任务名称', trigger: 'change' }],
|
|
|
|
+ },
|
|
|
|
+ model: {},
|
|
|
|
+
|
|
|
|
+ // 审批历史
|
|
|
|
+ approvalId: null, //审批id
|
|
|
|
+ approvalIsReadonly: false,
|
|
|
|
+ approval:{
|
|
|
|
+ loading:false,
|
|
|
|
+ columns:[
|
|
|
|
+ { title: '审核时间', dataIndex: 'auditTime' },
|
|
|
|
+ { title: '审核环节', dataIndex: 'nodeOrder',customRender(text,record,index){
|
|
|
|
+ if(index===0){
|
|
|
|
+ return text
|
|
|
|
+ }
|
|
|
|
+ return `审批节点${text}`
|
|
|
|
+ } },
|
|
|
|
+ { title: '审批人', dataIndex: 'auditorName' },
|
|
|
|
+ { title: '审核动作', dataIndex: 'auditResult',customRender(text,record,index){
|
|
|
|
+ if(index===0){
|
|
|
|
+ return text
|
|
|
|
+ }
|
|
|
|
+ if(text==1){
|
|
|
|
+ return '审批通过'
|
|
|
|
+ }else if(text==2){
|
|
|
|
+ return '审批不通过'
|
|
|
|
+ }
|
|
|
|
+ return ''
|
|
|
|
+ } },
|
|
|
|
+ { title: '备注', dataIndex: 'auditComment' },
|
|
|
|
+ ],
|
|
|
|
+ dataSource:[]
|
|
|
|
+ },
|
|
|
|
+ auditComment: ''
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ isDisabled() {
|
|
|
|
+ switch (this.action) {
|
|
|
|
+ case 'detail':
|
|
|
|
+ return true
|
|
|
|
+ case 'add':
|
|
|
|
+ return false
|
|
|
|
+ case 'edit':
|
|
|
|
+ return this.model.taskStatus != 0&&this.model.taskStatus != 8
|
|
|
|
+ default:
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ isShowBtn() {
|
|
|
|
+ switch (this.action) {
|
|
|
|
+ case 'detail':
|
|
|
|
+ return false
|
|
|
|
+ case 'add':
|
|
|
|
+ return true
|
|
|
|
+ case 'edit':
|
|
|
|
+ return this.model.taskStatus == 0 || this.model.taskStatus == 8
|
|
|
|
+ default:
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ ...mapGetters(['username'])
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ getSpinnerList() {
|
|
|
|
+ getAction(this.url.spinnerList).then((res) => {
|
|
|
|
+ this.spinnerList = res.data || []
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ getDepotList() {
|
|
|
|
+ getAction(this.url.depotList).then((res) => {
|
|
|
|
+ this.deoptData = res.data.map((item) => {
|
|
|
|
+ return {
|
|
|
|
+ label: item.depotName,
|
|
|
|
+ value: item.id,
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ handleOpen(number){
|
|
|
|
+ this.visible = true
|
|
|
|
+ if(number){
|
|
|
|
+ this.getDetail(number)
|
|
|
|
+ }
|
|
|
|
+ this.getSpinnerList()
|
|
|
|
+ this.getDepotList()
|
|
|
|
+ },
|
|
|
|
+ edit(number) {
|
|
|
|
+ this.action = 'edit'
|
|
|
|
+ this.handleOpen(number)
|
|
|
|
+ },
|
|
|
|
+ add(){
|
|
|
|
+ this.action = 'add'
|
|
|
|
+ this.$set(this.model,'taskStatus',0)
|
|
|
|
+ this.handleOpen()
|
|
|
|
+ },
|
|
|
|
+ lookDetail(number,approvalRow=null){
|
|
|
|
+ this.action = 'detail'
|
|
|
|
+ this.handleOpen(number)
|
|
|
|
+ //审批历史
|
|
|
|
+ if(approvalRow&&approvalRow.id){
|
|
|
|
+ this.approvalId = approvalRow.id
|
|
|
|
+ getAction('/audit/auditHistory',{id:approvalRow.id}).then(res => {
|
|
|
|
+ const list = res.data
|
|
|
|
+ list.unshift({
|
|
|
|
+ auditTime: approvalRow.submitTime,
|
|
|
|
+ nodeOrder: '开始',
|
|
|
|
+ auditorName: approvalRow.initiatorName,
|
|
|
|
+ auditResult: '提交审批',
|
|
|
|
+ auditComment: '',
|
|
|
|
+ })
|
|
|
|
+ this.approval.dataSource = list
|
|
|
|
+ console.log('approvalRow=====',approvalRow)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ getDetail(number){
|
|
|
|
+ const url = '/stocktaking/detail/number/' + number
|
|
|
|
+ getAction(url).then((res) => {
|
|
|
|
+ this.model = res.data
|
|
|
|
+ this.getTableData(res.data.id)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ getTableData(id){
|
|
|
|
+ const url2 = `/stocktaking/detailByItemList?currentPage=${this.ipagination.current}&pageSize=${this.ipagination.pageSize}`
|
|
|
|
+ postAction(url2, { taskStocktakingId: id }).then((res) => {
|
|
|
|
+ this.dataSource = res.data
|
|
|
|
+ this.ipagination.total = this.dataSource.length
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ close(){
|
|
|
|
+ this.visible = false
|
|
|
|
+ this.$refs.form.resetFields()
|
|
|
|
+ this.dataSource = []
|
|
|
|
+ this.action = ''
|
|
|
|
+ this.model = {}
|
|
|
|
+ this.ipagination.current = 1
|
|
|
|
+ this.$emit('close')
|
|
|
|
+ // 审批
|
|
|
|
+ this.approvalId = null
|
|
|
|
+ this.auditComment = ''
|
|
|
|
+ this.approval.dataSource = []
|
|
|
|
+ this.approvalIsReadonly = false
|
|
|
|
+ },
|
|
|
|
+ handleCancel() {
|
|
|
|
+ this.close()
|
|
|
|
+ },
|
|
|
|
+ // 提交盘点任务
|
|
|
|
+ submit(taskStatus) {
|
|
|
|
+ this.$refs.form.validate((flag, values) => {
|
|
|
|
+ console.log('flag===',flag)
|
|
|
|
+ if (flag) {
|
|
|
|
+ this.confirmLoading = true
|
|
|
|
+ const params = { ...this.model }
|
|
|
|
+ if (params.taskType === 2) {
|
|
|
|
+ params.materialExtendIdList = this.dataSource.map((item) => item.batchNumber)
|
|
|
|
+ }
|
|
|
|
+ params.taskStatus = taskStatus
|
|
|
|
+ const url = params.id ? this.url.update : this.url.add
|
|
|
|
+ postAction(url, params).then((res) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$message.success('操作成功')
|
|
|
|
+ this.handleCancel()
|
|
|
|
+ this.$emit('ok')
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(res.msg)
|
|
|
|
+ }
|
|
|
|
+ }).finally(() => {
|
|
|
|
+ this.confirmLoading = false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ onChangeGoods() {
|
|
|
|
+ if(!this.model.depotId){
|
|
|
|
+ this.$message.warning('请选择仓库!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.$refs.selectModal.showModal()
|
|
|
|
+ },
|
|
|
|
+ getGoods(rows, ids) {
|
|
|
|
+ const str = ids
|
|
|
|
+ .split(',')
|
|
|
|
+ .filter((item) => item)
|
|
|
|
+ .join(',')
|
|
|
|
+ if(!this.model.depotId){
|
|
|
|
+ this.$message.warning('请选择仓库!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ getAction('/materialBatch/findBatchNumbersByBarCode',{
|
|
|
|
+ barCodes: str,
|
|
|
|
+ depotId:this.model.depotId
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ const batchStr = res.data.split(',')
|
|
|
|
+ .filter((item) => item)
|
|
|
|
+ .join(',')
|
|
|
|
+ this.batchNumberStr = batchStr
|
|
|
|
+ this.getBatchData()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ findAllSelect() {
|
|
|
|
+ if(!this.model.depotId){
|
|
|
|
+ this.$message.warning('请选择仓库!')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ getAction('/materialBatch/findBatchNumbersByBarCode',{
|
|
|
|
+ depotId:this.model.depotId
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ this.$refs.selectModal.close()
|
|
|
|
+ const batchStr = res.data.split(',')
|
|
|
|
+ .filter((item) => item)
|
|
|
|
+ .join(',')
|
|
|
|
+ this.batchNumberStr = batchStr
|
|
|
|
+ this.getBatchData()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ getBatchData() {
|
|
|
|
+ const params = {
|
|
|
|
+ batchNumber: this.batchNumberStr,
|
|
|
|
+ }
|
|
|
|
+ getAction(`/material/getMaterialByBatchNumber?currentPage=${this.ipagination.current}&pageSize=${this.ipagination.pageSize}`, params).then((res) => {
|
|
|
|
+ this.dataSource = res.data.rows
|
|
|
|
+ if(this.dataSource.length===0){
|
|
|
|
+ this.$message.warning('暂无数据!')
|
|
|
|
+ }
|
|
|
|
+ this.ipagination.total = Number(res.data.total)
|
|
|
|
+ this.$set(this.model,'materialCount',Number(res.data.total))
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //删除
|
|
|
|
+ handleDelete(record) {
|
|
|
|
+ this.dataSource = this.dataSource.filter((item) => item.batchNumber !== record.batchNumber)
|
|
|
|
+ this.ipagination.total -=1
|
|
|
|
+ this.$set(this.model,'materialCount',this.ipagination.total)
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ handleChangeForm(val) {
|
|
|
|
+ this.dataSource = []
|
|
|
|
+ this.ipagination.current = 1
|
|
|
|
+ this.ipagination.total = 0
|
|
|
|
+ this.$set(this.model,'materialCount',0)
|
|
|
|
+ console.log('this.model=====',this.model)
|
|
|
|
+ if (this.model.taskType === 1) {
|
|
|
|
+ this.findAllSelect()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleTableChange(pagination) {
|
|
|
|
+ if (pagination && pagination.current) {
|
|
|
|
+ this.ipagination = pagination
|
|
|
|
+ }
|
|
|
|
+ if(this.action=='add'){
|
|
|
|
+ this.getBatchData()
|
|
|
|
+ }else{
|
|
|
|
+ this.getTableData(this.model.id)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ rowClassName(record,index){
|
|
|
|
+ if(this.username===record.auditorName){
|
|
|
|
+ return 'red-row'
|
|
|
|
+ }
|
|
|
|
+ return ''
|
|
|
|
+ },
|
|
|
|
+ // 提交审核
|
|
|
|
+ submitApproval(status){
|
|
|
|
+ const params = {
|
|
|
|
+ id: this.approvalId,
|
|
|
|
+ status,
|
|
|
|
+ auditComment: this.auditComment
|
|
|
|
+ }
|
|
|
|
+ this.confirmLoading = true
|
|
|
|
+ postAction('/audit/setStatus',params).then(res => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ if(res.code===200){
|
|
|
|
+ this.$message.success(res.msg)
|
|
|
|
+ this.handleCancel()
|
|
|
|
+ this.$emit('ok')
|
|
|
|
+ }else{
|
|
|
|
+ this.$message.error(res.data.message)
|
|
|
|
+ }
|
|
|
|
+ }).finally(() => {
|
|
|
|
+ this.confirmLoading = false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style scoped>
|
|
|
|
+::v-deep .red-row{
|
|
|
|
+ color: #f5222d;
|
|
|
|
+}
|
|
|
|
+</style>
|