|
@@ -23,6 +23,7 @@ class Enterprise extends Component {
|
|
|
listValue: {},
|
|
|
orderNo: [],
|
|
|
newList: [],
|
|
|
+ jsList: [],
|
|
|
};
|
|
|
this.onChange = this.onChange.bind(this);
|
|
|
this.getList = this.getList.bind(this);
|
|
@@ -163,6 +164,7 @@ class Enterprise extends Component {
|
|
|
});
|
|
|
}}
|
|
|
/>
|
|
|
+ {/* 业务行政公出 */}
|
|
|
{
|
|
|
this.state.newList.length > 0 && this.props.type != 1 &&
|
|
|
<View className="slist">
|
|
@@ -202,6 +204,67 @@ class Enterprise extends Component {
|
|
|
<View className="cltips">增加企业:搜索增加更多企业,删除企业:点击“X”删除公出列表</View>
|
|
|
</View>
|
|
|
}
|
|
|
+ {/* 技术公出 */}
|
|
|
+ {
|
|
|
+ this.state.jsList.length > 0 && this.props.type == 1 &&
|
|
|
+ <View className="slist">
|
|
|
+ <View style={{ fontSize: "30rpx" }}>本次公出列表</View>
|
|
|
+ {
|
|
|
+ this.state.jsList.map((item, index) =>
|
|
|
+ <View className="slitems" key={index}>
|
|
|
+ <Text>{index + 1}、{item.name}{!!item.contractNo && `(${item.contractNo})`}</Text>
|
|
|
+ <AtIcon value='close' size='18'
|
|
|
+ onClick={() => {
|
|
|
+ let list = this.state.jsList
|
|
|
+ for (var i = 0; i < list.length; i++) {
|
|
|
+ if (list[i].id == item.id) {
|
|
|
+ list.splice(i, 1)
|
|
|
+ this.setState({
|
|
|
+ jsList: list
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ )
|
|
|
+ }
|
|
|
+ <View className="slbt">
|
|
|
+ <AtButton size="small" type='primary'
|
|
|
+ onClick={() => {
|
|
|
+ let contractNo = ""
|
|
|
+ let orderNo = ""
|
|
|
+ let select = 0
|
|
|
+ for (var i = 0; i < this.state.jsList.length; i++) {
|
|
|
+ if (!!this.state.jsList[i].contractNo) {
|
|
|
+ contractNo = this.state.jsList[i].contractNo
|
|
|
+ orderNo = this.state.jsList[i].orderNo
|
|
|
+ select = 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (select == 0) {
|
|
|
+ Taro.showToast({
|
|
|
+ title: "必须选择一个派单编号",
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ Taro.eventCenter.trigger("enterprise",
|
|
|
+ {
|
|
|
+ id: this.state.jsList.map(obj => { return obj.id; }).join(","),
|
|
|
+ name: this.state.jsList.map(obj => { return obj.name; }).join(","),
|
|
|
+ contractNo,
|
|
|
+ orderNo,
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }}
|
|
|
+ >确定公出列表</AtButton>
|
|
|
+ </View>
|
|
|
+ <View className="cltips">增加企业:搜索增加更多企业,删除企业:点击“X”删除公出列表</View>
|
|
|
+ </View>
|
|
|
+ }
|
|
|
+
|
|
|
<View>
|
|
|
{this.props.type == 0 || this.props.type == 2
|
|
|
? this.state.list.map((v, k) => (
|
|
@@ -238,11 +301,39 @@ class Enterprise extends Component {
|
|
|
arrow="right"
|
|
|
iconInfo={{ size: 25, color: "#000000", value: "bookmark" }}
|
|
|
onClick={() => {
|
|
|
- this.setState({
|
|
|
- listVisible: true,
|
|
|
- listValue: v,
|
|
|
- });
|
|
|
- this.getByUid(v);
|
|
|
+ let select = 0
|
|
|
+ if (this.state.jsList.length == 0) {
|
|
|
+ select = 0
|
|
|
+ }
|
|
|
+ for (var i = 0; i < this.state.jsList.length; i++) {
|
|
|
+ if (!!this.state.jsList[i].contractNo) {
|
|
|
+ select = 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (select == 0) {
|
|
|
+ this.setState({
|
|
|
+ listVisible: true,
|
|
|
+ listValue: v,
|
|
|
+ });
|
|
|
+ this.getByUid(v);
|
|
|
+ } else {
|
|
|
+ let list = this.state.jsList
|
|
|
+ for (var i = 0; i < list.length; i++) {
|
|
|
+ if (list[i].id == v.id) {
|
|
|
+ Taro.showToast({
|
|
|
+ title: "该企业已在公出列表中",
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ list.push(v)
|
|
|
+ this.setState({
|
|
|
+ jsList: list
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}}
|
|
|
/>
|
|
|
</View>
|
|
@@ -286,7 +377,13 @@ class Enterprise extends Component {
|
|
|
});
|
|
|
v.name = this.state.listValue.name;
|
|
|
v.id = this.state.listValue.id;
|
|
|
- Taro.eventCenter.trigger("enterprise", v);
|
|
|
+
|
|
|
+ let list = this.state.jsList
|
|
|
+ list.push(v)
|
|
|
+ this.setState({
|
|
|
+ jsList: list
|
|
|
+ })
|
|
|
+ // Taro.eventCenter.trigger("enterprise", v);
|
|
|
}}
|
|
|
>
|
|
|
选择
|