This commit is contained in:
liushuai
2020-03-11 18:09:35 +08:00
parent b6c062607f
commit c099ccf0be
14 changed files with 312 additions and 140 deletions

View File

@@ -70,7 +70,7 @@
:value="item.value"/>
</el-select>
<el-button type="primary" size="small" plain icon="el-icon-search" style="margin-left: 10px" @click="searchTable()">查询</el-button>
<el-button type="distribution" size="small" plain icon="el-icon-circle-plus-outline" style="margin-left: 10px" @click="addPurchaseOrder">采购计划单</el-button>
<el-button type="distribution" size="small" plain icon="el-icon-circle-plus-outline" style="margin-left: 10px" @click="addPurchaseOrder">计划单</el-button>
<!--<el-tooltip :open-delay="1200" effect="dark" content="保存选中的采购计划单" placement="top">-->
<!--<el-button type="baocun" size="small" icon="el-icon-download" style="margin-left: 10px" @click="saveMateriel">保存采购计划单</el-button>-->
<!--</el-tooltip>-->
@@ -187,26 +187,26 @@
</div>
</div>
<div>
<el-card style="width: 1100px;margin: 10px auto">
<div id="WGBLD" style="width: 1000px;margin: 0 auto">
<el-card style="width: 1137px">
<div id="WGBLD" style="width: 1037px;margin: 0 auto">
<table cellspacing="0px" align="center" border="1 solid black" width="100%">
<tr style="height: 60px">
<th colspan="14"><h3>江苏高精机电装备有限公司</h3></th>
<th colspan="12"><h3>江苏高精机电装备有限公司</h3></th>
</tr>
<tr style="height: 40px">
<th colspan="14"><h4>{{ 采购单名称 }}</h4></th>
<th colspan="12"><h4>{{ 采购单名称 }}</h4></th>
</tr>
<tr style="height: 40px">
<td colspan="2" style="text-align: center;width: 15%">下单单位</td>
<td colspan="5" style="text-align: center;width: 35%">{{ 下单单位 }}</td>
<td colspan="4" style="text-align: center;width: 35%">{{ 下单单位 }}</td>
<td colspan="2" style="text-align: center;width: 15%">单号</td>
<td colspan="5" style="text-align: center;width: 35%">{{ 单号 }}</td>
<td colspan="4" style="text-align: center;width: 35%">{{ 单号 }}</td>
</tr>
<tr style="height: 40px">
<td colspan="2" style="text-align: center;width: 15%">下单日期</td>
<td colspan="5" style="text-align: center;width: 35%">{{ 下单日期 }}</td>
<td colspan="4" style="text-align: center;width: 35%">{{ 下单日期 }}</td>
<td colspan="2" style="text-align: center;width: 15%">计划完成日期</td>
<td colspan="5" style="text-align: center;width: 35%">{{ 计划完成日期 }}</td>
<td colspan="4" style="text-align: center;width: 35%">{{ 计划完成日期 }}</td>
</tr>
</table>
<table cellspacing="0px" align="center" border="1 solid black" width="100%" style="margin-top: 0px">
@@ -215,17 +215,15 @@
<td colspan="2" style="text-align: center;width: 20%">物料编码</td>
<td colspan="2" style="text-align: center;width: 10%">名称</td>
<td colspan="2" style="text-align: center;width: 10%">材料</td>
<td colspan="2" style="text-align: center;width: 8%">单位</td>
<td colspan="2" style="text-align: center;width: 8%">数量</td>
<td colspan="2" style="text-align: center;width: 20%">成品尺寸</td>
<td style="text-align: center;width: 17%">备注</td>
</tr>
<tr v-for="(list, index) in tableData4" :key="index" style="height: 35px">
<tr v-for="(list, index) in tableData3" :key="index" style="height: 35px">
<td style="text-align: center;width: 7%">{{ index + 1 }}</td>
<td colspan="2" style="text-align: center;width: 20%">{{ list.物料零件编码 }}</td>
<td colspan="2" style="text-align: center;width: 10%">{{ list.零件名称 }}</td>
<td colspan="2" style="text-align: center;width: 10%">{{ list.材料 }}</td>
<td colspan="2" style="text-align: center;width: 8%">{{ list.单位 }}</td>
<td colspan="2" style="text-align: center;width: 8%">{{ list.数量 }}</td>
<td colspan="2" style="text-align: center;width: 20%">{{ list.成品尺寸 }}</td>
<td style="text-align: center;width: 17%">{{ list.备注 }}</td>
@@ -234,6 +232,36 @@
<div style="margin-top: 20px">联系人:___________ 联系电话:___________ </div>
</div>
</el-card>
<el-dialog v-el-drag-dialog :title="title2" :visible.sync="dialogVisible2" center style="min-height: 300px" width="350px">
<el-form ref="form2" :model="form2" :rules="rules2" label-position="right" label-width="80px">
<el-form-item label="计划名称" prop="计划名称">
<el-input v-model="form2.离线采购计划名称" size="small"/>
</el-form-item>
<el-form-item label="供应商" prop="supplierNameValue">
<el-select v-model="form2.supplierNameValue" placeholder="供应商" size="small" filterable>
<el-option
v-for="item in supplierNames"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
v-show="title2==='创建外购备料计划'"
type="primary"
size="small"
icon="el-icon-check"
@click="submitAddPurchaseOrder">确定</el-button>
<el-button
v-show="title2==='编辑外购备料计划'"
type="primary"
size="small"
icon="el-icon-check"
@click="submitEditPurchaseOrder">确定</el-button>
</div>
</el-dialog>
</div>
</div>
</template>
@@ -279,7 +307,7 @@ export default {
离线采购计划流水号: ''
},
rules2: {
离线采购计划名称: [{ required: true, message: '请填写离线采购计划名称' }],
计划名称: [{ required: true, message: '请填写离线采购计划名称' }],
supplierNameValue: [{ required: true, message: '请选择供应商' }]
},
form3: {
@@ -483,7 +511,7 @@ export default {
}
this.form2.离线采购计划名称 = ''
this.form2.supplierNameValue = ''
this.title2 = '创建离线采购计划'
this.title2 = '创建外购备料计划'
this.dialogVisible2 = true
},
submitAddPurchaseOrder() { // 新建采购单
@@ -491,10 +519,10 @@ export default {
if (valid) {
addPurchaseOrder(this.form2.离线采购计划名称, this.form2.supplierNameValue).then(response => {
if (response.data[0].result === '1') {
this.$message.success('新建离线采购计划成功')
this.$message.success('新建离线外购备料成功')
this.searchTable()
this.dialogVisible2 = false
} else { this.$message.error('新建离线采购计划失败') }
} else { this.$message.error('新建离线外购备料失败') }
})
} else {
return false
@@ -505,7 +533,7 @@ export default {
if (this.$refs['form2'] !== undefined) {
this.$refs['form2'].resetFields()
}
this.title2 = '编辑离线采购计划'
this.title2 = '编辑外购备料计划'
this.form2.离线采购计划流水号 = row.离线采购计划流水号
this.form2.离线采购计划名称 = row.离线采购计划名称
this.form2.supplierNameValue = row.供应商流水号
@@ -516,10 +544,10 @@ export default {
if (valid) {
editPurchaseOrder(this.form2.离线采购计划流水号, this.form2.离线采购计划名称, this.form2.supplierNameValue).then(response => {
if (response.data[0].result === '1') {
this.$message.success('修改离线采购计划成功')
this.$message.success('修改离线外购备料成功')
this.searchTable()
this.dialogVisible2 = false
} else { this.$message.error('修改离线采购计划失败') }
} else { this.$message.error('修改离线外购备料失败') }
})
} else {
return false
@@ -547,7 +575,7 @@ export default {
},
submitAddMaterial() {
if (!this.离线采购计划流水号) {
this.$message.warning('请选择离线采购计划')
this.$message.warning('请选择外购备料计划')
} else if (this.materielGroup.length === 0) {
this.$message.warning('请勾选物料')
} else {
@@ -642,6 +670,25 @@ export default {
.el-tag{
margin: 0
}
.el-form--label-left >>> .el-form-item__label {
text-align: right;
}
>>>.el-dialog--center .el-dialog__body {
text-align: initial;
padding: 20px 30px 20px
}
>>>.el-dialog__header {
padding: 20px 20px 0px;
}
>>>.el-dialog__footer {
padding: 0px 20px 20px;
/*text-align: right;*/
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
>>>.el-form-item {
margin-bottom: 13px;
}
</style>
<style lang="scss">
.button111{