|  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <TableLayout :permissions="['ext:workplans:query']"> | 
|---|
|  |  |  | <!-- 搜索表单 --> | 
|---|
|  |  |  | <el-form ref="searchForm" slot="search-form" label-suffix=":" :model="searchForm" label-width="90px" inline> | 
|---|
|  |  |  | <el-form ref="searchForm" slot="search-form" label-suffix=":" :model="searchForm" label-width="110px" inline> | 
|---|
|  |  |  | <el-form-item label="物料名称" prop="materialName"> | 
|---|
|  |  |  | <el-input v-model="searchForm.materialName" placeholder="请输入" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | 
|---|
|  |  |  | <el-form-item label="批次号" prop="batch"> | 
|---|
|  |  |  | <el-input v-model="searchForm.batch" placeholder="请输入" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="计划日期" prop="planDate"> | 
|---|
|  |  |  | <el-date-picker style="width: 300px;" @change="changeDate" v-model="searchForm.planDate" type="datetimerange" | 
|---|
|  |  |  | <el-form-item label="销售单号" prop="salesorder"> | 
|---|
|  |  |  | <el-input v-model="searchForm.salesorder" placeholder="请输入" @keypress.enter.native="search"></el-input> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="计划开始日期" prop="startDate"> | 
|---|
|  |  |  | <el-date-picker style="width: 300px;" @change="changeStartDate" v-model="startDate" type="daterange" | 
|---|
|  |  |  | value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"> | 
|---|
|  |  |  | </el-date-picker> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="计划完成日期" prop="planDate"> | 
|---|
|  |  |  | <el-date-picker style="width: 300px;" @change="changeDate" v-model="planDate" type="daterange" | 
|---|
|  |  |  | value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"> | 
|---|
|  |  |  | </el-date-picker> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | 
|---|
|  |  |  | <ImportButton | 
|---|
|  |  |  | text="导入" | 
|---|
|  |  |  | template-name="workplans_import_template.xlsx" | 
|---|
|  |  |  | template-path="template/workplans_import_template.xlsx" | 
|---|
|  |  |  | template-path="/template/workplans_import_template.xlsx" | 
|---|
|  |  |  | action="/business/workPlans/importBatch" | 
|---|
|  |  |  | @success="search" | 
|---|
|  |  |  | /> | 
|---|
|  |  |  | 
|---|
|  |  |  | <!-- deleteByIdInBatch --> | 
|---|
|  |  |  | <li><el-button type="danger" @click="deleteByIds" icon="el-icon-delete" v-permissions="['ext:workplans:delete']">批量删除</el-button></li> | 
|---|
|  |  |  | </ul> | 
|---|
|  |  |  | <el-table v-loading="isWorking.search" :data="tableData.list" stripe @selection-change="handleSelectionChange"> | 
|---|
|  |  |  | <el-table v-loading="isWorking.search" :data="tableData.list" border stripe @selection-change="handleSelectionChange"> | 
|---|
|  |  |  | <el-table-column type="selection" width="55"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="planCode" label="成品计划编码" min-width="150px"> | 
|---|
|  |  |  | <el-table-column prop="planCode" label="成品计划编码" min-width="190px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <el-button type="text" @click="$refs.plannedProgress.open('计划执行进度', row)"> | 
|---|
|  |  |  | <span class="long-title-style">{{ row.planCode }}</span> | 
|---|
|  |  |  | </el-button> | 
|---|
|  |  |  | <el-tag type="danger" size="mini" v-if="row.hasExpire">延期</el-tag> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="materialName" label="物料名称" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="materialCode" label="物料编码" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="planDate" label="计划日期" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="startDate" label="计划开始日期" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="planDate" label="计划完成日期" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="factoryName" label="工厂" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="batch" label="生产批次号" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="num" label="计划数量" min-width="100px"></el-table-column> | 
|---|
|  |  |  | 
|---|
|  |  |  | <span v-else-if="row.status == 8">已关闭</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="暂停" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <span v-if="row.paused == 1">是</span> | 
|---|
|  |  |  | <span v-else>否</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="完工数" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <span v-if="row.finishNum">{{ row.finishNum }}</span> | 
|---|
|  |  |  | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="完工合格数" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <span v-if="row.finishQualifiedNum">{{ row.finishQualifiedNum }}</span> | 
|---|
|  |  |  | <span class="valid-style" v-if="row.finishQualifiedNum">{{ row.finishQualifiedNum }}</span> | 
|---|
|  |  |  | <span v-else>-</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="完工不良数" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <span v-if="row.finishUnQualifiedNum">{{ row.finishUnQualifiedNum }}</span> | 
|---|
|  |  |  | <span class="unvalid-style" v-if="row.finishUnQualifiedNum">{{ row.finishUnQualifiedNum }}</span> | 
|---|
|  |  |  | <span v-else>-</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="发布时间" min-width="100px"> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <el-table-column label="销售订单" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <span v-if="row.salesorder">{{ row.salesorder }}</span> | 
|---|
|  |  |  | <span v-else>-</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column prop="urgent" label="优先级" min-width="80px"> | 
|---|
|  |  |  | <!-- <template slot-scope="{row}"> | 
|---|
|  |  |  | <span v-if="row.urgent">{{ row.urgent }}</span> | 
|---|
|  |  |  | <span v-else>-</span> | 
|---|
|  |  |  | </template> --> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | <el-table-column label="暂停" min-width="80px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | {{ row.paused==0?'否':'是' }} | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <el-table-column label="发布日期" min-width="100px"> | 
|---|
|  |  |  | <template slot-scope="{row}"> | 
|---|
|  |  |  | <span v-if="row.publishDate">{{ row.publishDate }}</span> | 
|---|
|  |  |  | <span v-else>-</span> | 
|---|
|  |  |  | 
|---|
|  |  |  | materialCode: '', | 
|---|
|  |  |  | planDateStart: '', | 
|---|
|  |  |  | planDateEnd: '', | 
|---|
|  |  |  | startDateEnd: '', | 
|---|
|  |  |  | startDateStart: '', | 
|---|
|  |  |  | factoryId: '', | 
|---|
|  |  |  | materialId: '', | 
|---|
|  |  |  | batch: '', | 
|---|
|  |  |  | salesorder: '', | 
|---|
|  |  |  | planStatus: '', | 
|---|
|  |  |  | planCode: '' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | ids: [], | 
|---|
|  |  |  | planDate: [], | 
|---|
|  |  |  | startDate: [], | 
|---|
|  |  |  | statusList: [ | 
|---|
|  |  |  | { label: '已生成', value: 0 }, | 
|---|
|  |  |  | { label: '执行中', value: 1 }, | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeStartDate(e) { | 
|---|
|  |  |  | if (e) { | 
|---|
|  |  |  | this.searchForm.startDateStart = e[0] | 
|---|
|  |  |  | this.searchForm.startDateEnd = e[1] | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.searchForm.startDateStart = '' | 
|---|
|  |  |  | this.searchForm.startDateEnd = '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | resets() { | 
|---|
|  |  |  | this.searchForm.planDateStart = '' | 
|---|
|  |  |  | this.searchForm.planDateEnd = '' | 
|---|
|  |  |  | this.searchForm.startDateStart = '' | 
|---|
|  |  |  | this.searchForm.startDateEnd = '' | 
|---|
|  |  |  | this.planDate = [] | 
|---|
|  |  |  | this.startDate = [] | 
|---|
|  |  |  | this.reset() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|